summaryrefslogtreecommitdiff
path: root/retrace/daemon/glframe_state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'retrace/daemon/glframe_state.cpp')
-rw-r--r--retrace/daemon/glframe_state.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/retrace/daemon/glframe_state.cpp b/retrace/daemon/glframe_state.cpp
index a8e5d8d2..dbc57d69 100644
--- a/retrace/daemon/glframe_state.cpp
+++ b/retrace/daemon/glframe_state.cpp
@@ -38,6 +38,7 @@
#include "glframe_glhelper.hpp"
#include "glframe_logger.hpp"
#include "glframe_retrace_interface.hpp"
+#include "glframe_uniforms.hpp"
#include "glretrace.hpp"
#include "retrace.hpp"
#include "trace_model.hpp"
@@ -49,6 +50,7 @@ using glretrace::OnFrameRetrace;
using glretrace::ShaderAssembly;
using glretrace::ShaderType;
using glretrace::AssemblyType;
+using glretrace::Uniforms;
using trace::Call;
using trace::Array;
@@ -610,6 +612,16 @@ StateTrack::useProgram(int orig_retraced_program,
binding);
}
+ // set initial uniform state for program, based on the original.
+ // Some game titles partially initialize uniforms at link time.
+ int cur_prog;
+ GlFunctions::GetIntegerv(GL_CURRENT_PROGRAM, &cur_prog);
+ GlFunctions::UseProgram(orig_retraced_program);
+ Uniforms orig;
+ GlFunctions::UseProgram(pid);
+ orig.set();
+ GlFunctions::UseProgram(cur_prog);
+
return pid;
}