diff options
| author | 2015-08-25 05:44:59 -0300 | |
|---|---|---|
| committer | 2015-09-07 16:46:25 -0300 | |
| commit | ecbad494d9f1e39b0e11fb58a38e868d2390c5c6 (patch) | |
| tree | 2da28feb56029f9a3880fc4693b9ab2fe7259bf2 /src/citra_qt/debugger/graphics_vertex_shader.cpp | |
| parent | Shader Disassembly: Cleanup code and improve output alignment (diff) | |
| download | yuzu-ecbad494d9f1e39b0e11fb58a38e868d2390c5c6.tar.gz yuzu-ecbad494d9f1e39b0e11fb58a38e868d2390c5c6.tar.xz yuzu-ecbad494d9f1e39b0e11fb58a38e868d2390c5c6.zip | |
Shader Debugger: Initialize input_vertex to prevent crashes
If the first type of breakpoint to be hit wasn't "Vertex Loaded", the
input_vertex would contain garbage, which would be passed to the shader
interpreter and ocasionally cause crashes.
Diffstat (limited to 'src/citra_qt/debugger/graphics_vertex_shader.cpp')
| -rw-r--r-- | src/citra_qt/debugger/graphics_vertex_shader.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp index eaa749f30..e5af76074 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp | |||
| @@ -301,6 +301,13 @@ GraphicsVertexShaderWidget::GraphicsVertexShaderWidget(std::shared_ptr< Pica::De | |||
| 301 | : BreakPointObserverDock(debug_context, "Pica Vertex Shader", parent) { | 301 | : BreakPointObserverDock(debug_context, "Pica Vertex Shader", parent) { |
| 302 | setObjectName("PicaVertexShader"); | 302 | setObjectName("PicaVertexShader"); |
| 303 | 303 | ||
| 304 | // Clear input vertex data so that it contains valid float values in case a debug shader | ||
| 305 | // execution happens before the first Vertex Loaded breakpoint. | ||
| 306 | // TODO: This makes a crash in the interpreter much less likely, but not impossible. The | ||
| 307 | // interpreter should guard against out-of-bounds accesses to ensure crashes in it aren't | ||
| 308 | // possible. | ||
| 309 | std::memset(&input_vertex, 0, sizeof(input_vertex)); | ||
| 310 | |||
| 304 | auto input_data_mapper = new QSignalMapper(this); | 311 | auto input_data_mapper = new QSignalMapper(this); |
| 305 | 312 | ||
| 306 | // TODO: Support inputting data in hexadecimal raw format | 313 | // TODO: Support inputting data in hexadecimal raw format |