diff options
| author | 2014-08-14 14:30:38 +0200 | |
|---|---|---|
| committer | 2014-08-25 22:03:18 +0200 | |
| commit | f37e39deb9abe88b4874ebc2889ed52e02ed9c13 (patch) | |
| tree | bbced32a26ee671ffb69de1c42492fc13b8f6724 /src | |
| parent | Pica: Add debug utility functions for dumping geometry data. (diff) | |
| download | yuzu-f37e39deb9abe88b4874ebc2889ed52e02ed9c13.tar.gz yuzu-f37e39deb9abe88b4874ebc2889ed52e02ed9c13.tar.xz yuzu-f37e39deb9abe88b4874ebc2889ed52e02ed9c13.zip | |
Pica: Add debug utilities for dumping shaders.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/debug_utils/debug_utils.cpp | 205 | ||||
| -rw-r--r-- | src/video_core/debug_utils/debug_utils.h | 3 | ||||
| -rw-r--r-- | src/video_core/pica.h | 2 | ||||
| -rw-r--r-- | src/video_core/vertex_shader.cpp | 18 |
4 files changed, 227 insertions, 1 deletions
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index ac895ec3a..f41249eac 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 5 | #include <fstream> | 6 | #include <fstream> |
| 6 | #include <string> | 7 | #include <string> |
| 7 | 8 | ||
| @@ -55,6 +56,210 @@ void GeometryDumper::Dump() { | |||
| 55 | } | 56 | } |
| 56 | } | 57 | } |
| 57 | 58 | ||
| 59 | #pragma pack(1) | ||
| 60 | struct DVLBHeader { | ||
| 61 | enum : u32 { | ||
| 62 | MAGIC_WORD = 0x424C5644, // "DVLB" | ||
| 63 | }; | ||
| 64 | |||
| 65 | u32 magic_word; | ||
| 66 | u32 num_programs; | ||
| 67 | // u32 dvle_offset_table[]; | ||
| 68 | }; | ||
| 69 | static_assert(sizeof(DVLBHeader) == 0x8, "Incorrect structure size"); | ||
| 70 | |||
| 71 | struct DVLPHeader { | ||
| 72 | enum : u32 { | ||
| 73 | MAGIC_WORD = 0x504C5644, // "DVLP" | ||
| 74 | }; | ||
| 75 | |||
| 76 | u32 magic_word; | ||
| 77 | u32 version; | ||
| 78 | u32 binary_offset; // relative to DVLP start | ||
| 79 | u32 binary_size_words; | ||
| 80 | u32 swizzle_patterns_offset; | ||
| 81 | u32 swizzle_patterns_num_entries; | ||
| 82 | u32 unk2; | ||
| 83 | }; | ||
| 84 | static_assert(sizeof(DVLPHeader) == 0x1C, "Incorrect structure size"); | ||
| 85 | |||
| 86 | struct DVLEHeader { | ||
| 87 | enum : u32 { | ||
| 88 | MAGIC_WORD = 0x454c5644, // "DVLE" | ||
| 89 | }; | ||
| 90 | |||
| 91 | enum class ShaderType : u8 { | ||
| 92 | VERTEX = 0, | ||
| 93 | GEOMETRY = 1, | ||
| 94 | }; | ||
| 95 | |||
| 96 | u32 magic_word; | ||
| 97 | u16 pad1; | ||
| 98 | ShaderType type; | ||
| 99 | u8 pad2; | ||
| 100 | u32 main_offset_words; // offset within binary blob | ||
| 101 | u32 endmain_offset_words; | ||
| 102 | u32 pad3; | ||
| 103 | u32 pad4; | ||
| 104 | u32 constant_table_offset; | ||
| 105 | u32 constant_table_size; // number of entries | ||
| 106 | u32 label_table_offset; | ||
| 107 | u32 label_table_size; | ||
| 108 | u32 output_register_table_offset; | ||
| 109 | u32 output_register_table_size; | ||
| 110 | u32 uniform_table_offset; | ||
| 111 | u32 uniform_table_size; | ||
| 112 | u32 symbol_table_offset; | ||
| 113 | u32 symbol_table_size; | ||
| 114 | |||
| 115 | }; | ||
| 116 | static_assert(sizeof(DVLEHeader) == 0x40, "Incorrect structure size"); | ||
| 117 | #pragma pack() | ||
| 118 | |||
| 119 | void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data, u32 swizzle_size, | ||
| 120 | u32 main_offset, const Regs::VSOutputAttributes* output_attributes) | ||
| 121 | { | ||
| 122 | // NOTE: Permanently enabling this just trashes hard disks for no reason. | ||
| 123 | // Hence, this is currently disabled. | ||
| 124 | return; | ||
| 125 | |||
| 126 | struct StuffToWrite { | ||
| 127 | u8* pointer; | ||
| 128 | u32 size; | ||
| 129 | }; | ||
| 130 | std::vector<StuffToWrite> writing_queue; | ||
| 131 | u32 write_offset = 0; | ||
| 132 | |||
| 133 | auto QueueForWriting = [&writing_queue,&write_offset](u8* pointer, u32 size) { | ||
| 134 | writing_queue.push_back({pointer, size}); | ||
| 135 | u32 old_write_offset = write_offset; | ||
| 136 | write_offset += size; | ||
| 137 | return old_write_offset; | ||
| 138 | }; | ||
| 139 | |||
| 140 | // First off, try to translate Pica state (one enum for output attribute type and component) | ||
| 141 | // into shbin format (separate type and component mask). | ||
| 142 | union OutputRegisterInfo { | ||
| 143 | enum Type : u64 { | ||
| 144 | POSITION = 0, | ||
| 145 | COLOR = 2, | ||
| 146 | TEXCOORD0 = 3, | ||
| 147 | TEXCOORD1 = 5, | ||
| 148 | TEXCOORD2 = 6, | ||
| 149 | }; | ||
| 150 | |||
| 151 | BitField< 0, 64, u64> hex; | ||
| 152 | |||
| 153 | BitField< 0, 16, Type> type; | ||
| 154 | BitField<16, 16, u64> id; | ||
| 155 | BitField<32, 4, u64> component_mask; | ||
| 156 | }; | ||
| 157 | |||
| 158 | // This is put into a try-catch block to make sure we notice unknown configurations. | ||
| 159 | std::vector<OutputRegisterInfo> output_info_table; | ||
| 160 | for (int i = 0; i < 7; ++i) { | ||
| 161 | using OutputAttributes = Pica::Regs::VSOutputAttributes; | ||
| 162 | |||
| 163 | // TODO: It's still unclear how the attribute components map to the register! | ||
| 164 | // Once we know that, this code probably will not make much sense anymore. | ||
| 165 | std::map<OutputAttributes::Semantic, std::pair<OutputRegisterInfo::Type, u32> > map = { | ||
| 166 | { OutputAttributes::POSITION_X, { OutputRegisterInfo::POSITION, 1} }, | ||
| 167 | { OutputAttributes::POSITION_Y, { OutputRegisterInfo::POSITION, 2} }, | ||
| 168 | { OutputAttributes::POSITION_Z, { OutputRegisterInfo::POSITION, 4} }, | ||
| 169 | { OutputAttributes::POSITION_W, { OutputRegisterInfo::POSITION, 8} }, | ||
| 170 | { OutputAttributes::COLOR_R, { OutputRegisterInfo::COLOR, 1} }, | ||
| 171 | { OutputAttributes::COLOR_G, { OutputRegisterInfo::COLOR, 2} }, | ||
| 172 | { OutputAttributes::COLOR_B, { OutputRegisterInfo::COLOR, 4} }, | ||
| 173 | { OutputAttributes::COLOR_A, { OutputRegisterInfo::COLOR, 8} }, | ||
| 174 | { OutputAttributes::TEXCOORD0_U, { OutputRegisterInfo::TEXCOORD0, 1} }, | ||
| 175 | { OutputAttributes::TEXCOORD0_V, { OutputRegisterInfo::TEXCOORD0, 2} }, | ||
| 176 | { OutputAttributes::TEXCOORD1_U, { OutputRegisterInfo::TEXCOORD1, 1} }, | ||
| 177 | { OutputAttributes::TEXCOORD1_V, { OutputRegisterInfo::TEXCOORD1, 2} }, | ||
| 178 | { OutputAttributes::TEXCOORD2_U, { OutputRegisterInfo::TEXCOORD2, 1} }, | ||
| 179 | { OutputAttributes::TEXCOORD2_V, { OutputRegisterInfo::TEXCOORD2, 2} } | ||
| 180 | }; | ||
| 181 | |||
| 182 | for (const auto& semantic : std::vector<OutputAttributes::Semantic>{ | ||
| 183 | output_attributes[i].map_x, | ||
| 184 | output_attributes[i].map_y, | ||
| 185 | output_attributes[i].map_z, | ||
| 186 | output_attributes[i].map_w }) { | ||
| 187 | if (semantic == OutputAttributes::INVALID) | ||
| 188 | continue; | ||
| 189 | |||
| 190 | try { | ||
| 191 | OutputRegisterInfo::Type type = map.at(semantic).first; | ||
| 192 | u32 component_mask = map.at(semantic).second; | ||
| 193 | |||
| 194 | auto it = std::find_if(output_info_table.begin(), output_info_table.end(), | ||
| 195 | [&i, &type](const OutputRegisterInfo& info) { | ||
| 196 | return info.id == i && info.type == type; | ||
| 197 | } | ||
| 198 | ); | ||
| 199 | |||
| 200 | if (it == output_info_table.end()) { | ||
| 201 | output_info_table.push_back({}); | ||
| 202 | output_info_table.back().type = type; | ||
| 203 | output_info_table.back().component_mask = component_mask; | ||
| 204 | output_info_table.back().id = i; | ||
| 205 | } else { | ||
| 206 | it->component_mask = it->component_mask | component_mask; | ||
| 207 | } | ||
| 208 | } catch (const std::out_of_range& oor) { | ||
| 209 | _dbg_assert_msg_(GPU, 0, "Unknown output attribute mapping"); | ||
| 210 | ERROR_LOG(GPU, "Unknown output attribute mapping: %03x, %03x, %03x, %03x", | ||
| 211 | (int)output_attributes[i].map_x.Value(), | ||
| 212 | (int)output_attributes[i].map_y.Value(), | ||
| 213 | (int)output_attributes[i].map_z.Value(), | ||
| 214 | (int)output_attributes[i].map_w.Value()); | ||
| 215 | } | ||
| 216 | } | ||
| 217 | } | ||
| 218 | |||
| 219 | |||
| 220 | struct { | ||
| 221 | DVLBHeader header; | ||
| 222 | u32 dvle_offset; | ||
| 223 | } dvlb{ {DVLBHeader::MAGIC_WORD, 1 } }; // 1 DVLE | ||
| 224 | |||
| 225 | DVLPHeader dvlp{ DVLPHeader::MAGIC_WORD }; | ||
| 226 | DVLEHeader dvle{ DVLEHeader::MAGIC_WORD }; | ||
| 227 | |||
| 228 | QueueForWriting((u8*)&dvlb, sizeof(dvlb)); | ||
| 229 | u32 dvlp_offset = QueueForWriting((u8*)&dvlp, sizeof(dvlp)); | ||
| 230 | dvlb.dvle_offset = QueueForWriting((u8*)&dvle, sizeof(dvle)); | ||
| 231 | |||
| 232 | // TODO: Reduce the amount of binary code written to relevant portions | ||
| 233 | dvlp.binary_offset = write_offset - dvlp_offset; | ||
| 234 | dvlp.binary_size_words = binary_size; | ||
| 235 | QueueForWriting((u8*)binary_data, binary_size * sizeof(u32)); | ||
| 236 | |||
| 237 | dvlp.swizzle_patterns_offset = write_offset - dvlp_offset; | ||
| 238 | dvlp.swizzle_patterns_num_entries = swizzle_size; | ||
| 239 | u32 dummy = 0; | ||
| 240 | for (int i = 0; i < swizzle_size; ++i) { | ||
| 241 | QueueForWriting((u8*)&swizzle_data[i], sizeof(swizzle_data[i])); | ||
| 242 | QueueForWriting((u8*)&dummy, sizeof(dummy)); | ||
| 243 | } | ||
| 244 | |||
| 245 | dvle.main_offset_words = main_offset; | ||
| 246 | dvle.output_register_table_offset = write_offset - dvlb.dvle_offset; | ||
| 247 | dvle.output_register_table_size = output_info_table.size(); | ||
| 248 | QueueForWriting((u8*)output_info_table.data(), output_info_table.size() * sizeof(OutputRegisterInfo)); | ||
| 249 | |||
| 250 | // TODO: Create a label table for "main" | ||
| 251 | |||
| 252 | |||
| 253 | // Write data to file | ||
| 254 | static int dump_index = 0; | ||
| 255 | std::string filename = std::string("shader_dump") + std::to_string(++dump_index) + std::string(".shbin"); | ||
| 256 | std::ofstream file(filename, std::ios_base::out | std::ios_base::binary); | ||
| 257 | |||
| 258 | for (auto& chunk : writing_queue) { | ||
| 259 | file.write((char*)chunk.pointer, chunk.size); | ||
| 260 | } | ||
| 261 | } | ||
| 262 | |||
| 58 | } // namespace | 263 | } // namespace |
| 59 | 264 | ||
| 60 | } // namespace | 265 | } // namespace |
diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h index 9b4dce539..bd7a0a89b 100644 --- a/src/video_core/debug_utils/debug_utils.h +++ b/src/video_core/debug_utils/debug_utils.h | |||
| @@ -35,6 +35,9 @@ private: | |||
| 35 | std::vector<Face> faces; | 35 | std::vector<Face> faces; |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data, u32 swizzle_size, | ||
| 39 | u32 main_offset, const Regs::VSOutputAttributes* output_attributes); | ||
| 40 | |||
| 38 | } // namespace | 41 | } // namespace |
| 39 | 42 | ||
| 40 | } // namespace | 43 | } // namespace |
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 640830144..fe886c16f 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h | |||
| @@ -57,7 +57,7 @@ struct Regs { | |||
| 57 | 57 | ||
| 58 | INSERT_PADDING_WORDS(0x1); | 58 | INSERT_PADDING_WORDS(0x1); |
| 59 | 59 | ||
| 60 | union { | 60 | union VSOutputAttributes { |
| 61 | // Maps components of output vertex attributes to semantics | 61 | // Maps components of output vertex attributes to semantics |
| 62 | enum Semantic : u32 | 62 | enum Semantic : u32 |
| 63 | { | 63 | { |
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp index 93830a96a..8df14b51f 100644 --- a/src/video_core/vertex_shader.cpp +++ b/src/video_core/vertex_shader.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "pica.h" | 5 | #include "pica.h" |
| 6 | #include "vertex_shader.h" | 6 | #include "vertex_shader.h" |
| 7 | #include "debug_utils/debug_utils.h" | ||
| 7 | #include <core/mem_map.h> | 8 | #include <core/mem_map.h> |
| 8 | #include <common/file_util.h> | 9 | #include <common/file_util.h> |
| 9 | 10 | ||
| @@ -50,6 +51,11 @@ struct VertexShaderState { | |||
| 50 | }; | 51 | }; |
| 51 | u32 call_stack[8]; // TODO: What is the maximal call stack depth? | 52 | u32 call_stack[8]; // TODO: What is the maximal call stack depth? |
| 52 | u32* call_stack_pointer; | 53 | u32* call_stack_pointer; |
| 54 | |||
| 55 | struct { | ||
| 56 | u32 max_offset; // maximum program counter ever reached | ||
| 57 | u32 max_opdesc_id; // maximum swizzle pattern index ever used | ||
| 58 | } debug; | ||
| 53 | }; | 59 | }; |
| 54 | 60 | ||
| 55 | static void ProcessShaderCode(VertexShaderState& state) { | 61 | static void ProcessShaderCode(VertexShaderState& state) { |
| @@ -57,6 +63,7 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 57 | bool increment_pc = true; | 63 | bool increment_pc = true; |
| 58 | bool exit_loop = false; | 64 | bool exit_loop = false; |
| 59 | const Instruction& instr = *(const Instruction*)state.program_counter; | 65 | const Instruction& instr = *(const Instruction*)state.program_counter; |
| 66 | state.debug.max_offset = std::max<u32>(state.debug.max_offset, 1 + (state.program_counter - shader_memory)); | ||
| 60 | 67 | ||
| 61 | const float24* src1_ = (instr.common.src1 < 0x10) ? state.input_register_table[instr.common.src1] | 68 | const float24* src1_ = (instr.common.src1 < 0x10) ? state.input_register_table[instr.common.src1] |
| 62 | : (instr.common.src1 < 0x20) ? &state.temporary_registers[instr.common.src1-0x10].x | 69 | : (instr.common.src1 < 0x20) ? &state.temporary_registers[instr.common.src1-0x10].x |
| @@ -88,6 +95,7 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 88 | switch (instr.opcode) { | 95 | switch (instr.opcode) { |
| 89 | case Instruction::OpCode::ADD: | 96 | case Instruction::OpCode::ADD: |
| 90 | { | 97 | { |
| 98 | state.debug.max_opdesc_id = std::max<u32>(state.debug.max_opdesc_id, 1+instr.common.operand_desc_id); | ||
| 91 | for (int i = 0; i < 4; ++i) { | 99 | for (int i = 0; i < 4; ++i) { |
| 92 | if (!swizzle.DestComponentEnabled(i)) | 100 | if (!swizzle.DestComponentEnabled(i)) |
| 93 | continue; | 101 | continue; |
| @@ -100,6 +108,7 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 100 | 108 | ||
| 101 | case Instruction::OpCode::MUL: | 109 | case Instruction::OpCode::MUL: |
| 102 | { | 110 | { |
| 111 | state.debug.max_opdesc_id = std::max<u32>(state.debug.max_opdesc_id, 1+instr.common.operand_desc_id); | ||
| 103 | for (int i = 0; i < 4; ++i) { | 112 | for (int i = 0; i < 4; ++i) { |
| 104 | if (!swizzle.DestComponentEnabled(i)) | 113 | if (!swizzle.DestComponentEnabled(i)) |
| 105 | continue; | 114 | continue; |
| @@ -113,6 +122,7 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 113 | case Instruction::OpCode::DP3: | 122 | case Instruction::OpCode::DP3: |
| 114 | case Instruction::OpCode::DP4: | 123 | case Instruction::OpCode::DP4: |
| 115 | { | 124 | { |
| 125 | state.debug.max_opdesc_id = std::max<u32>(state.debug.max_opdesc_id, 1+instr.common.operand_desc_id); | ||
| 116 | float24 dot = float24::FromFloat32(0.f); | 126 | float24 dot = float24::FromFloat32(0.f); |
| 117 | int num_components = (instr.opcode == Instruction::OpCode::DP3) ? 3 : 4; | 127 | int num_components = (instr.opcode == Instruction::OpCode::DP3) ? 3 : 4; |
| 118 | for (int i = 0; i < num_components; ++i) | 128 | for (int i = 0; i < num_components; ++i) |
| @@ -130,6 +140,7 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 130 | // Reciprocal | 140 | // Reciprocal |
| 131 | case Instruction::OpCode::RCP: | 141 | case Instruction::OpCode::RCP: |
| 132 | { | 142 | { |
| 143 | state.debug.max_opdesc_id = std::max<u32>(state.debug.max_opdesc_id, 1+instr.common.operand_desc_id); | ||
| 133 | for (int i = 0; i < 4; ++i) { | 144 | for (int i = 0; i < 4; ++i) { |
| 134 | if (!swizzle.DestComponentEnabled(i)) | 145 | if (!swizzle.DestComponentEnabled(i)) |
| 135 | continue; | 146 | continue; |
| @@ -145,6 +156,7 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 145 | // Reciprocal Square Root | 156 | // Reciprocal Square Root |
| 146 | case Instruction::OpCode::RSQ: | 157 | case Instruction::OpCode::RSQ: |
| 147 | { | 158 | { |
| 159 | state.debug.max_opdesc_id = std::max<u32>(state.debug.max_opdesc_id, 1+instr.common.operand_desc_id); | ||
| 148 | for (int i = 0; i < 4; ++i) { | 160 | for (int i = 0; i < 4; ++i) { |
| 149 | if (!swizzle.DestComponentEnabled(i)) | 161 | if (!swizzle.DestComponentEnabled(i)) |
| 150 | continue; | 162 | continue; |
| @@ -159,6 +171,7 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 159 | 171 | ||
| 160 | case Instruction::OpCode::MOV: | 172 | case Instruction::OpCode::MOV: |
| 161 | { | 173 | { |
| 174 | state.debug.max_opdesc_id = std::max<u32>(state.debug.max_opdesc_id, 1+instr.common.operand_desc_id); | ||
| 162 | for (int i = 0; i < 4; ++i) { | 175 | for (int i = 0; i < 4; ++i) { |
| 163 | if (!swizzle.DestComponentEnabled(i)) | 176 | if (!swizzle.DestComponentEnabled(i)) |
| 164 | continue; | 177 | continue; |
| @@ -212,6 +225,8 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes) | |||
| 212 | 225 | ||
| 213 | const u32* main = &shader_memory[registers.vs_main_offset]; | 226 | const u32* main = &shader_memory[registers.vs_main_offset]; |
| 214 | state.program_counter = (u32*)main; | 227 | state.program_counter = (u32*)main; |
| 228 | state.debug.max_offset = 0; | ||
| 229 | state.debug.max_opdesc_id = 0; | ||
| 215 | 230 | ||
| 216 | // Setup input register table | 231 | // Setup input register table |
| 217 | const auto& attribute_register_map = registers.vs_input_register_map; | 232 | const auto& attribute_register_map = registers.vs_input_register_map; |
| @@ -255,6 +270,9 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes) | |||
| 255 | state.call_stack_pointer = &state.call_stack[0]; | 270 | state.call_stack_pointer = &state.call_stack[0]; |
| 256 | 271 | ||
| 257 | ProcessShaderCode(state); | 272 | ProcessShaderCode(state); |
| 273 | DebugUtils::DumpShader(shader_memory, state.debug.max_offset, swizzle_data, | ||
| 274 | state.debug.max_opdesc_id, registers.vs_main_offset, | ||
| 275 | registers.vs_output_attributes); | ||
| 258 | 276 | ||
| 259 | DEBUG_LOG(GPU, "Output vertex: pos (%.2f, %.2f, %.2f, %.2f), col(%.2f, %.2f, %.2f, %.2f), tc0(%.2f, %.2f)", | 277 | DEBUG_LOG(GPU, "Output vertex: pos (%.2f, %.2f, %.2f, %.2f), col(%.2f, %.2f, %.2f, %.2f), tc0(%.2f, %.2f)", |
| 260 | ret.pos.x.ToFloat32(), ret.pos.y.ToFloat32(), ret.pos.z.ToFloat32(), ret.pos.w.ToFloat32(), | 278 | ret.pos.x.ToFloat32(), ret.pos.y.ToFloat32(), ret.pos.z.ToFloat32(), ret.pos.w.ToFloat32(), |