renderer_vulkan: Derive framebuffer sample-count from attachments

Derive the framebuffer sample-count from the input color and depth operands. Similar to how `res_scale` is determined.
This commit is contained in:
Wunkolo 2026-04-19 11:03:32 -07:00
parent 177edd228e
commit 02eb015d36
3 changed files with 2 additions and 4 deletions

View file

@ -27,8 +27,7 @@ struct FramebufferParams {
u32 color_level;
u32 depth_level;
bool shadow_rendering;
u8 sample_count;
INSERT_PADDING_BYTES(2);
INSERT_PADDING_BYTES(3);
bool operator==(const FramebufferParams& params) const noexcept {
return std::memcmp(this, &params, sizeof(FramebufferParams)) == 0;

View file

@ -780,7 +780,6 @@ FramebufferHelper<T> RasterizerCache<T>::GetFramebufferSurfaces(bool using_color
.color_level = color_level,
.depth_level = depth_level,
.shadow_rendering = regs.framebuffer.IsShadowRendering(),
.sample_count = sample_count,
};
auto [it, new_framebuffer] = framebuffers.try_emplace(fb_params);

View file

@ -1603,7 +1603,7 @@ Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferPa
Surface* color, Surface* depth)
: VideoCore::FramebufferParams{params}, instance{runtime.GetInstance()},
res_scale{color ? color->res_scale : (depth ? depth->res_scale : 1u)},
sample_count{params.sample_count} {
sample_count{color ? color->sample_count : (depth ? depth->sample_count : 1u)} {
auto& renderpass_cache = runtime.GetRenderpassCache();
if (shadow_rendering && !color) {
return;