parcel.shader_samplers_used;
prog->_LinkedShaders[i]->shadow_samplers = parcel.shader_shadow_samplers;
- STATIC_ASSERT(sizeof(prog->_LinkedShaders[i]->SamplerTargets) ==
+ STATIC_ASSERT(sizeof(prog->_LinkedShaders[i]->Program->sh.SamplerTargets) ==
sizeof(parcel.targets));
- memcpy(prog->_LinkedShaders[i]->SamplerTargets, parcel.targets,
- sizeof(prog->_LinkedShaders[i]->SamplerTargets));
+ memcpy(prog->_LinkedShaders[i]->Program->sh.SamplerTargets,
+ parcel.targets,
+ sizeof(prog->_LinkedShaders[i]->Program->sh.SamplerTargets));
}
#ifndef NDEBUG
struct gl_uniform_block **UniformBlocks;
struct gl_uniform_block **ShaderStorageBlocks;
+ /** Which texture target is being sampled
+ * (TEXTURE_1D/2D/3D/etc_INDEX)
+ */
+ gl_texture_index SamplerTargets[MAX_SAMPLERS];
+
union {
struct {
/**
GLbitfield shadow_samplers; /**< Samplers used for shadow sampling. */
/*@}*/
- /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */
- gl_texture_index SamplerTargets[MAX_SAMPLERS];
-
/**
* Number of default uniform block components used by this shader.
*
struct gl_shader_info info;
};
-static inline GLbitfield gl_external_samplers(struct gl_linked_shader *shader)
+static inline GLbitfield gl_external_samplers(struct gl_program *prog)
{
GLbitfield external_samplers = 0;
- GLbitfield mask = shader->Program->SamplersUsed;
+ GLbitfield mask = prog->SamplersUsed;
while (mask) {
int idx = u_bit_scan(&mask);
- if (shader->SamplerTargets[idx] == TEXTURE_EXTERNAL_INDEX)
+ if (prog->sh.SamplerTargets[idx] == TEXTURE_EXTERNAL_INDEX)
external_samplers |= (1 << idx);
}
while (mask) {
const int s = u_bit_scan(&mask);
GLuint unit = shader->Program->SamplerUnits[s];
- GLuint tgt = shader->SamplerTargets[s];
+ GLuint tgt = shader->Program->sh.SamplerTargets[s];
/* FIXME: Samplers are initialized to 0 and Mesa doesn't do a
* great job of eliminating unused uniforms currently so for now
while (mask) {
const int s = u_bit_scan(&mask);
GLuint unit = prog->SamplerUnits[s];
- GLuint tgt = shader->SamplerTargets[s];
+ GLuint tgt = prog->sh.SamplerTargets[s];
assert(unit < ARRAY_SIZE(prog->TexturesUsed));
assert(tgt < NUM_TEXTURE_TARGETS);
do_set_program_inouts(shader->ir, prog, shader->Stage);
prog->ShadowSamplers = shader->shadow_samplers;
- prog->ExternalSamplersUsed = gl_external_samplers(shader);
+ prog->ExternalSamplersUsed = gl_external_samplers(prog);
_mesa_update_shader_textures_used(shader_program, prog);
/* Set the gl_FragDepth layout. */
}
prog->ShadowSamplers = shader->shadow_samplers;
- prog->ExternalSamplersUsed = gl_external_samplers(shader);
+ prog->ExternalSamplersUsed = gl_external_samplers(prog);
_mesa_update_shader_textures_used(shader_program, prog);
/* Avoid reallocation of the program parameter list, because the uniform