|
|
@@ -245,20 +245,13 @@ namespace Ryujinx.Graphics.Vulkan
|
|
|
|
|
|
public unsafe void ClearRenderTargetDepthStencil(int layer, int layerCount, float depthValue, bool depthMask, int stencilValue, int stencilMask)
|
|
|
{
|
|
|
- // TODO: Use stencilMask (fully)
|
|
|
+ // TODO: Use stencilMask (fully).
|
|
|
|
|
|
if (FramebufferParams == null || !FramebufferParams.HasDepthStencil)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (_renderPass == null)
|
|
|
- {
|
|
|
- CreateRenderPass();
|
|
|
- }
|
|
|
-
|
|
|
- BeginRenderPass();
|
|
|
-
|
|
|
var clearValue = new ClearValue(null, new ClearDepthStencilValue(depthValue, (uint)stencilValue));
|
|
|
var flags = depthMask ? ImageAspectFlags.DepthBit : 0;
|
|
|
|
|
|
@@ -267,6 +260,20 @@ namespace Ryujinx.Graphics.Vulkan
|
|
|
flags |= ImageAspectFlags.StencilBit;
|
|
|
}
|
|
|
|
|
|
+ flags &= FramebufferParams.GetDepthStencilAspectFlags();
|
|
|
+
|
|
|
+ if (flags == ImageAspectFlags.None)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_renderPass == null)
|
|
|
+ {
|
|
|
+ CreateRenderPass();
|
|
|
+ }
|
|
|
+
|
|
|
+ BeginRenderPass();
|
|
|
+
|
|
|
var attachment = new ClearAttachment(flags, 0, clearValue);
|
|
|
var clearRect = FramebufferParams.GetClearRect(ClearScissor, layer, layerCount);
|
|
|
|
|
|
@@ -935,7 +942,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|
|
|
|
|
SignalStateChange();
|
|
|
|
|
|
- if (_program.IsCompute)
|
|
|
+ if (internalProgram.IsCompute)
|
|
|
{
|
|
|
EndRenderPass();
|
|
|
}
|