From 38bd7b0402b7ee51ee1f307926a3987d84677b5e Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Thu, 5 Mar 2026 10:58:20 -0600 Subject: [PATCH] GS: Move shader enums to dedicated file --- pcsx2/CMakeLists.txt | 1 + pcsx2/GS/Renderers/Common/GSDevice.cpp | 18 ++++----- pcsx2/GS/Renderers/Common/GSDevice.h | 38 ++++--------------- pcsx2/GS/Renderers/Common/GSShaderEnums.h | 39 ++++++++++++++++++++ pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 37 ++++++++++--------- pcsx2/GS/Renderers/HW/GSRendererHW.h | 5 ++- pcsx2/GS/Renderers/Metal/GSDeviceMTL.h | 2 +- pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm | 27 ++++++-------- pcsx2/GS/Renderers/Metal/GSMTLSharedHeader.h | 9 +---- pcsx2/GS/Renderers/Metal/tfx.metal | 10 ++--- pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp | 4 +- pcsx2/pcsx2.vcxproj | 1 + pcsx2/pcsx2.vcxproj.filters | 3 ++ 13 files changed, 104 insertions(+), 90 deletions(-) create mode 100644 pcsx2/GS/Renderers/Common/GSShaderEnums.h diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index be64e4c878..972a2a5b37 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -544,6 +544,7 @@ set(pcsx2GSHeaders GS/Renderers/Common/GSFastList.h GS/Renderers/Common/GSFunctionMap.h GS/Renderers/Common/GSRenderer.h + GS/Renderers/Common/GSShaderEnums.h GS/Renderers/Common/GSTexture.h GS/Renderers/Common/GSVertex.h GS/Renderers/Common/GSVertexTrace.h diff --git a/pcsx2/GS/Renderers/Common/GSDevice.cpp b/pcsx2/GS/Renderers/Common/GSDevice.cpp index 87d3b1bfdf..53efd7719a 100644 --- a/pcsx2/GS/Renderers/Common/GSDevice.cpp +++ b/pcsx2/GS/Renderers/Common/GSDevice.cpp @@ -1121,17 +1121,17 @@ std::string GSHWDrawConfig::GetPSDateName(u32 date) } } -std::string GSHWDrawConfig::GetPSAlphaTestName(u32 atst) +std::string GSHWDrawConfig::GetPSAlphaTestName(PS_ATST atst) { - switch (static_cast(atst)) + switch (atst) { - case GSHWDrawConfig::PSAlphaTest::PS_ATST_NONE: return "NONE"; - case GSHWDrawConfig::PSAlphaTest::PS_ATST_LEQUAL: return "LEQUAL"; - case GSHWDrawConfig::PSAlphaTest::PS_ATST_GEQUAL: return "GEQUAL"; - case GSHWDrawConfig::PSAlphaTest::PS_ATST_EQUAL: return "EQUAL"; - case GSHWDrawConfig::PSAlphaTest::PS_ATST_NOTEQUAL: return "NOTEQUAL"; - default: return std::to_string(atst); + case PS_ATST::NONE: return "NONE"; + case PS_ATST::LEQUAL: return "LEQUAL"; + case PS_ATST::GEQUAL: return "GEQUAL"; + case PS_ATST::EQUAL: return "EQUAL"; + case PS_ATST::NOTEQUAL: return "NOTEQUAL"; }; + return "UNKNOWN"; } std::string GSHWDrawConfig::GetPSDstFmtName(u32 dstfmt) @@ -1333,7 +1333,7 @@ void GSHWDrawConfig::DumpPSSelector(std::ostream& out, const PSSelector& ps, con out << indent << "fog: " << static_cast(ps.fog) << std::endl; out << indent << "iip: " << static_cast(ps.iip) << std::endl; out << indent << "date: " << static_cast(ps.date) << " # " << GetPSDateName(static_cast(ps.date)) << std::endl; - out << indent << "atst: " << static_cast(ps.atst) << " # " << GetPSAlphaTestName(static_cast(ps.atst)) << std::endl; + out << indent << "atst: " << static_cast(ps.atst) << " # " << GetPSAlphaTestName(ps.atst) << std::endl; out << indent << "afail: " << static_cast(ps.afail) << " # " << GSUtil::GetAFAILName(static_cast(ps.afail)) << std::endl; out << indent << "fst: " << static_cast(ps.fst) << std::endl; out << indent << "tfx: " << static_cast(ps.tfx) << std::endl; diff --git a/pcsx2/GS/Renderers/Common/GSDevice.h b/pcsx2/GS/Renderers/Common/GSDevice.h index 8b925e5f9a..5db2572f05 100644 --- a/pcsx2/GS/Renderers/Common/GSDevice.h +++ b/pcsx2/GS/Renderers/Common/GSDevice.h @@ -7,6 +7,7 @@ #include "common/WindowInfo.h" #include "GS/GS.h" #include "GS/Renderers/Common/GSFastList.h" +#include "GS/Renderers/Common/GSShaderEnums.h" #include "GS/Renderers/Common/GSTexture.h" #include "GS/Renderers/Common/GSVertex.h" #include "GS/GSAlignedClass.h" @@ -300,13 +301,9 @@ struct alignas(16) GSHWDrawConfig Line, Triangle, }; - enum class VSExpand: u8 - { - None, - Point, - Line, - Sprite, - }; + using VSExpand = GSShader::VSExpand; + using PS_ATST = GSShader::PS_ATST; + using PS_AFAIL = GSShader::PS_AFAIL; #pragma pack(push, 1) struct VSSelector { @@ -330,28 +327,7 @@ struct alignas(16) GSHWDrawConfig __fi bool UseExpandIndexBuffer() const { return (expand == VSExpand::Point || expand == VSExpand::Sprite); } }; static_assert(sizeof(VSSelector) == 1, "VSSelector is a single byte"); -#pragma pack(pop) - enum PSAlphaTest - { - PS_ATST_NONE = 0, - PS_ATST_LEQUAL = 1, - PS_ATST_GEQUAL = 2, - PS_ATST_EQUAL = 3, - PS_ATST_NOTEQUAL = 4 - }; - - // Identical with the usual GS enum except for the RGB_ONLY_DSB - enum PSAfail - { - PS_AFAIL_KEEP = 0, - PS_AFAIL_FB_ONLY = 1, - PS_AFAIL_ZB_ONLY = 2, - PS_AFAIL_RGB_ONLY = 3, - PS_AFAIL_RGB_ONLY_DSB = 4 // RGB only with dual source blend. - }; - -#pragma pack(push, 4) struct PSSelector { // Performance note: there are too many shader combinations @@ -375,8 +351,8 @@ struct alignas(16) GSHWDrawConfig u32 iip : 1; // Pixel test u32 date : 3; - u32 atst : 3; - u32 afail : 3; + PS_ATST atst : 3; + PS_AFAIL afail : 3; u32 ztst : 2; // Color sampling u32 fst : 1; // Investigate to do it on the VS @@ -842,7 +818,7 @@ struct alignas(16) GSHWDrawConfig // Dumping static std::string GetTopologyName(u32 topology); static std::string GetVSExpandName(u32 vsexpand); - static std::string GetPSAlphaTestName(u32 dstfmt); + static std::string GetPSAlphaTestName(PS_ATST dstfmt); static std::string GetPSDstFmtName(u32 dstfmt); static std::string GetPSDepthFmtName(u32 depthfmt); static std::string GetPSBlendABDName(u32 abd); diff --git a/pcsx2/GS/Renderers/Common/GSShaderEnums.h b/pcsx2/GS/Renderers/Common/GSShaderEnums.h new file mode 100644 index 0000000000..155c9d904c --- /dev/null +++ b/pcsx2/GS/Renderers/Common/GSShaderEnums.h @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: 2002-2026 PCSX2 Dev Team +// SPDX-License-Identifier: GPL-3.0+ + +// Enums that are used by shaders, to be included by both C++ and shader code +// Assume that cstdint types are available, but don't actually include the header (it's not available in shaders) +// (Currently only used by Metal) + +#pragma once + +namespace GSShader { + +enum class VSExpand : uint8_t +{ + None = 0, + Point = 1, + Line = 2, + Sprite = 3, +}; + +enum class PS_ATST : uint32_t +{ + NONE = 0, + LEQUAL = 1, + GEQUAL = 2, + EQUAL = 3, + NOTEQUAL = 4 +}; + +// Identical with the usual GS enum except for the RGB_ONLY_DSB +enum class PS_AFAIL : uint32_t +{ + KEEP = 0, + FB_ONLY = 1, + ZB_ONLY = 2, + RGB_ONLY = 3, + RGB_ONLY_DSB = 4 // RGB only with dual source blend. +}; + +} // namespace GSShader diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index c583bdd415..d8a8838348 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -12,6 +12,9 @@ #include "common/StringUtil.h" #include +using PS_ATST = GSShader::PS_ATST; +using PS_AFAIL = GSShader::PS_AFAIL; + GSRendererHW::GSRendererHW() : GSRenderer() { @@ -7856,7 +7859,7 @@ bool GSRendererHW::CanUseTexIsFB(const GSTextureCache::Target* rt, const GSTextu return false; } -void GSRendererHW::GetAlphaTestConfigPS(const u32 atst, const u8 aref, const bool invert_test, u32& ps_atst_out, float& aref_out) +void GSRendererHW::GetAlphaTestConfigPS(const u32 atst, const u8 aref, const bool invert_test, PS_ATST& ps_atst_out, float& aref_out) { static const u32 inverted_atst[] = { ATST_ALWAYS, @@ -7875,32 +7878,32 @@ void GSRendererHW::GetAlphaTestConfigPS(const u32 atst, const u8 aref, const boo { case ATST_LESS: aref_out = static_cast(aref) - small_val; - ps_atst_out = GSHWDrawConfig::PS_ATST_LEQUAL; + ps_atst_out = PS_ATST::LEQUAL; break; case ATST_LEQUAL: aref_out = static_cast(aref) - small_val + 1.0f; - ps_atst_out = GSHWDrawConfig::PS_ATST_LEQUAL; + ps_atst_out = PS_ATST::LEQUAL; break; case ATST_GEQUAL: aref_out = static_cast(aref) - small_val; - ps_atst_out = GSHWDrawConfig::PS_ATST_GEQUAL; + ps_atst_out = PS_ATST::GEQUAL; break; case ATST_GREATER: aref_out = static_cast(aref) - small_val + 1.0f; - ps_atst_out = GSHWDrawConfig::PS_ATST_GEQUAL; + ps_atst_out = PS_ATST::GEQUAL; break; case ATST_EQUAL: aref_out = static_cast(aref); - ps_atst_out = GSHWDrawConfig::PS_ATST_EQUAL; + ps_atst_out = PS_ATST::EQUAL; break; case ATST_NOTEQUAL: aref_out = static_cast(aref); - ps_atst_out = GSHWDrawConfig::PS_ATST_NOTEQUAL; + ps_atst_out = PS_ATST::NOTEQUAL; break; case ATST_NEVER: case ATST_ALWAYS: default: - ps_atst_out = GSHWDrawConfig::PS_ATST_NONE; + ps_atst_out = PS_ATST::NONE; break; } } @@ -7919,7 +7922,7 @@ void GSRendererHW::EmulateAlphaTest(DATEOptions& date_options) GL_PUSH("HW: Alpha test config (1)"); // Temp pixel shader constants for the setup. - u32 ps_atst; + PS_ATST ps_atst; float ps_aref; u32 atst = m_cached_ctx.TEST.ATST; @@ -7976,7 +7979,7 @@ void GSRendererHW::EmulateAlphaTest(DATEOptions& date_options) GetAlphaTestConfigPS(atst, aref, false, ps_atst, ps_aref); m_conf.ps.atst = ps_atst; m_conf.cb_ps.FogColor_AREF.a = ps_aref; - m_conf.ps.afail = GSHWDrawConfig::PS_AFAIL_KEEP; + m_conf.ps.afail = PS_AFAIL::KEEP; m_conf.alpha_test = GSHWDrawConfig::AlphaTestMode::KEEP; return; } @@ -8043,7 +8046,7 @@ void GSRendererHW::EmulateAlphaTest(DATEOptions& date_options) GetAlphaTestConfigPS(atst, aref, false, ps_atst, ps_aref); m_conf.ps.atst = ps_atst; m_conf.cb_ps.FogColor_AREF.a = ps_aref; - m_conf.ps.afail = afail; + m_conf.ps.afail = static_cast(afail); m_conf.ps.color_feedback |= afail_needs_rt; m_conf.ps.depth_feedback |= afail_needs_depth; @@ -8086,7 +8089,7 @@ void GSRendererHW::EmulateAlphaTest(DATEOptions& date_options) GetAlphaTestConfigPS(atst, aref, false, ps_atst, ps_aref); m_conf.ps.atst = ps_atst; m_conf.cb_ps.FogColor_AREF.a = ps_aref; - m_conf.ps.afail = GSHWDrawConfig::PS_AFAIL_RGB_ONLY_DSB; + m_conf.ps.afail = PS_AFAIL::RGB_ONLY_DSB; m_conf.ps.no_color1 = false; // Swap stencil DATE for PrimID DATE, for both Z on and off cases. @@ -8113,7 +8116,7 @@ void GSRendererHW::EmulateAlphaTest(DATEOptions& date_options) GetAlphaTestConfigPS(atst, aref, false, ps_atst, ps_aref); m_conf.ps.atst = ps_atst; m_conf.cb_ps.FogColor_AREF.a = ps_aref; - m_conf.ps.afail = GSHWDrawConfig::PS_AFAIL_KEEP; + m_conf.ps.afail = PS_AFAIL::KEEP; m_conf.alpha_test = GSHWDrawConfig::AlphaTestMode::PASS_THEN_FAIL; } } @@ -8132,7 +8135,7 @@ void GSRendererHW::EmulateAlphaTestSecondPass() const u32 aref = m_cached_ctx.TEST.AREF; // Temp variables for PS config. - u32 ps_atst; + PS_ATST ps_atst; float ps_aref; std::memcpy(&m_conf.alpha_second_pass.ps, &m_conf.ps, sizeof(m_conf.ps)); @@ -8156,7 +8159,7 @@ void GSRendererHW::EmulateAlphaTestSecondPass() m_conf.alpha_second_pass.enable = true; m_conf.alpha_second_pass.ps.atst = ps_atst; m_conf.alpha_second_pass.ps_aref = ps_aref; - m_conf.alpha_second_pass.ps.afail = GSHWDrawConfig::PS_AFAIL_KEEP; + m_conf.alpha_second_pass.ps.afail = PS_AFAIL::KEEP; } // Setup for RBG_ONLY dual source blend selection @@ -8213,7 +8216,7 @@ void GSRendererHW::EmulateAlphaTestSecondPass() m_conf.alpha_second_pass.enable = true; m_conf.alpha_second_pass.ps.atst = ps_atst; m_conf.alpha_second_pass.ps_aref = ps_aref; - m_conf.alpha_second_pass.ps.afail = GSHWDrawConfig::PS_AFAIL_KEEP; + m_conf.alpha_second_pass.ps.afail = PS_AFAIL::KEEP; } } @@ -10073,4 +10076,4 @@ void GSRendererHW::CleanupDepthAsRTFeedback() g_gs_device->Recycle(m_conf.ds_as_rt); m_conf.ds_as_rt = nullptr; } -} \ No newline at end of file +} diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.h b/pcsx2/GS/Renderers/HW/GSRendererHW.h index 6aee33463b..7df64d73e4 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.h +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.h @@ -92,6 +92,9 @@ private: bool TextureCoversWithoutGapsNotEqual(); bool Is8PixelReverseSprite(const GSVertex& v0, const GSVertex& v1); + using PS_ATST = GSShader::PS_ATST; + using PS_AFAIL = GSShader::PS_AFAIL; + enum class CLUTDrawTestResult { NotCLUTDraw, @@ -144,7 +147,7 @@ private: const TextureMinMaxResult& tmm); void EmulateZbuffer(const GSTextureCache::Target* ds); - static void GetAlphaTestConfigPS(const u32 atst, const u8 aref, const bool invert_test, u32& ps_atst_out, float& aref_out); + static void GetAlphaTestConfigPS(const u32 atst, const u8 aref, const bool invert_test, PS_ATST& ps_atst_out, float& aref_out); void EmulateAlphaTest(DATEOptions& date_options); void EmulateAlphaTestSecondPass(); diff --git a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h index a66282a4d7..af478b8fc3 100644 --- a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h +++ b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h @@ -202,7 +202,7 @@ public: bool iip : 1; bool fst : 1; bool point_size : 1; - GSMTLExpandType expand : 2; + GSShader::VSExpand expand : 2; }; u8 key; }; diff --git a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm index 281bca3346..d9409c243a 100644 --- a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm +++ b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm @@ -747,6 +747,12 @@ static void setFnConstantI(MTLFunctionConstantValues* fc, unsigned int value, GS [fc setConstantValue:&value type:MTLDataTypeUInt atIndex:constant]; } +template , bool> = true> +static void setFnConstantI(MTLFunctionConstantValues* fc, T value, GSMTLFnConstants constant) +{ + setFnConstantI(fc, static_cast>(value), constant); +} + template static void OnMainThread(Fn&& fn) { @@ -1051,15 +1057,15 @@ bool GSDeviceMTL::Create(GSVSyncMode vsync_mode, bool allow_present_throttle) { VSSelector sel; sel.key = i; - if (sel.point_size && sel.expand != GSMTLExpandType::None) + if (sel.point_size && sel.expand != GSShader::VSExpand::None) continue; setFnConstantB(m_fn_constants, sel.fst, GSMTLConstantIndex_FST); setFnConstantB(m_fn_constants, sel.iip, GSMTLConstantIndex_IIP); setFnConstantB(m_fn_constants, sel.point_size, GSMTLConstantIndex_VS_POINT_SIZE); NSString* shader = @"vs_main"; - if (sel.expand != GSMTLExpandType::None) + if (sel.expand != GSShader::VSExpand::None) { - setFnConstantI(m_fn_constants, static_cast(sel.expand), GSMTLConstantIndex_VS_EXPAND_TYPE); + setFnConstantI(m_fn_constants, sel.expand, GSMTLConstantIndex_VS_EXPAND_TYPE); shader = @"vs_main_expand"; } m_hw_vs[i] = LoadShader(shader); @@ -1799,17 +1805,6 @@ static MTLBlendOperation ConvertBlendOp(GSDevice::BlendOp generic) } } -static GSMTLExpandType ConvertVSExpand(GSHWDrawConfig::VSExpand generic) -{ - switch (generic) - { - case GSHWDrawConfig::VSExpand::None: return GSMTLExpandType::None; - case GSHWDrawConfig::VSExpand::Point: return GSMTLExpandType::Point; - case GSHWDrawConfig::VSExpand::Line: return GSMTLExpandType::Line; - case GSHWDrawConfig::VSExpand::Sprite: return GSMTLExpandType::Sprite; - } -} - void GSDeviceMTL::MRESetHWPipelineState(GSHWDrawConfig::VSSelector vssel, GSHWDrawConfig::PSSelector pssel, GSHWDrawConfig::BlendState blend, GSHWDrawConfig::ColorMaskSelector cms) { PipelineSelectorExtrasMTL extras(blend, m_current_render.color_target, cms, m_current_render.depth_target, m_current_render.stencil_target); @@ -1831,7 +1826,7 @@ void GSDeviceMTL::MRESetHWPipelineState(GSHWDrawConfig::VSSelector vssel, GSHWDr vssel_mtl.fst = vssel.fst; vssel_mtl.iip = vssel.iip; vssel_mtl.point_size = vssel.point_size; - vssel_mtl.expand = ConvertVSExpand(vssel.expand); + vssel_mtl.expand = vssel.expand; id vs = m_hw_vs[vssel_mtl.key]; id ps; @@ -1906,7 +1901,7 @@ void GSDeviceMTL::MRESetHWPipelineState(GSHWDrawConfig::VSSelector vssel, GSHWDr MRCOwned pdesc = MRCTransfer([MTLRenderPipelineDescriptor new]); if (vssel_mtl.point_size) [pdesc setInputPrimitiveTopology:MTLPrimitiveTopologyClassPoint]; - if (vssel_mtl.expand == GSMTLExpandType::None) + if (vssel_mtl.expand == GSShader::VSExpand::None) [pdesc setVertexDescriptor:m_hw_vertex]; else [pdesc setInputPrimitiveTopology:MTLPrimitiveTopologyClassTriangle]; diff --git a/pcsx2/GS/Renderers/Metal/GSMTLSharedHeader.h b/pcsx2/GS/Renderers/Metal/GSMTLSharedHeader.h index de98dae597..08e50b7f63 100644 --- a/pcsx2/GS/Renderers/Metal/GSMTLSharedHeader.h +++ b/pcsx2/GS/Renderers/Metal/GSMTLSharedHeader.h @@ -3,6 +3,7 @@ #pragma once #include +#include "../Common/GSShaderEnums.h" enum GSMTLBufferIndices { @@ -148,14 +149,6 @@ enum GSMTLAttributes GSMTLAttributeIndexF, }; -enum class GSMTLExpandType : unsigned char -{ - None = 0, - Point = 1, - Line = 2, - Sprite = 3, -}; - enum GSMTLFnConstants { GSMTLConstantIndex_CAS_SHARPEN_ONLY, diff --git a/pcsx2/GS/Renderers/Metal/tfx.metal b/pcsx2/GS/Renderers/Metal/tfx.metal index 3779e3dfea..ac7cfdd911 100644 --- a/pcsx2/GS/Renderers/Metal/tfx.metal +++ b/pcsx2/GS/Renderers/Metal/tfx.metal @@ -71,7 +71,7 @@ constant bool PS_MANUAL_LOD [[function_constant(GSMTLConstantIndex_PS_MA constant bool PS_REGION_RECT [[function_constant(GSMTLConstantIndex_PS_REGION_RECT)]]; constant uint PS_SCANMSK [[function_constant(GSMTLConstantIndex_PS_SCANMSK)]]; -constant GSMTLExpandType VS_EXPAND_TYPE = static_cast(VS_EXPAND_TYPE_RAW); +constant GSShader::VSExpand VS_EXPAND_TYPE = static_cast(VS_EXPAND_TYPE_RAW); #if defined(__METAL_MACOS__) && __METAL_VERSION__ >= 220 #define PRIMID_SUPPORT 1 @@ -219,9 +219,9 @@ vertex MainVSOut vs_main_expand( { switch (VS_EXPAND_TYPE) { - case GSMTLExpandType::None: + case GSShader::VSExpand::None: return vs_main_run(load_vertex(vertices[vid]), cb); - case GSMTLExpandType::Point: + case GSShader::VSExpand::Point: { MainVSOut point = vs_main_run(load_vertex(vertices[vid >> 2]), cb); if (vid & 1) @@ -230,7 +230,7 @@ vertex MainVSOut vs_main_expand( point.p.y += cb.point_size.y; return point; } - case GSMTLExpandType::Line: + case GSShader::VSExpand::Line: { uint vid_base = vid >> 2; bool is_bottom = vid & 2; @@ -252,7 +252,7 @@ vertex MainVSOut vs_main_expand( return point; } - case GSMTLExpandType::Sprite: + case GSShader::VSExpand::Sprite: { uint vid_base = vid >> 1; bool is_bottom = vid & 2; diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp index 30ba47737f..23f61f1390 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp @@ -4813,8 +4813,8 @@ VkShaderModule GSDeviceVK::GetTFXFragmentShader(const GSHWDrawConfig::PSSelector AddMacro(ss, "PS_AEM", sel.aem); AddMacro(ss, "PS_TFX", sel.tfx); AddMacro(ss, "PS_TCC", sel.tcc); - AddMacro(ss, "PS_ATST", sel.atst); - AddMacro(ss, "PS_AFAIL", sel.afail); + AddMacro(ss, "PS_ATST", static_cast(sel.atst)); + AddMacro(ss, "PS_AFAIL", static_cast(sel.afail)); AddMacro(ss, "PS_FOG", sel.fog); AddMacro(ss, "PS_BLEND_HW", sel.blend_hw); AddMacro(ss, "PS_A_MASKED", sel.a_masked); diff --git a/pcsx2/pcsx2.vcxproj b/pcsx2/pcsx2.vcxproj index 5520881124..246280513a 100644 --- a/pcsx2/pcsx2.vcxproj +++ b/pcsx2/pcsx2.vcxproj @@ -773,6 +773,7 @@ + diff --git a/pcsx2/pcsx2.vcxproj.filters b/pcsx2/pcsx2.vcxproj.filters index 05101213aa..b9e3c1a922 100644 --- a/pcsx2/pcsx2.vcxproj.filters +++ b/pcsx2/pcsx2.vcxproj.filters @@ -2027,6 +2027,9 @@ System\Ps2\GS\Renderers\Common + + System\Ps2\GS\Renderers\Common + System\Ps2\GS\Renderers\Common