diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2023-01-28 03:29:03 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2023-01-28 06:15:29 +0100 |
commit | c2fb7b64ce8abe720cc6a4863559944c8cc7e7f7 (patch) | |
tree | 5ac2cb86dace493ebb993678acb34797f99392fb /src/video_core/texture_cache/samples_helper.h | |
parent | Merge pull request #9685 from liamwhite/minmax (diff) | |
download | yuzu-c2fb7b64ce8abe720cc6a4863559944c8cc7e7f7.tar yuzu-c2fb7b64ce8abe720cc6a4863559944c8cc7e7f7.tar.gz yuzu-c2fb7b64ce8abe720cc6a4863559944c8cc7e7f7.tar.bz2 yuzu-c2fb7b64ce8abe720cc6a4863559944c8cc7e7f7.tar.lz yuzu-c2fb7b64ce8abe720cc6a4863559944c8cc7e7f7.tar.xz yuzu-c2fb7b64ce8abe720cc6a4863559944c8cc7e7f7.tar.zst yuzu-c2fb7b64ce8abe720cc6a4863559944c8cc7e7f7.zip |
Diffstat (limited to 'src/video_core/texture_cache/samples_helper.h')
-rw-r--r-- | src/video_core/texture_cache/samples_helper.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/samples_helper.h b/src/video_core/texture_cache/samples_helper.h index d552bccf0..203ac1b11 100644 --- a/src/video_core/texture_cache/samples_helper.h +++ b/src/video_core/texture_cache/samples_helper.h @@ -51,4 +51,48 @@ namespace VideoCommon { return 1; } +[[nodiscard]] inline int NumSamplesX(Tegra::Texture::MsaaMode msaa_mode) { + using Tegra::Texture::MsaaMode; + switch (msaa_mode) { + case MsaaMode::Msaa1x1: + return 1; + case MsaaMode::Msaa2x1: + case MsaaMode::Msaa2x1_D3D: + case MsaaMode::Msaa2x2: + case MsaaMode::Msaa2x2_VC4: + case MsaaMode::Msaa2x2_VC12: + return 2; + case MsaaMode::Msaa4x2: + case MsaaMode::Msaa4x2_D3D: + case MsaaMode::Msaa4x2_VC8: + case MsaaMode::Msaa4x2_VC24: + case MsaaMode::Msaa4x4: + return 4; + } + ASSERT_MSG(false, "Invalid MSAA mode={}", static_cast<int>(msaa_mode)); + return 1; +} + +[[nodiscard]] inline int NumSamplesY(Tegra::Texture::MsaaMode msaa_mode) { + using Tegra::Texture::MsaaMode; + switch (msaa_mode) { + case MsaaMode::Msaa1x1: + case MsaaMode::Msaa2x1: + case MsaaMode::Msaa2x1_D3D: + return 1; + case MsaaMode::Msaa2x2: + case MsaaMode::Msaa2x2_VC4: + case MsaaMode::Msaa2x2_VC12: + case MsaaMode::Msaa4x2: + case MsaaMode::Msaa4x2_D3D: + case MsaaMode::Msaa4x2_VC8: + case MsaaMode::Msaa4x2_VC24: + return 2; + case MsaaMode::Msaa4x4: + return 4; + } + ASSERT_MSG(false, "Invalid MSAA mode={}", static_cast<int>(msaa_mode)); + return 1; +} + } // namespace VideoCommon |