diff options
author | Bas Nieuwenhuizen <[email protected]> | 2019-01-26 02:28:08 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2019-02-20 23:24:31 +0000 |
commit | 9f7e0523ce64a9d8e81ab07639cc27871e3b9d38 (patch) | |
tree | 714b9f640a60a03869c542c2a8f895e98c39296d /src/amd/vulkan/radv_pipeline.c | |
parent | 03783253b1814a0afa25364f80f13f3e4a1e9bc2 (diff) |
radv: Implement VK_EXT_depth_clip_enable.
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_pipeline.c')
-rw-r--r-- | src/amd/vulkan/radv_pipeline.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 2d9c3624045..810bbd98752 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -2727,11 +2727,18 @@ radv_pipeline_generate_raster_state(struct radeon_cmdbuf *ctx_cs, const VkConservativeRasterizationModeEXT mode = radv_get_conservative_raster_mode(vkraster); uint32_t pa_sc_conservative_rast = S_028C4C_NULL_SQUAD_AA_MASK_ENABLE(1); + bool depth_clip_disable = vkraster->depthClampEnable; + + const VkPipelineRasterizationDepthClipStateCreateInfoEXT *depth_clip_state = + vk_find_struct_const(vkraster->pNext, PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT); + if (depth_clip_state) { + depth_clip_disable = !depth_clip_state->depthClipEnable; + } radeon_set_context_reg(ctx_cs, R_028810_PA_CL_CLIP_CNTL, S_028810_DX_CLIP_SPACE_DEF(1) | // vulkan uses DX conventions. - S_028810_ZCLIP_NEAR_DISABLE(vkraster->depthClampEnable ? 1 : 0) | - S_028810_ZCLIP_FAR_DISABLE(vkraster->depthClampEnable ? 1 : 0) | + S_028810_ZCLIP_NEAR_DISABLE(depth_clip_disable ? 1 : 0) | + S_028810_ZCLIP_FAR_DISABLE(depth_clip_disable ? 1 : 0) | S_028810_DX_RASTERIZATION_KILL(vkraster->rasterizerDiscardEnable ? 1 : 0) | S_028810_DX_LINEAR_ATTR_CLIP_ENA(1)); |