mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-01 15:17:59 +00:00
wined3d: Cleanup shader_glsl_load_psamplers().
This commit is contained in:
parent
6421d45f53
commit
973496d5e4
1 changed files with 8 additions and 6 deletions
|
@ -85,15 +85,17 @@ static void shader_glsl_load_psamplers(
|
||||||
int i;
|
int i;
|
||||||
char sampler_name[20];
|
char sampler_name[20];
|
||||||
|
|
||||||
for (i=0; i< GL_LIMITS(fragment_samplers); ++i) {
|
for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) {
|
||||||
if (stateBlock->textures[i] != NULL) {
|
snprintf(sampler_name, sizeof(sampler_name), "Psampler%d", i);
|
||||||
snprintf(sampler_name, sizeof(sampler_name), "Psampler%d", i);
|
name_loc = GL_EXTCALL(glGetUniformLocationARB(programId, sampler_name));
|
||||||
name_loc = GL_EXTCALL(glGetUniformLocationARB(programId, sampler_name));
|
if (name_loc != -1) {
|
||||||
if (name_loc != -1) {
|
int mapped_unit = stateBlock->wineD3DDevice->texUnitMap[i];
|
||||||
int mapped_unit = stateBlock->wineD3DDevice->texUnitMap[i];
|
if (mapped_unit != -1 && mapped_unit < GL_LIMITS(fragment_samplers)) {
|
||||||
TRACE("Loading %s for texture %d\n", sampler_name, mapped_unit);
|
TRACE("Loading %s for texture %d\n", sampler_name, mapped_unit);
|
||||||
GL_EXTCALL(glUniform1iARB(name_loc, mapped_unit));
|
GL_EXTCALL(glUniform1iARB(name_loc, mapped_unit));
|
||||||
checkGLcall("glUniform1iARB");
|
checkGLcall("glUniform1iARB");
|
||||||
|
} else {
|
||||||
|
ERR("Trying to load sampler %s on unsupported unit %d\n", sampler_name, mapped_unit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue