mirror of https://github.com/AxioDL/metaforce.git
Metal extended shader fixes
This commit is contained in:
parent
5f60a33cce
commit
07fcc2db92
|
@ -1 +1 @@
|
|||
Subproject commit 758be7d76cc6fac9fddab6c075dd6bd5f79c0ace
|
||||
Subproject commit 3d96463db7b93a539d0f9407c439628f040bc883
|
|
@ -35,11 +35,6 @@ private:
|
|||
return hecl::Format("float3(%g,%g,%g)", vec.vec[0], vec.vec[1], vec.vec[2]);
|
||||
}
|
||||
|
||||
std::string EmitColorRegUse(unsigned idx) const
|
||||
{
|
||||
return hecl::Format("lu.colorReg%u", idx);
|
||||
}
|
||||
|
||||
std::string EmitTexGenSource2(TexGenSrc src, int uvIdx) const;
|
||||
std::string EmitTexGenSource4(TexGenSrc src, int uvIdx) const;
|
||||
};
|
||||
|
|
|
@ -72,17 +72,17 @@ private:
|
|||
return hecl::Format("sampling%u.a", samplingIdx);
|
||||
}
|
||||
|
||||
virtual std::string EmitColorRegUseRaw(unsigned idx) const
|
||||
std::string EmitColorRegUseRaw(unsigned idx) const
|
||||
{
|
||||
return hecl::Format("colorReg%u", idx);
|
||||
}
|
||||
|
||||
virtual std::string EmitColorRegUseRGB(unsigned idx) const
|
||||
std::string EmitColorRegUseRGB(unsigned idx) const
|
||||
{
|
||||
return hecl::Format("colorReg%u.rgb", idx);
|
||||
}
|
||||
|
||||
virtual std::string EmitColorRegUseAlpha(unsigned idx) const
|
||||
std::string EmitColorRegUseAlpha(unsigned idx) const
|
||||
{
|
||||
return hecl::Format("colorReg%u.a", idx);
|
||||
}
|
||||
|
|
|
@ -229,6 +229,18 @@ std::string Metal::makeFrag(size_t blockCount, const char** blockNames, bool alp
|
|||
"{\n"
|
||||
" FragOut out;\n";
|
||||
|
||||
if (lighting.m_source)
|
||||
{
|
||||
retval += " float4 colorReg0 = block0.colorReg0;\n"
|
||||
" float4 colorReg1 = block0.colorReg1;\n"
|
||||
" float4 colorReg2 = block0.colorReg2;\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
retval += " float4 colorReg0 = float4(1.0, 1.0, 1.0, 1.0);\n"
|
||||
" float4 colorReg1 = float4(1.0, 1.0, 1.0, 1.0);\n"
|
||||
" float4 colorReg2 = float4(1.0, 1.0, 1.0, 1.0);\n";
|
||||
}
|
||||
|
||||
if (m_lighting)
|
||||
{
|
||||
|
@ -307,6 +319,19 @@ std::string Metal::makeFrag(size_t blockCount, const char** blockNames, bool alp
|
|||
"{\n"
|
||||
" FragOut out;\n";
|
||||
|
||||
if (lighting.m_source)
|
||||
{
|
||||
retval += " float4 colorReg0 = block0.colorReg0;\n"
|
||||
" float4 colorReg1 = block0.colorReg1;\n"
|
||||
" float4 colorReg2 = block0.colorReg2;\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
retval += " float4 colorReg0 = float4(1.0, 1.0, 1.0, 1.0);\n"
|
||||
" float4 colorReg1 = float4(1.0, 1.0, 1.0, 1.0);\n"
|
||||
" float4 colorReg2 = float4(1.0, 1.0, 1.0, 1.0);\n";
|
||||
}
|
||||
|
||||
if (m_lighting)
|
||||
{
|
||||
if (lighting.m_entry)
|
||||
|
|
Loading…
Reference in New Issue