aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2016-12-17 14:09:02 -0800
committerYuri Kunde Schlesner <yuriks@yuriks.net>2017-01-25 18:53:24 -0800
commit9ea5eacf919c8c257f8c5fda65e5fac2b6adee07 (patch)
treec62ade75473e8db7110f4528c40bb32f0be03684 /src
parent1a2acc3baae01b9469ee97333c2ec4d58c8a0b91 (diff)
Shader: Initialize conditional_code in interpreter
This doesn't belong in LoadInputVertex because it also happens for non-VS invocations. Since it's not used by the JIT it seems adequate to initialize it in the interpreter which is the only thing that cares about them.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/shader.cpp3
-rw-r--r--src/video_core/shader/shader_interpreter.cpp3
2 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp
index b30dae476b..1662b5d387 100644
--- a/src/video_core/shader/shader.cpp
+++ b/src/video_core/shader/shader.cpp
@@ -76,9 +76,6 @@ void UnitState::LoadInputVertex(const InputVertex& input, int num_attributes) {
for (int i = 0; i < num_attributes; i++)
registers.input[attribute_register_map.GetRegisterForAttribute(i)] = input.attr[i];
-
- conditional_code[0] = false;
- conditional_code[1] = false;
}
MICROPROFILE_DEFINE(GPU_Shader, "GPU", "Shader", MP_RGB(50, 50, 240));
diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp
index d1f11142dc..ecc2270891 100644
--- a/src/video_core/shader/shader_interpreter.cpp
+++ b/src/video_core/shader/shader_interpreter.cpp
@@ -45,6 +45,9 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData
boost::container::static_vector<CallStackElement, 16> call_stack;
u32 program_counter = offset;
+ state.conditional_code[0] = false;
+ state.conditional_code[1] = false;
+
auto call = [&program_counter, &call_stack](u32 offset, u32 num_instructions, u32 return_offset,
u8 repeat_count, u8 loop_increment) {
// -1 to make sure when incrementing the PC we end up at the correct offset