Skip to content

Instantly share code, notes, and snippets.

@Subv
Last active August 29, 2015 14:16
Show Gist options
  • Save Subv/b9bd539fd52df9fa4e82 to your computer and use it in GitHub Desktop.
Save Subv/b9bd539fd52df9fa4e82 to your computer and use it in GitHub Desktop.
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index bc8c004..9d60d63 100644
-- a/src/video_core/vertex_shader.cpp
++ b/src/video_core/vertex_shader.cpp
@@ -163,9 +163,12 @@ static void ProcessShaderCode(VertexShaderState& state) {
// For now, we just abort in this situation.
ASSERT_MSG(!is_inverted, "Bad condition...");
- const int address_offset = (instr.common.address_register_index == 0)
+ int address_offset = (instr.common.address_register_index == 0)
? 0 : state.address_registers[instr.common.address_register_index - 1];
+ if (address_offset < -95 || address_offset > 95)
+ address_offset = 0;
const float24* src1_ = LookupSourceRegister(instr.common.GetSrc1(is_inverted) + address_offset);
const float24* src2_ = LookupSourceRegister(instr.common.GetSrc2(is_inverted));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment