renderer: don't let unbound color attachment affect pass's rendering area

This commit is contained in:
psucien 2024-07-06 20:13:12 +02:00
parent cfbe8b9e6d
commit 1d608427ed
2 changed files with 7 additions and 1 deletions

View File

@ -183,7 +183,7 @@ void PipelineCache::RefreshGraphicsKey() {
int remapped_cb{}; int remapped_cb{};
for (auto cb = 0u; cb < Liverpool::NumColorBuffers; ++cb) { for (auto cb = 0u; cb < Liverpool::NumColorBuffers; ++cb) {
auto const& col_buf = regs.color_buffers[cb]; auto const& col_buf = regs.color_buffers[cb];
if (!col_buf || skip_cb_binding) { if (skip_cb_binding || !col_buf || !regs.color_target_mask.GetMask(cb)) {
continue; continue;
} }
const auto base_format = const auto base_format =

View File

@ -106,6 +106,12 @@ void Rasterizer::BeginRendering() {
continue; 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;
}
const auto& hint = liverpool->last_cb_extent[col_buf_id]; const auto& hint = liverpool->last_cb_extent[col_buf_id];
const auto& image_view = texture_cache.RenderTarget(col_buf, hint); const auto& image_view = texture_cache.RenderTarget(col_buf, hint);
const auto& image = texture_cache.GetImage(image_view.image_id); const auto& image = texture_cache.GetImage(image_view.image_id);