Proper MSAA surfaces support (#1560)

This commit is contained in:
psucien 2024-11-21 11:08:52 +01:00 committed by GitHub
parent c83ac654ce
commit c55d7fbb6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 116 additions and 6 deletions

View file

@ -357,6 +357,8 @@ bool PipelineCache::RefreshGraphicsKey() {
}
}
u32 num_samples = 1u;
// 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];
@ -373,8 +375,16 @@ bool PipelineCache::RefreshGraphicsKey() {
key.write_masks[remapped_cb] = vk::ColorComponentFlags{regs.color_target_mask.GetMask(cb)};
key.cb_shader_mask.SetMask(remapped_cb, regs.color_shader_mask.GetMask(cb));
num_samples = std::max(num_samples, 1u << col_buf.attrib.num_samples_log2);
++remapped_cb;
}
// It seems that the number of samples > 1 set in the AA config doesn't mean we're always
// rendering with MSAA, so we need to derive MS ratio from the CB settings.
num_samples = std::max(num_samples, regs.depth_buffer.NumSamples());
key.num_samples = num_samples;
return true;
}