summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/UberShaderCommon.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-06-17 20:04:25 +0200
committerGitHub <noreply@github.com>2023-06-17 20:04:25 +0200
commit93d9e90798fd1e3a25f378a2c46a74643f6944fc (patch)
treede1d5af55a5c2347145628d58a09cd35439ab680 /Source/Core/VideoCommon/UberShaderCommon.cpp
parent4d0330987892f790f9540a463010cb934795fdac (diff)
parent7523a62105cf5af34dff4dabc771320513e0ddfc (diff)
Merge pull request #11962 from Minty-Meeo/to-underlying
EnumUtils: Add Common::ToUnderlying
Diffstat (limited to 'Source/Core/VideoCommon/UberShaderCommon.cpp')
-rw-r--r--Source/Core/VideoCommon/UberShaderCommon.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/UberShaderCommon.cpp b/Source/Core/VideoCommon/UberShaderCommon.cpp
index 2af2f47927..d35f203737 100644
--- a/Source/Core/VideoCommon/UberShaderCommon.cpp
+++ b/Source/Core/VideoCommon/UberShaderCommon.cpp
@@ -3,6 +3,7 @@
#include "VideoCommon/UberShaderCommon.h"
+#include "Common/EnumUtils.h"
#include "VideoCommon/NativeVertexFormat.h"
#include "VideoCommon/ShaderGenCommon.h"
#include "VideoCommon/VideoCommon.h"
@@ -119,11 +120,11 @@ void WriteVertexLighting(ShaderCode& out, APIType api_type, std::string_view wor
out.Write(" if ({} != 0u) {{\n", BitfieldExtract<&LitChannel::enablelighting>("alphareg"));
out.Write(" if ({} != 0u) {{\n", BitfieldExtract<&LitChannel::ambsource>("alphareg"));
out.Write(" if ((components & ({}u << chan)) != 0u) // VB_HAS_COL0\n",
- static_cast<u32>(VB_HAS_COL0));
+ Common::ToUnderlying(VB_HAS_COL0));
out.Write(" lacc.w = int(round(((chan == 0u) ? {}.w : {}.w) * 255.0));\n", in_color_0_var,
in_color_1_var);
out.Write(" else if ((components & {}u) != 0u) // VB_HAS_COLO0\n",
- static_cast<u32>(VB_HAS_COL0));
+ Common::ToUnderlying(VB_HAS_COL0));
out.Write(" lacc.w = int(round({}.w * 255.0));\n", in_color_0_var);
out.Write(" else\n"
" lacc.w = 255;\n"