diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra_qt/debugger/graphics_tracing.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/citra_qt/debugger/graphics_tracing.cpp b/src/citra_qt/debugger/graphics_tracing.cpp index 3e88346c0..654df12af 100644 --- a/src/citra_qt/debugger/graphics_tracing.cpp +++ b/src/citra_qt/debugger/graphics_tracing.cpp | |||
| @@ -13,6 +13,8 @@ | |||
| 13 | #include <QSpinBox> | 13 | #include <QSpinBox> |
| 14 | 14 | ||
| 15 | #include "core/hw/gpu.h" | 15 | #include "core/hw/gpu.h" |
| 16 | #include "core/hw/lcd.h" | ||
| 17 | |||
| 16 | #include "video_core/pica.h" | 18 | #include "video_core/pica.h" |
| 17 | 19 | ||
| 18 | #include "nihstro/float24.h" | 20 | #include "nihstro/float24.h" |
| @@ -62,23 +64,25 @@ void GraphicsTracingWidget::StartRecording() { | |||
| 62 | 64 | ||
| 63 | // Encode floating point numbers to 24-bit values | 65 | // Encode floating point numbers to 24-bit values |
| 64 | // TODO: Drop this explicit conversion once we store float24 values bit-correctly internally. | 66 | // TODO: Drop this explicit conversion once we store float24 values bit-correctly internally. |
| 65 | std::array<Math::Vec4<uint32_t>, 16> default_attributes; | 67 | std::array<uint32_t, 4 * 16> default_attributes; |
| 66 | for (unsigned i = 0; i < 16; ++i) { | 68 | for (unsigned i = 0; i < 16; ++i) { |
| 67 | for (unsigned comp = 0; comp < 3; ++comp) { | 69 | for (unsigned comp = 0; comp < 3; ++comp) { |
| 68 | default_attributes[i][comp] = nihstro::to_float24(Pica::g_state.vs.default_attributes[i][comp].ToFloat32()); | 70 | default_attributes[4 * i + comp] = nihstro::to_float24(Pica::g_state.vs.default_attributes[i][comp].ToFloat32()); |
| 69 | } | 71 | } |
| 70 | } | 72 | } |
| 71 | 73 | ||
| 72 | std::array<Math::Vec4<uint32_t>, 96> vs_float_uniforms; | 74 | std::array<uint32_t, 4 * 96> vs_float_uniforms; |
| 73 | for (unsigned i = 0; i < 96; ++i) | 75 | for (unsigned i = 0; i < 96; ++i) |
| 74 | for (unsigned comp = 0; comp < 3; ++comp) | 76 | for (unsigned comp = 0; comp < 3; ++comp) |
| 75 | vs_float_uniforms[i][comp] = nihstro::to_float24(Pica::g_state.vs.uniforms.f[i][comp].ToFloat32()); | 77 | vs_float_uniforms[4 * i + comp] = nihstro::to_float24(Pica::g_state.vs.uniforms.f[i][comp].ToFloat32()); |
| 76 | 78 | ||
| 77 | auto recorder = new CiTrace::Recorder((u32*)&GPU::g_regs, 0x700, nullptr, 0, (u32*)&Pica::g_state.regs, 0x300, | 79 | auto recorder = new CiTrace::Recorder((u32*)&GPU::g_regs, sizeof(GPU::g_regs) / sizeof(u32), |
| 78 | (u32*)default_attributes.data(), default_attributes.size() * 4, | 80 | (u32*)&LCD::g_regs, sizeof(LCD::g_regs) / sizeof(u32), |
| 81 | (u32*)&Pica::g_state.regs, sizeof(Pica::g_state.regs) / sizeof(u32), | ||
| 82 | default_attributes.data(), default_attributes.size(), | ||
| 79 | shader_binary.data(), shader_binary.size(), | 83 | shader_binary.data(), shader_binary.size(), |
| 80 | swizzle_data.data(), swizzle_data.size(), | 84 | swizzle_data.data(), swizzle_data.size(), |
| 81 | (u32*)vs_float_uniforms.data(), vs_float_uniforms.size() * 4, | 85 | vs_float_uniforms.data(), vs_float_uniforms.size(), |
| 82 | nullptr, 0, nullptr, 0, nullptr, 0 // Geometry shader is not implemented yet, so submit dummy data for now | 86 | nullptr, 0, nullptr, 0, nullptr, 0 // Geometry shader is not implemented yet, so submit dummy data for now |
| 83 | ); | 87 | ); |
| 84 | context->recorder = std::shared_ptr<CiTrace::Recorder>(recorder); | 88 | context->recorder = std::shared_ptr<CiTrace::Recorder>(recorder); |