mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
dzn: Disable depth/stencil for partial binding from dynamic rendering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27224>
This commit is contained in:
parent
f4c6d9d9a9
commit
9b495ee8a9
1 changed files with 17 additions and 11 deletions
|
|
@ -1511,6 +1511,7 @@ dzn_graphics_pipeline_translate_zsa(struct dzn_device *device,
|
|||
in->pRasterizationState;
|
||||
const VkPipelineDepthStencilStateCreateInfo *in_zsa =
|
||||
in_rast->rasterizerDiscardEnable ? NULL : in->pDepthStencilState;
|
||||
const VkPipelineRenderingCreateInfo *ri = vk_find_struct_const(in, PIPELINE_RENDERING_CREATE_INFO);
|
||||
|
||||
if (!in_zsa ||
|
||||
in_rast->cullMode == VK_CULL_MODE_FRONT_AND_BACK) {
|
||||
|
|
@ -1530,21 +1531,26 @@ dzn_graphics_pipeline_translate_zsa(struct dzn_device *device,
|
|||
D3D12_DEPTH_STENCIL_DESC2 desc;
|
||||
memset(&desc, 0, sizeof(desc));
|
||||
|
||||
desc.DepthEnable =
|
||||
in_zsa->depthTestEnable || in_zsa->depthBoundsTestEnable;
|
||||
desc.DepthWriteMask =
|
||||
in_zsa->depthWriteEnable ?
|
||||
D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO;
|
||||
desc.DepthFunc =
|
||||
in_zsa->depthTestEnable ?
|
||||
dzn_translate_compare_op(in_zsa->depthCompareOp) :
|
||||
D3D12_COMPARISON_FUNC_ALWAYS;
|
||||
bool has_no_depth = ri && ri->depthAttachmentFormat == VK_FORMAT_UNDEFINED;
|
||||
bool has_no_stencil = ri && ri->stencilAttachmentFormat == VK_FORMAT_UNDEFINED;
|
||||
|
||||
desc.DepthEnable = !has_no_depth &&
|
||||
(in_zsa->depthTestEnable || in_zsa->depthBoundsTestEnable);
|
||||
if (desc.DepthEnable) {
|
||||
desc.DepthWriteMask =
|
||||
in_zsa->depthWriteEnable ?
|
||||
D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO;
|
||||
desc.DepthFunc =
|
||||
in_zsa->depthTestEnable ?
|
||||
dzn_translate_compare_op(in_zsa->depthCompareOp) :
|
||||
D3D12_COMPARISON_FUNC_ALWAYS;
|
||||
}
|
||||
pipeline->zsa.depth_bounds.enable = in_zsa->depthBoundsTestEnable;
|
||||
pipeline->zsa.depth_bounds.min = in_zsa->minDepthBounds;
|
||||
pipeline->zsa.depth_bounds.max = in_zsa->maxDepthBounds;
|
||||
desc.DepthBoundsTestEnable = in_zsa->depthBoundsTestEnable;
|
||||
desc.StencilEnable = in_zsa->stencilTestEnable;
|
||||
if (in_zsa->stencilTestEnable) {
|
||||
desc.StencilEnable = in_zsa->stencilTestEnable && !has_no_stencil;
|
||||
if (desc.StencilEnable) {
|
||||
desc.FrontFace.StencilFailOp = translate_stencil_op(in_zsa->front.failOp);
|
||||
desc.FrontFace.StencilDepthFailOp = translate_stencil_op(in_zsa->front.depthFailOp);
|
||||
desc.FrontFace.StencilPassOp = translate_stencil_op(in_zsa->front.passOp);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue