diff options
| author | Pokechu22 <Pokechu022@gmail.com> | 2021-02-10 18:11:31 -0800 |
|---|---|---|
| committer | Pokechu22 <Pokechu022@gmail.com> | 2021-03-06 19:27:19 -0800 |
| commit | 70f9fc4e7526fc9cfc008a43cd33229f62be99b6 (patch) | |
| tree | 48fae2cac1ed47ec5912dca4bf00716509192225 /Source/Core/VideoCommon/PixelShaderManager.cpp | |
| parent | db8ced7e4e4724c38f148ee449c346e447dd3942 (diff) | |
Convert BPMemory to BitField and enum class
Additional changes:
- For TevStageCombiner's ColorCombiner and AlphaCombiner, op/comparison and scale/compare_mode have been split as there are different meanings and enums if bias is set to compare. (Shift has also been renamed to scale)
- In TexMode0, min_filter has been split into min_mip and min_filter.
- In TexImage1, image_type is now cache_manually_managed.
- The unused bit in GenMode is now exposed.
- LPSize's lineaspect is now named adjust_for_aspect_ratio.
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderManager.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp index c2aca3e2f6..bae48623c7 100644 --- a/Source/Core/VideoCommon/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/PixelShaderManager.cpp @@ -182,7 +182,7 @@ void PixelShaderManager::SetConstants() // Destination alpha is only enabled if alpha writes are enabled. Force entire uniform to zero // when disabled. u32 dstalpha = bpmem.blendmode.alphaupdate && bpmem.dstalpha.enable && - bpmem.zcontrol.pixel_format == PEControl::RGBA6_Z24 ? + bpmem.zcontrol.pixel_format == PixelFormat::RGBA6_Z24 ? bpmem.dstalpha.hex : 0; @@ -270,7 +270,7 @@ void PixelShaderManager::SetAlphaTestChanged() // TODO: we could optimize this further and check the actual constants, // i.e. "a <= 0" and "a >= 255" will always pass. u32 alpha_test = - bpmem.alpha_test.TestResult() != AlphaTest::PASS ? bpmem.alpha_test.hex | 1 << 31 : 0; + bpmem.alpha_test.TestResult() != AlphaTestResult::Pass ? bpmem.alpha_test.hex | 1 << 31 : 0; if (constants.alphaTest != alpha_test) { constants.alphaTest = alpha_test; @@ -362,25 +362,26 @@ void PixelShaderManager::SetZTextureTypeChanged() { switch (bpmem.ztex2.type) { - case TEV_ZTEX_TYPE_U8: + case ZTexFormat::U8: constants.zbias[0][0] = 0; constants.zbias[0][1] = 0; constants.zbias[0][2] = 0; constants.zbias[0][3] = 1; break; - case TEV_ZTEX_TYPE_U16: + case ZTexFormat::U16: constants.zbias[0][0] = 1; constants.zbias[0][1] = 0; constants.zbias[0][2] = 0; constants.zbias[0][3] = 256; break; - case TEV_ZTEX_TYPE_U24: + case ZTexFormat::U24: constants.zbias[0][0] = 65536; constants.zbias[0][1] = 256; constants.zbias[0][2] = 1; constants.zbias[0][3] = 0; break; default: + PanicAlertFmt("Invalid ztex format {}", bpmem.ztex2.type); break; } dirty = true; @@ -457,8 +458,9 @@ void PixelShaderManager::SetZModeControl() { u32 late_ztest = bpmem.UseLateDepthTest(); u32 rgba6_format = - (bpmem.zcontrol.pixel_format == PEControl::RGBA6_Z24 && !g_ActiveConfig.bForceTrueColor) ? 1 : - 0; + (bpmem.zcontrol.pixel_format == PixelFormat::RGBA6_Z24 && !g_ActiveConfig.bForceTrueColor) ? + 1 : + 0; u32 dither = rgba6_format && bpmem.blendmode.dither; if (constants.late_ztest != late_ztest || constants.rgba6_format != rgba6_format || constants.dither != dither) |
