brw_setup_vec4_key_clip_info(brw, &key.base,
gp->program.Base.UsesClipDistanceOut);
- /* _NEW_LIGHT | _NEW_BUFFERS */
- key.base.clamp_vertex_color = ctx->Light._ClampVertexColor;
-
/* _NEW_TEXTURE */
brw_populate_sampler_prog_key_data(ctx, prog, stage_state->sampler_count,
&key.base.tex);
const struct brw_tracked_state brw_gs_prog = {
.dirty = {
- .mesa = _NEW_BUFFERS |
- _NEW_LIGHT |
- _NEW_TEXTURE,
+ .mesa = _NEW_TEXTURE,
.brw = BRW_NEW_GEOMETRY_PROGRAM |
BRW_NEW_TRANSFORM_FEEDBACK |
BRW_NEW_VUE_MAP_VS,
*/
unsigned nr_userclip_plane_consts:4;
- bool clamp_vertex_color:1;
-
struct brw_sampler_prog_key_data tex;
};
bool copy_edgeflag:1;
+ bool clamp_vertex_color:1;
+
/**
* For pre-Gen6 hardware, a bitfield indicating which texture coordinates
* are going to be replaced with point coordinates (as a consequence of a
GLuint id, struct gl_program *prog)
{
key->program_string_id = id;
- key->clamp_vertex_color = ctx->API == API_OPENGL_COMPAT;
unsigned sampler_count = _mesa_fls(prog->SamplersUsed);
for (unsigned i = 0; i < sampler_count; i++) {
case VARYING_SLOT_COL1:
case VARYING_SLOT_BFC0:
case VARYING_SLOT_BFC1: {
+ /* These built-in varyings are only supported in compatibility mode,
+ * and we only support GS in core profile. So, this must be a vertex
+ * shader.
+ */
+ assert(stage == MESA_SHADER_VERTEX);
vec4_instruction *inst = emit_generic_urb_slot(reg, varying);
- if (key->clamp_vertex_color)
+ if (((struct brw_vs_prog_key *) key)->clamp_vertex_color)
inst->saturate = true;
break;
}
found |= key_debug(brw, "PointCoord replace",
old_key->point_coord_replace, key->point_coord_replace);
found |= key_debug(brw, "vertex color clamping",
- old_key->base.clamp_vertex_color, key->base.clamp_vertex_color);
+ old_key->clamp_vertex_color, key->clamp_vertex_color);
found |= brw_debug_recompile_sampler_key(brw, &old_key->base.tex,
&key->base.tex);
}
/* _NEW_LIGHT | _NEW_BUFFERS */
- key.base.clamp_vertex_color = ctx->Light._ClampVertexColor;
+ key.clamp_vertex_color = ctx->Light._ClampVertexColor;
/* _NEW_POINT */
if (brw->gen < 6 && ctx->Point.PointSprite) {
memset(&key, 0, sizeof(key));
brw_vec4_setup_prog_key_for_precompile(ctx, &key.base, bvp->id, &vp->Base);
+ key.clamp_vertex_color = ctx->API == API_OPENGL_COMPAT;
success = do_vs_prog(brw, shader_prog, bvp, &key);