mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
vulkan: fix stencil buffer having undefined contents
note: there are still other issues with draws using stencils.
This commit is contained in:
@@ -555,7 +555,6 @@ bool Graphics::setMode(void *context, int width, int height, int pixelwidth, int
|
|||||||
|
|
||||||
void Graphics::initCapabilities()
|
void Graphics::initCapabilities()
|
||||||
{
|
{
|
||||||
// fixme: unsure what the first few features are for.
|
|
||||||
capabilities.features[FEATURE_MULTI_RENDER_TARGET_FORMATS] = true;
|
capabilities.features[FEATURE_MULTI_RENDER_TARGET_FORMATS] = true;
|
||||||
capabilities.features[FEATURE_CLAMP_ZERO] = true;
|
capabilities.features[FEATURE_CLAMP_ZERO] = true;
|
||||||
capabilities.features[FEATURE_CLAMP_ONE] = true;
|
capabilities.features[FEATURE_CLAMP_ONE] = true;
|
||||||
@@ -2189,8 +2188,11 @@ VkRenderPass Graphics::createRenderPass(RenderPassConfiguration &configuration)
|
|||||||
else
|
else
|
||||||
depthStencilAttachment.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
|
depthStencilAttachment.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
|
||||||
depthStencilAttachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
depthStencilAttachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
||||||
depthStencilAttachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
if (configuration.staticData.depthAttachment.discard)
|
||||||
depthStencilAttachment.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
depthStencilAttachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||||
|
else
|
||||||
|
depthStencilAttachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
|
||||||
|
depthStencilAttachment.stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE;
|
||||||
depthStencilAttachment.initialLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
depthStencilAttachment.initialLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||||
depthStencilAttachment.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
depthStencilAttachment.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||||
attachments.push_back(depthStencilAttachment);
|
attachments.push_back(depthStencilAttachment);
|
||||||
|
|||||||
Reference in New Issue
Block a user