BEGIN_BATCH(5);
OUT_BATCH(_3DSTATE_BLEND_CONSTANT_COLOR << 16 | (5-2));
- OUT_BATCH_F(ctx->Color.BlendColor[0]);
- OUT_BATCH_F(ctx->Color.BlendColor[1]);
- OUT_BATCH_F(ctx->Color.BlendColor[2]);
- OUT_BATCH_F(ctx->Color.BlendColor[3]);
+ OUT_BATCH_F(ctx->Color.BlendColorUnclamped[0]);
+ OUT_BATCH_F(ctx->Color.BlendColorUnclamped[1]);
+ OUT_BATCH_F(ctx->Color.BlendColorUnclamped[2]);
+ OUT_BATCH_F(ctx->Color.BlendColorUnclamped[3]);
CACHED_BATCH();
}
ctx->Polygon.BackMode != GL_FILL);
key.two_side_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide);
+ /* _NEW_LIGHT | _NEW_BUFFERS */
+ key.clamp_vertex_color = ctx->Light._ClampVertexColor;
+
/* _NEW_POINT */
if (ctx->Point.PointSprite) {
for (i = 0; i < 8; i++) {
*/
const struct brw_tracked_state brw_vs_prog = {
.dirty = {
- .mesa = _NEW_TRANSFORM | _NEW_POLYGON | _NEW_POINT | _NEW_LIGHT,
+ .mesa = (_NEW_TRANSFORM | _NEW_POLYGON | _NEW_POINT | _NEW_LIGHT |
+ _NEW_BUFFERS),
.brw = BRW_NEW_VERTEX_PROGRAM,
.cache = 0
},
GLuint copy_edgeflag:1;
GLuint point_coord_replace:8;
GLuint two_side_color: 1;
+ GLuint clamp_vertex_color:1;
};
* instructions. Instead, we directly modify the header
* of the last (already stored) instruction.
*/
- if (inst->DstReg.File == PROGRAM_OUTPUT) {
+ if (inst->DstReg.File == PROGRAM_OUTPUT &&
+ c->key.clamp_vertex_color) {
if ((inst->DstReg.Index == VERT_RESULT_COL0)
|| (inst->DstReg.Index == VERT_RESULT_COL1)
|| (inst->DstReg.Index == VERT_RESULT_BFC0)
/* _NEW_HINT */
key->linear_color = (ctx->Hint.PerspectiveCorrection == GL_FASTEST);
+ /* _NEW_FRAG_CLAMP | _NEW_BUFFERS */
+ key->clamp_fragment_color = ctx->Color._ClampFragmentColor;
+
/* _NEW_TEXTURE */
for (i = 0; i < BRW_MAX_TEX_UNIT; i++) {
const struct gl_texture_unit *unit = &ctx->Texture.Unit[i];
_NEW_POLYGON |
_NEW_LINE |
_NEW_LIGHT |
+ _NEW_FRAG_CLAMP |
_NEW_BUFFERS |
_NEW_TEXTURE),
.brw = (BRW_NEW_FRAGMENT_PROGRAM |
GLuint nr_color_regions:5;
GLuint render_to_fbo:1;
GLuint alpha_test:1;
+ GLuint clamp_fragment_color:1;
GLbitfield proj_attrib_mask; /**< one bit per fragment program attribute */
GLuint shadowtex_mask:16;
*/
brw_push_insn_state(p);
+ if (c->key.clamp_fragment_color)
+ brw_set_saturate(p, 1);
+
for (channel = 0; channel < 4; channel++) {
if (intel->gen >= 6) {
/* gen6 SIMD16 single source DP write looks like:
}
}
}
+
+ brw_set_saturate(p, 0);
+
/* skip over the regs populated above:
*/
if (c->dispatch_width == 16)
if (ctx->Color.AlphaEnabled)
key->alpha_ref = ctx->Color.AlphaRef;
- key->blend_constant_color[0] = ctx->Color.BlendColor[0];
- key->blend_constant_color[1] = ctx->Color.BlendColor[1];
- key->blend_constant_color[2] = ctx->Color.BlendColor[2];
- key->blend_constant_color[3] = ctx->Color.BlendColor[3];
+ key->blend_constant_color[0] = ctx->Color.BlendColorUnclamped[0];
+ key->blend_constant_color[1] = ctx->Color.BlendColorUnclamped[1];
+ key->blend_constant_color[2] = ctx->Color.BlendColorUnclamped[2];
+ key->blend_constant_color[3] = ctx->Color.BlendColorUnclamped[3];
}
/**
/** i965-only extensions */
static const struct dri_extension brw_extensions[] = {
+ { "GL_ARB_color_buffer_float", NULL },
{ "GL_ARB_depth_clamp", NULL },
{ "GL_ARB_depth_texture", NULL },
{ "GL_ARB_fragment_coord_conventions", NULL },