From 8b7564fb545abecd695f0e7d3b3172040b8733f0 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Mon, 5 Feb 2018 15:37:02 -0500 Subject: [PATCH] Vulkan: Remove stencil masks from dynamic state In NXT the stencil read and write masks are part of the pipeline state so they should be set by the pipeline and not dynamically. --- src/backend/vulkan/CommandBufferVk.cpp | 2 -- src/backend/vulkan/RenderPipelineVk.cpp | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/backend/vulkan/CommandBufferVk.cpp b/src/backend/vulkan/CommandBufferVk.cpp index 865d389d86..4223b41326 100644 --- a/src/backend/vulkan/CommandBufferVk.cpp +++ b/src/backend/vulkan/CommandBufferVk.cpp @@ -165,8 +165,6 @@ namespace backend { namespace vulkan { device->fn.CmdSetLineWidth(commands, 1.0f); device->fn.CmdSetDepthBounds(commands, 0.0f, 1.0f); - device->fn.CmdSetStencilCompareMask(commands, VK_STENCIL_FRONT_AND_BACK, 0); - device->fn.CmdSetStencilWriteMask(commands, VK_STENCIL_FRONT_AND_BACK, 0); device->fn.CmdSetStencilReference(commands, VK_STENCIL_FRONT_AND_BACK, 0); // The viewport and scissor default to cover all of the attachments diff --git a/src/backend/vulkan/RenderPipelineVk.cpp b/src/backend/vulkan/RenderPipelineVk.cpp index adea5363fc..8227993acc 100644 --- a/src/backend/vulkan/RenderPipelineVk.cpp +++ b/src/backend/vulkan/RenderPipelineVk.cpp @@ -180,7 +180,7 @@ namespace backend { namespace vulkan { colorBlend.blendConstants[2] = 0.0f; colorBlend.blendConstants[3] = 0.0f; - // Tag all state as dynamic. + // Tag all state as dynamic but stencil masks. VkDynamicState dynamicStates[] = { VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR, @@ -188,8 +188,6 @@ namespace backend { namespace vulkan { VK_DYNAMIC_STATE_DEPTH_BIAS, VK_DYNAMIC_STATE_BLEND_CONSTANTS, VK_DYNAMIC_STATE_DEPTH_BOUNDS, - VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK, - VK_DYNAMIC_STATE_STENCIL_WRITE_MASK, VK_DYNAMIC_STATE_STENCIL_REFERENCE, }; VkPipelineDynamicStateCreateInfo dynamic;