anv/gen7: Set 3DSTATE_SF depth buffer format correctly

We need to pull this from the render pass information at state flush
time.
This commit is contained in:
Kristian Høgsberg Kristensen 2016-02-14 22:52:37 -08:00
parent 18dd59538b
commit ea694637ac
2 changed files with 9 additions and 3 deletions

View file

@ -442,15 +442,24 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
gen7_cmd_buffer_emit_scissor(cmd_buffer);
if (cmd_buffer->state.dirty & (ANV_CMD_DIRTY_PIPELINE |
ANV_CMD_DIRTY_RENDER_TARGETS |
ANV_CMD_DIRTY_DYNAMIC_LINE_WIDTH |
ANV_CMD_DIRTY_DYNAMIC_DEPTH_BIAS)) {
bool enable_bias = cmd_buffer->state.dynamic.depth_bias.bias != 0.0f ||
cmd_buffer->state.dynamic.depth_bias.slope != 0.0f;
const struct anv_image_view *iview =
anv_cmd_buffer_get_depth_stencil_view(cmd_buffer);
const struct anv_image *image = iview ? iview->image : NULL;
const uint32_t depth_format = image ?
isl_surf_get_depth_format(&cmd_buffer->device->isl_dev,
&image->depth_surface.isl) : D16_UNORM;
uint32_t sf_dw[GEN7_3DSTATE_SF_length];
struct GEN7_3DSTATE_SF sf = {
GEN7_3DSTATE_SF_header,
.DepthBufferSurfaceFormat = depth_format,
.LineWidth = cmd_buffer->state.dynamic.line_width,
.GlobalDepthOffsetEnableSolid = enable_bias,
.GlobalDepthOffsetEnableWireframe = enable_bias,

View file

@ -42,9 +42,6 @@ gen7_emit_rs_state(struct anv_pipeline *pipeline,
struct GEN7_3DSTATE_SF sf = {
GEN7_3DSTATE_SF_header,
/* FIXME: Get this from pass info */
.DepthBufferSurfaceFormat = D24_UNORM_X8_UINT,
/* LegacyGlobalDepthBiasEnable */
.StatisticsEnable = true,