Skip to content

Commit

Permalink
Fixed incorrectly skipped RTs
Browse files Browse the repository at this point in the history
  • Loading branch information
roamic authored and ngoquang2708 committed Nov 30, 2024
1 parent d99ebb2 commit d84660d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ bool PipelineCache::RefreshGraphicsKey() {
// recompiler.
for (auto cb = 0u, remapped_cb = 0u; cb < Liverpool::NumColorBuffers; ++cb) {
auto const& col_buf = regs.color_buffers[cb];
if (skip_cb_binding || !col_buf || !regs.color_target_mask.GetMask(cb)) {
if (skip_cb_binding || !col_buf) {
continue;
}
const auto base_format =
Expand Down Expand Up @@ -404,8 +404,7 @@ bool PipelineCache::RefreshGraphicsKey() {
// Second pass to fill remain CB pipeline key data
for (auto cb = 0u, remapped_cb = 0u; cb < Liverpool::NumColorBuffers; ++cb) {
auto const& col_buf = regs.color_buffers[cb];
if (skip_cb_binding || !col_buf || !regs.color_target_mask.GetMask(cb) ||
(key.mrt_mask & (1u << cb)) == 0) {
if (skip_cb_binding || !col_buf || (key.mrt_mask & (1u << cb)) == 0) {
key.color_formats[cb] = vk::Format::eUndefined;
key.mrt_swizzles[cb] = Liverpool::ColorBuffer::SwapMode::Standard;
continue;
Expand Down
7 changes: 0 additions & 7 deletions src/video_core/renderer_vulkan/vk_rasterizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ RenderState Rasterizer::PrepareRenderState(u32 mrt_mask) {
continue;
}

// If the color buffer is still bound but rendering to it is disabled by the target
// mask, we need to prevent the render area from being affected by unbound render target
// extents.
if (!regs.color_target_mask.GetMask(col_buf_id)) {
continue;
}

// Skip stale color buffers if shader doesn't output to them. Otherwise it will perform
// an unnecessary transition and may result in state conflict if the resource is already
// bound for reading.
Expand Down

0 comments on commit d84660d

Please sign in to comment.