[wined3d] force NP2 fixup constant reloading in shader_glsl_select

Tobias Jakobi tjakobi at xdf79.math.uni-bielefeld.de
Fri May 29 08:01:44 CDT 2009


---
 dlls/wined3d/glsl_shader.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 9ade681..9d09d2c 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -4264,6 +4264,13 @@ static void shader_glsl_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {
     if (program_id) TRACE("Using GLSL program %u\n", program_id);
     GL_EXTCALL(glUseProgramObjectARB(program_id));
     checkGLcall("glUseProgramObjectARB");
+
+    /* In case that NP2 texcoord fixup data is found for the selected program, trigger a reload of the
+     * constants. This has to be done because it can't be guaranteed that sampler() (from state.c) is
+     * called between selecting the shader and using it, which results in wrong fixup for some frames. */
+    if (priv->glsl_program && priv->glsl_program->np2Fixup_info) {
+        This->shader_backend->shader_load_np2fixup_constants(iface, usePS, useVS);
+    }
 }
 
 /* GL locking is done by the caller */
-- 
1.5.4.3


--========GMX164631245152306684540--



More information about the wine-patches mailing list