* are promoted to [0,0,0,1] for the purposes of this analysis.
*/
struct tracker {
- GLboolean twoside;
+ bool twoside;
GLubyte active[PROGRAM_OUTPUT+1][MAX_PROGRAM_TEMPS];
GLbitfield size_masks[4]; /**< one bit per fragment program input attrib */
};
* which describes the fragment program input sizes.
*/
for (vertRes = VERT_RESULT_TEX0; vertRes < VERT_RESULT_MAX; vertRes++) {
- GLint fragAttrib;
/* map vertex program output index to fragment program input index */
- if (vertRes <= VERT_RESULT_TEX7)
- fragAttrib = FRAG_ATTRIB_TEX0 + vertRes - VERT_RESULT_TEX0;
- else if (vertRes >= VERT_RESULT_VAR0)
- fragAttrib = FRAG_ATTRIB_VAR0 + vertRes - VERT_RESULT_VAR0;
- else
+ GLint fragAttrib = _mesa_vert_result_to_frag_attrib(vertRes);
+ if (fragAttrib < 0)
continue;
assert(fragAttrib >= FRAG_ATTRIB_TEX0);
assert(fragAttrib <= FRAG_ATTRIB_MAX);
memset(&t, 0, sizeof(t));
- /* _NEW_LIGHT */
- if (ctx->Light.Model.TwoSide)
+ /* _NEW_LIGHT | _NEW_PROGRAM */
+ if (ctx->VertexProgram._TwoSideEnabled)
t.twoside = 1;
for (i = 0; i < VERT_ATTRIB_MAX; i++)
- if (vp->program.Base.InputsRead & (1<<i))
+ if (vp->program.Base.InputsRead & BITFIELD64_BIT(i))
set_active_component(&t, PROGRAM_INPUT, i,
szflag[get_input_size(brw, i)]);
const struct brw_tracked_state brw_wm_input_sizes = {
.dirty = {
- .mesa = _NEW_LIGHT,
+ .mesa = _NEW_LIGHT | _NEW_PROGRAM,
.brw = BRW_NEW_VERTEX_PROGRAM | BRW_NEW_INPUT_DIMENSIONS,
.cache = 0
},
- .prepare = calc_wm_input_sizes
+ .emit = calc_wm_input_sizes
};