upload_sbe_state(struct brw_context *brw)
{
struct gl_context *ctx = &brw->ctx;
- /* CACHE_NEW_WM_PROG */
+ /* BRW_NEW_FS_PROG_DATA */
uint32_t num_outputs = brw->wm.prog_data->num_varying_inputs;
uint32_t dw1;
uint32_t point_sprite_enables;
}
dw1 |= point_sprite_origin;
- /* BRW_NEW_VUE_MAP_GEOM_OUT | _NEW_POINT | _NEW_LIGHT | _NEW_PROGRAM |
- * CACHE_NEW_WM_PROG
+ /* BRW_NEW_VUE_MAP_GEOM_OUT | BRW_NEW_FRAGMENT_PROGRAM
+ * _NEW_POINT | _NEW_LIGHT | _NEW_PROGRAM | BRW_NEW_FS_PROG_DATA
*/
uint32_t urb_entry_read_length;
calculate_attr_overrides(brw, attr_overrides, &point_sprite_enables,
const struct brw_tracked_state gen7_sbe_state = {
.dirty = {
- .mesa = (_NEW_BUFFERS |
- _NEW_LIGHT |
- _NEW_POINT |
- _NEW_PROGRAM),
- .brw = (BRW_NEW_CONTEXT |
- BRW_NEW_FRAGMENT_PROGRAM |
- BRW_NEW_VUE_MAP_GEOM_OUT),
- .cache = CACHE_NEW_WM_PROG
+ .mesa = _NEW_BUFFERS |
+ _NEW_LIGHT |
+ _NEW_POINT |
+ _NEW_PROGRAM,
+ .brw = BRW_NEW_CONTEXT |
+ BRW_NEW_FRAGMENT_PROGRAM |
+ BRW_NEW_FS_PROG_DATA |
+ BRW_NEW_GEOMETRY_PROGRAM |
+ BRW_NEW_PRIMITIVE |
+ BRW_NEW_VUE_MAP_GEOM_OUT,
},
.emit = upload_sbe_state,
};
bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
bool multisampled_fbo = ctx->DrawBuffer->Visual.samples > 1;
- dw1 = GEN6_SF_STATISTICS_ENABLE |
- GEN6_SF_VIEWPORT_TRANSFORM_ENABLE;
+ dw1 = GEN6_SF_STATISTICS_ENABLE;
+
+ if (brw->sf.viewport_transform_enable)
+ dw1 |= GEN6_SF_VIEWPORT_TRANSFORM_ENABLE;
/* _NEW_BUFFERS */
dw1 |= (brw_depthbuffer_format(brw) << GEN7_SF_DEPTH_BUFFER_SURFACE_FORMAT_SHIFT);
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
switch (ctx->Polygon.BackMode) {
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
dw2 = 0;
dw2 |= GEN6_SF_CULL_BOTH;
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
} else {
dw2 |= GEN6_SF_CULL_NONE;
/* _NEW_LINE */
{
- uint32_t line_width_u3_7 = U_FIXED(CLAMP(ctx->Line.Width, 0.0, 7.99), 7);
+ /* OpenGL dictates that line width should be rounded to the nearest
+ * integer
+ */
+ float line_width =
+ roundf(CLAMP(ctx->Line.Width, 0.0, ctx->Const.MaxLineWidth));
+ uint32_t line_width_u3_7 = U_FIXED(line_width, 7);
/* TODO: line width of 0 is not allowed when MSAA enabled */
if (line_width_u3_7 == 0)
line_width_u3_7 = 1;
OUT_BATCH(dw3);
OUT_BATCH_F(ctx->Polygon.OffsetUnits * 2); /* constant. copied from gen4 */
OUT_BATCH_F(ctx->Polygon.OffsetFactor); /* scale */
- OUT_BATCH_F(0.0); /* XXX: global depth offset clamp */
+ OUT_BATCH_F(ctx->Polygon.OffsetClamp); /* global depth offset clamp */
ADVANCE_BATCH();
}
const struct brw_tracked_state gen7_sf_state = {
.dirty = {
- .mesa = (_NEW_LIGHT |
- _NEW_PROGRAM |
- _NEW_POLYGON |
- _NEW_LINE |
- _NEW_SCISSOR |
- _NEW_BUFFERS |
- _NEW_POINT |
- _NEW_MULTISAMPLE),
+ .mesa = _NEW_BUFFERS |
+ _NEW_LIGHT |
+ _NEW_LINE |
+ _NEW_MULTISAMPLE |
+ _NEW_POINT |
+ _NEW_POLYGON |
+ _NEW_PROGRAM |
+ _NEW_SCISSOR,
.brw = BRW_NEW_CONTEXT,
- .cache = CACHE_NEW_VS_PROG
},
.emit = upload_sf_state,
};