From: Lionel Landwerlin Date: Wed, 9 Mar 2022 14:37:49 +0000 (+0200) Subject: anv: allow baking of 3DSTATE_DEPTH_BOUNDS in pipeline batch X-Git-Tag: upstream/22.3.5~11288 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1cd7d6ce37951f51b79056124a22701e75d14d3a;p=platform%2Fupstream%2Fmesa.git anv: allow baking of 3DSTATE_DEPTH_BOUNDS in pipeline batch If it's not dynamic. Signed-off-by: Lionel Landwerlin Reviewed-by: Tapani Pälli Part-of: --- diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 3915872..52b6430 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -2398,7 +2398,9 @@ copy_non_dynamic_state(struct anv_graphics_pipeline *pipeline, ANV_CMD_DIRTY_DYNAMIC_SHADING_RATE | ANV_CMD_DIRTY_DYNAMIC_RASTERIZER_DISCARD_ENABLE | ANV_CMD_DIRTY_DYNAMIC_LOGIC_OP | - ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_TOPOLOGY); + ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_TOPOLOGY | + ANV_CMD_DIRTY_DYNAMIC_DEPTH_BOUNDS | + ANV_CMD_DIRTY_DYNAMIC_DEPTH_BOUNDS_TEST_ENABLE); } /** diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index c9b8aea..a78bc30 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -1295,6 +1295,19 @@ emit_ds_state(struct anv_graphics_pipeline *pipeline, #else GENX(3DSTATE_WM_DEPTH_STENCIL_pack)(NULL, depth_stencil_dw, &depth_stencil); #endif + +#if GFX_VER >= 12 + if ((dynamic_states & (ANV_CMD_DIRTY_DYNAMIC_DEPTH_BOUNDS | + ANV_CMD_DIRTY_DYNAMIC_DEPTH_BOUNDS_TEST_ENABLE)) == 0) { + anv_batch_emit(&pipeline->base.batch, GENX(3DSTATE_DEPTH_BOUNDS), db) { + db.DepthBoundsTestValueModifyDisable = false; + db.DepthBoundsTestEnableModifyDisable = false; + db.DepthBoundsTestEnable = pCreateInfo->depthBoundsTestEnable; + db.DepthBoundsTestMinValue = pCreateInfo->minDepthBounds; + db.DepthBoundsTestMaxValue = pCreateInfo->maxDepthBounds; + } + } +#endif } static bool