storage->opaque[sh].active) {
for (unsigned i = 0; i < elements; i++) {
const unsigned index = storage->opaque[sh].index + i;
- shader->SamplerUnits[index] = storage->storage[i].i;
+ shader->Program->SamplerUnits[index] =
+ storage->storage[i].i;
}
} else if (storage->type->base_type == GLSL_TYPE_IMAGE &&
if (shader && storage->opaque[sh].active) {
unsigned index = storage->opaque[sh].index;
- shader->SamplerUnits[index] = storage->storage[0].i;
+ shader->Program->SamplerUnits[index] = storage->storage[0].i;
}
}
}
GLbitfield shadow_samplers; /**< Samplers used for shadow sampling. */
/*@}*/
- /**
- * Map from sampler unit to texture unit (set by glUniform1i())
- *
- * A sampler unit is associated with each sampler uniform by the linker.
- * The sampler unit associated with each uniform is stored in the
- * \c gl_uniform_storage::sampler field.
- */
- GLubyte SamplerUnits[MAX_SAMPLERS];
/** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */
gl_texture_index SamplerTargets[MAX_SAMPLERS];
bool changed = false;
for (int j = 0; j < count; j++) {
unsigned unit = uni->opaque[i].index + offset + j;
- if (sh->SamplerUnits[unit] != ((unsigned *) values)[j]) {
- sh->SamplerUnits[unit] = ((unsigned *) values)[j];
+ if (sh->Program->SamplerUnits[unit] != ((unsigned *) values)[j]) {
+ sh->Program->SamplerUnits[unit] = ((unsigned *) values)[j];
changed = true;
}
}
}
struct gl_program *const prog = sh->Program;
- assert(sizeof(prog->SamplerUnits) == sizeof(sh->SamplerUnits));
-
_mesa_update_shader_textures_used(shProg, prog);
if (ctx->Driver.SamplerUniformChange)
ctx->Driver.SamplerUniformChange(ctx, prog->Target, prog);
mask = shader->Program->SamplersUsed;
while (mask) {
const int s = u_bit_scan(&mask);
- GLuint unit = shader->SamplerUnits[s];
+ GLuint unit = shader->Program->SamplerUnits[s];
GLuint tgt = shader->SamplerTargets[s];
/* FIXME: Samplers are initialized to 0 and Mesa doesn't do a
assert(shader);
- memcpy(prog->SamplerUnits, shader->SamplerUnits, sizeof(prog->SamplerUnits));
memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed));
shProg->SamplersValidated = GL_TRUE;
while (mask) {
const int s = u_bit_scan(&mask);
- GLuint unit = shader->SamplerUnits[s];
+ GLuint unit = prog->SamplerUnits[s];
GLuint tgt = shader->SamplerTargets[s];
assert(unit < ARRAY_SIZE(prog->TexturesUsed));
assert(tgt < NUM_TEXTURE_TARGETS);