anv/pipeline: Respect pRasterizationState->depthBiasEnable
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 4 Mar 2016 08:01:25 +0000 (00:01 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 4 Mar 2016 20:03:00 +0000 (12:03 -0800)
src/intel/vulkan/gen7_cmd_buffer.c
src/intel/vulkan/gen7_pipeline.c
src/intel/vulkan/gen8_cmd_buffer.c
src/intel/vulkan/gen8_pipeline.c

index 3ed93137f6a66ce41385e035392ef4658b263ef9..1713cc17836253ab32a546a23dd20823a3b99be5 100644 (file)
@@ -525,9 +525,6 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
                                   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;
@@ -543,9 +540,6 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
          GENX(3DSTATE_SF_header),
          .DepthBufferSurfaceFormat = depth_format,
          .LineWidth = cmd_buffer->state.dynamic.line_width,
-         .GlobalDepthOffsetEnableSolid = enable_bias,
-         .GlobalDepthOffsetEnableWireframe = enable_bias,
-         .GlobalDepthOffsetEnablePoint = enable_bias,
          .GlobalDepthOffsetConstant = cmd_buffer->state.dynamic.depth_bias.bias,
          .GlobalDepthOffsetScale = cmd_buffer->state.dynamic.depth_bias.slope,
          .GlobalDepthOffsetClamp = cmd_buffer->state.dynamic.depth_bias.clamp
index 7d283f18f4099bc96d725fd6dd7cb99d6b94e126..c114bfef3ac77c335408ff4bb09488fa0f929383 100644 (file)
@@ -67,6 +67,9 @@ gen7_emit_rs_state(struct anv_pipeline *pipeline,
       /* uint32_t                                     VertexSubPixelPrecisionSelect; */
       .UsePointWidthState                       = !pipeline->writes_point_size,
       .PointWidth                               = 1.0,
+      .GlobalDepthOffsetConstant                = info->depthBiasEnable,
+      .GlobalDepthOffsetScale                   = info->depthBiasEnable,
+      .GlobalDepthOffsetClamp                   = info->depthBiasEnable,
    };
 
    GENX(3DSTATE_SF_pack)(NULL, &pipeline->gen7.sf, &sf);
index 9d4926f86cde15fd1ca9cec46201cd676363b87e..d506cf48b0de4a607e0889d633c23e38e3945683 100644 (file)
@@ -331,15 +331,9 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
 
    if (cmd_buffer->state.dirty & (ANV_CMD_DIRTY_PIPELINE |
                                   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;
-
       uint32_t raster_dw[GENX(3DSTATE_RASTER_length)];
       struct GENX(3DSTATE_RASTER) raster = {
          GENX(3DSTATE_RASTER_header),
-         .GlobalDepthOffsetEnableSolid = enable_bias,
-         .GlobalDepthOffsetEnableWireframe = enable_bias,
-         .GlobalDepthOffsetEnablePoint = enable_bias,
          .GlobalDepthOffsetConstant = cmd_buffer->state.dynamic.depth_bias.bias,
          .GlobalDepthOffsetScale = cmd_buffer->state.dynamic.depth_bias.slope,
          .GlobalDepthOffsetClamp = cmd_buffer->state.dynamic.depth_bias.clamp
index 494a64949b636d2579d85116311c8b71b4122cfd..a464006566bdfa71e3a9959786aa97e3113199b6 100644 (file)
@@ -90,6 +90,9 @@ emit_rs_state(struct anv_pipeline *pipeline,
       .ViewportZFarClipTestEnable = true,
       .ViewportZNearClipTestEnable = true,
 #endif
+      .GlobalDepthOffsetEnableSolid = info->depthBiasEnable,
+      .GlobalDepthOffsetEnableWireframe = info->depthBiasEnable,
+      .GlobalDepthOffsetEnablePoint = info->depthBiasEnable,
    };
 
    GENX(3DSTATE_RASTER_pack)(NULL, pipeline->gen8.raster, &raster);