anv: Initialize depth_bounds_test_enable when not explicitly set
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 12 Nov 2019 18:42:09 +0000 (10:42 -0800)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Wed, 13 Nov 2019 18:13:27 +0000 (10:13 -0800)
This was causing uninitialized value to end up propagated to the
3DSTATE_DEPTH_BOUNDS packet, leading to asserts on packet
building due to the value being greater than 1.

Fixes: 939ddccb7a5 ("anv: Add support for depth bounds testing.")
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
src/intel/vulkan/genX_pipeline.c

index 078b3f2b462e020180cdd1a3b9250fd65e5e3b2a..5594726e4a29d7d67e27d33a1f94cb4f549056ba 100644 (file)
@@ -999,6 +999,7 @@ emit_ds_state(struct anv_pipeline *pipeline,
       pipeline->stencil_test_enable = false;
       pipeline->writes_depth = false;
       pipeline->depth_test_enable = false;
+      pipeline->depth_bounds_test_enable = false;
       memset(depth_stencil_dw, 0, sizeof(depth_stencil_dw));
       return;
    }
@@ -1017,8 +1018,6 @@ emit_ds_state(struct anv_pipeline *pipeline,
    pipeline->depth_test_enable = info.depthTestEnable;
    pipeline->depth_bounds_test_enable = info.depthBoundsTestEnable;
 
-   /* VkBool32 depthBoundsTestEnable; // optional (depth_bounds_test) */
-
 #if GEN_GEN <= 7
    struct GENX(DEPTH_STENCIL_STATE) depth_stencil = {
 #else