Skip to content

Commit

Permalink
renderer/vulkan: Fix MSAA2x (#3223)
Browse files Browse the repository at this point in the history
  • Loading branch information
Macdu committed Feb 23, 2024
1 parent 1b0e65e commit 17c1c3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vita3k/renderer/src/vulkan/surface_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,9 @@ SurfaceRetrieveResult VKSurfaceCache::retrieve_depth_stencil_for_framebuffer(Sce

// check if MSAA is used, the depth buffer is never downscaled
if (target->multisample_mode != SCE_GXM_MULTISAMPLE_NONE)
memory_width *= 2;
if (target->multisample_mode == SCE_GXM_MULTISAMPLE_4X)
memory_height *= 2;
if (target->multisample_mode == SCE_GXM_MULTISAMPLE_4X)
memory_width *= 2;

const bool is_stencil_only = depth_stencil->depth_data.address() == 0;
DepthStencilSurfaceCacheInfo *cached_info = nullptr;
Expand Down Expand Up @@ -776,9 +776,9 @@ std::optional<TextureLookupResult> VKSurfaceCache::retrieve_depth_stencil_as_tex

// take MSAA into account
if (cached_info.multisample_mode != SCE_GXM_MULTISAMPLE_NONE)
width /= 2;
if (cached_info.multisample_mode == SCE_GXM_MULTISAMPLE_4X)
height /= 2;
if (cached_info.multisample_mode == SCE_GXM_MULTISAMPLE_4X)
width /= 2;

const bool is_stencil = can_be_stencil;

Expand Down

0 comments on commit 17c1c3b

Please sign in to comment.