@@ -114,13 +114,27 @@ void fixupVertexDataInstance(ShaderStage& stage)
114
114
= " [$]" + d (HW::T_VERTEX_DATA_INSTANCE) + " [.][$](" + d (HW::T_TEXCOORD) + " _[0-9]+)" ;
115
115
static const std::regex vdCleanTexRegex (vdCleanTexSource.c_str ());
116
116
117
+ // Find keywords: (as text)
118
+ //
119
+ // HW::T_VERTEX_DATA_INSTANCE.(T_COLOR_INDEX) $vd.$color_0;
120
+ //
121
+ // And replace with:
122
+ //
123
+ // (T_COLOR_INDEX) color_0;
124
+ //
125
+
126
+ static const std::string vdCleanColorSource
127
+ = " [$]" + d (HW::T_VERTEX_DATA_INSTANCE) + " [.][$](" + d (HW::T_COLOR) + " _[0-9]+)" ;
128
+ static const std::regex vdCleanColorRegex (vdCleanColorSource.c_str ());
129
+
117
130
std::string code = stage.getSourceCode ();
118
131
code = std::regex_replace (code, paramRegex, " vec3 unused_$1" );
119
132
code = std::regex_replace (code, vtxRegex, " $$$1( PIX_IN.$$$1 )" );
120
133
code = std::regex_replace (code, primvarParamRegex, " vec$1 unused_$2" );
121
134
code = std::regex_replace (code, texcoordParamRegex, " vec$1 unused_$2" );
122
135
code = std::regex_replace (code, vdCleanGeoRegex, " PIX_IN.$1" );
123
136
code = std::regex_replace (code, vdCleanTexRegex, " PIX_IN.$1" );
137
+ code = std::regex_replace (code, vdCleanColorRegex, " $1" );
124
138
125
139
#if MX_COMBINED_VERSION >= 13804
126
140
stage.setSourceCode (code);
0 commit comments