2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-20 12:59:12 +00:00

Default colorRegs when lighting uniform not available

This commit is contained in:
Jack Andersen
2016-07-31 20:35:35 -10:00
parent 7e42581cf0
commit b7143c7dca
2 changed files with 28 additions and 0 deletions

View File

@@ -185,6 +185,13 @@ std::string HLSL::makeFrag(bool alphaTest, const ShaderFunction& lighting) const
std::string lightingSrc;
if (lighting.m_source)
lightingSrc = lighting.m_source;
else
lightingSrc = "cbuffer LightingUniform : register(b2)\n"
"{\n"
" float4 colorReg0;\n"
" float4 colorReg1;\n"
" float4 colorReg2;\n"
"};\n";
std::string texMapDecl;
if (m_texMapEnd)
@@ -228,6 +235,13 @@ std::string HLSL::makeFrag(bool alphaTest, const ShaderFunction& lighting,
std::string lightingSrc;
if (lighting.m_source)
lightingSrc = lighting.m_source;
else
lightingSrc = "cbuffer LightingUniform : register(b2)\n"
"{\n"
" float4 colorReg0;\n"
" float4 colorReg1;\n"
" float4 colorReg2;\n"
"};\n";
std::string postSrc;
if (post.m_source)