summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexShaderGen.cpp
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2025-02-12 20:18:20 -0600
committeriwubcode <iwubcode@users.noreply.github.com>2025-03-13 23:56:04 -0500
commit15372dc835a2c387f8f566fa86d6cc60b2534a7d (patch)
treede748ed185b1e3cf74c9509122b79fbb5432d9b7 /Source/Core/VideoCommon/VertexShaderGen.cpp
parentca9b34a6d1e7ad03c4879239e9c5b79a6c47522e (diff)
VideoCommon: move lighting shader logic to callable functions
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexShaderGen.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp
index 41512cd489..ace5cb514e 100644
--- a/Source/Core/VideoCommon/VertexShaderGen.cpp
+++ b/Source/Core/VideoCommon/VertexShaderGen.cpp
@@ -190,6 +190,7 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const ShaderHostConfig& ho
out.Write("}};\n\n");
WriteIsNanHeader(out, api_type);
+ GenerateLightingShaderHeader(out, uid_data->lighting);
if (uid_data->vs_expand == VSExpand::None)
{
@@ -434,7 +435,12 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const ShaderHostConfig& ho
"float3 ldir, h, cosAttn, distAttn;\n"
"float dist, dist2, attn;\n");
- GenerateLightingShaderCode(out, uid_data->lighting, "vertex_color_", "o.colors_");
+ for (u32 chan = 0; chan < NUM_XF_COLOR_CHANNELS; chan++)
+ {
+ out.Write(
+ "\to.colors_{0} = dolphin_calculate_lighting_chn{0}(vertex_color_{0}, pos.xyz, _normal);\n",
+ chan);
+ }
// transform texcoords
out.Write("float4 coord = float4(0.0, 0.0, 1.0, 1.0);\n");