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.
This commit is contained in:
parent
9431ee330a
commit
ecbad494d9
|
@ -301,6 +301,13 @@ GraphicsVertexShaderWidget::GraphicsVertexShaderWidget(std::shared_ptr< Pica::De
|
||||||
: BreakPointObserverDock(debug_context, "Pica Vertex Shader", parent) {
|
: BreakPointObserverDock(debug_context, "Pica Vertex Shader", parent) {
|
||||||
setObjectName("PicaVertexShader");
|
setObjectName("PicaVertexShader");
|
||||||
|
|
||||||
|
// Clear input vertex data so that it contains valid float values in case a debug shader
|
||||||
|
// execution happens before the first Vertex Loaded breakpoint.
|
||||||
|
// TODO: This makes a crash in the interpreter much less likely, but not impossible. The
|
||||||
|
// interpreter should guard against out-of-bounds accesses to ensure crashes in it aren't
|
||||||
|
// possible.
|
||||||
|
std::memset(&input_vertex, 0, sizeof(input_vertex));
|
||||||
|
|
||||||
auto input_data_mapper = new QSignalMapper(this);
|
auto input_data_mapper = new QSignalMapper(this);
|
||||||
|
|
||||||
// TODO: Support inputting data in hexadecimal raw format
|
// TODO: Support inputting data in hexadecimal raw format
|
||||||
|
|
Reference in New Issue