Skip to content

Commit

Permalink
Some DX fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Oct 17, 2020
1 parent d7d376b commit d7b5040
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GPU/Common/VertexShaderGeneratorCommon.cpp
Expand Up @@ -44,7 +44,7 @@ char *WriteLights(char *p, const VShaderID &id, DoLightComputation doLight[4], b
}

if (!*specularIsZero) {
WRITE(p, " vec3 lightSum1 = vec3(0.0);\n");
WRITE(p, " vec3 lightSum1 = splat3(0.0);\n");
}
if (!diffuseIsZero) {
WRITE(p, " vec3 toLight;\n");
Expand Down
3 changes: 2 additions & 1 deletion GPU/Directx9/VertexShaderGeneratorDX9.cpp
Expand Up @@ -108,6 +108,7 @@ void GenerateVertexShaderHLSL(const VShaderID &id, char *buffer, ShaderLanguage
WRITE(p, "#define vec2 float2\n");
WRITE(p, "#define mediump\n");
WRITE(p, "#define lowp\n");
WRITE(p, "#define splat3(x) float3(x, x, x)\n");

if (lang == HLSL_DX9) {
WRITE(p, "#pragma warning( disable : 3571 )\n");
Expand Down Expand Up @@ -365,7 +366,7 @@ void GenerateVertexShaderHLSL(const VShaderID &id, char *buffer, ShaderLanguage
if (hasColor) {
WRITE(p, " float4 color0 = In.color0;\n");
}
if (lmode)
if (lmode && !useHWTransform)
WRITE(p, " float4 color1 = In.color1;\n");
if (doTexture && hasTexcoord) {
if (texCoordInVec3) {
Expand Down

0 comments on commit d7b5040

Please sign in to comment.