Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/video_core/renderer_vulkan/vk_rasterizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,9 +889,14 @@ RenderState Rasterizer::BeginRendering(const GraphicsPipeline* pipeline) {
ASSERT(desc.view_info.range.extent.levels == 1 && !image.binding.needs_rebind);

const bool has_stencil = image.info.props.has_stencil;
// Stencil writes can be enabled while depth writes are off.
const bool stencil_write =
has_stencil && regs.depth_control.stencil_enable && !desc.view_info.is_storage;
const auto new_layout = desc.view_info.is_storage
? has_stencil ? vk::ImageLayout::eDepthStencilAttachmentOptimal
: vk::ImageLayout::eDepthAttachmentOptimal
: stencil_write
? vk::ImageLayout::eDepthReadOnlyStencilAttachmentOptimal
: has_stencil ? vk::ImageLayout::eDepthStencilReadOnlyOptimal
: vk::ImageLayout::eDepthReadOnlyOptimal;
image.Transit(new_layout,
Expand Down
Loading