wined3d: Take the texUnitMap into account when loading shader_glsl_load_psamplers().

This commit is contained in:
H. Verbeet 2007-06-12 23:08:11 +02:00 committed by Alexandre Julliard
parent 2256e06de3
commit 8311ff32a3
1 changed files with 8 additions and 7 deletions

View File

@ -87,13 +87,14 @@ static void shader_glsl_load_psamplers(
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));
if (name_loc != -1) {
TRACE("Loading %s for texture %d\n", sampler_name, i);
GL_EXTCALL(glUniform1iARB(name_loc, i));
checkGLcall("glUniform1iARB");
}
snprintf(sampler_name, sizeof(sampler_name), "Psampler%d", i);
name_loc = GL_EXTCALL(glGetUniformLocationARB(programId, sampler_name));
if (name_loc != -1) {
int mapped_unit = stateBlock->wineD3DDevice->texUnitMap[i];
TRACE("Loading %s for texture %d\n", sampler_name, mapped_unit);
GL_EXTCALL(glUniform1iARB(name_loc, mapped_unit));
checkGLcall("glUniform1iARB");
}
}
}
}