wined3d: Bind correct # of samplers for GLSL shaders

Jason Green jave27 at
Tue Jun 20 17:32:52 CDT 2006

- We are only checking against GL_MAX_TEXTURES when binding samplers,
when we should be checking against the maximum number of samplers that
the card supports.  Spotted by H. Verbeet.
-------------- next part --------------
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index c85b0c9..f3c9cca 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -60,7 +60,7 @@ void shader_glsl_load_psamplers(
     int i;
     char sampler_name[20];
-    for (i=0; i< GL_LIMITS(textures); ++i) {
+    for (i=0; i< GL_LIMITS(samplers); ++i) {
         if (stateBlock->textures[i] != NULL) {
            snprintf(sampler_name, sizeof(sampler_name), "Psampler%d", i);
            name_loc = GL_EXTCALL(glGetUniformLocationARB(programId, sampler_name));

More information about the wine-patches mailing list