diff --git a/hecl/extern/boo b/hecl/extern/boo index 7d1be415c..9d91cd459 160000 --- a/hecl/extern/boo +++ b/hecl/extern/boo @@ -1 +1 @@ -Subproject commit 7d1be415c6fd83468ede3641ffc07cfc06a6e9f9 +Subproject commit 9d91cd459ed9cf302e4e4ce2a43485d3b9b2733a diff --git a/hecl/lib/Backend/HLSL.cpp b/hecl/lib/Backend/HLSL.cpp index 99d1303d8..5dd8dc22b 100644 --- a/hecl/lib/Backend/HLSL.cpp +++ b/hecl/lib/Backend/HLSL.cpp @@ -129,9 +129,9 @@ std::string HLSL::GenerateReflectionExpr(ReflectionType type) const default: return "float3(0.0, 0.0, 0.0)"; case ReflectionType::Simple: - return "reflectionTex.Sample(samp, vtf.reflectTcgs[1]).rgb * vtf.reflectAlpha"; + return "reflectionTex.Sample(reflectSamp, vtf.reflectTcgs[1]).rgb * vtf.reflectAlpha"; case ReflectionType::Indirect: - return "reflectionTex.Sample(samp, (reflectionIndTex.Sample(samp, vtf.reflectTcgs[0]).rg - " + return "reflectionTex.Sample(reflectSamp, (reflectionIndTex.Sample(samp, vtf.reflectTcgs[0]).rg - " "float2(0.5, 0.5)) * float2(0.5, 0.5) + vtf.reflectTcgs[1]).rgb * vtf.reflectAlpha"; } } @@ -239,7 +239,8 @@ std::string HLSL::makeFrag(size_t blockCount, const char** blockNames, m_texMapEnd); std::string retval = "SamplerState samp : register(s0);\n" - "SamplerState clampSamp : register(s1);\n" + + "SamplerState clampSamp : register(s1);\n" + "SamplerState reflectSamp : register(s2);\n" + GenerateVertToFragStruct(0, reflectionType != ReflectionType::None) + texMapDecl + "\n" + lightingSrc + "\n" + @@ -315,7 +316,8 @@ std::string HLSL::makeFrag(size_t blockCount, const char** blockNames, std::string retval = "SamplerState samp : register(s0);\n" - "SamplerState clampSamp : register(s1);\n" + + "SamplerState clampSamp : register(s1);\n" + "SamplerState reflectSamp : register(s2);\n" + GenerateVertToFragStruct(extTexCount, reflectionType != ReflectionType::None) + texMapDecl + "\n" + lightingSrc + "\n" + diff --git a/hecl/lib/Backend/Metal.cpp b/hecl/lib/Backend/Metal.cpp index 8c7a29a2e..99a227f4c 100644 --- a/hecl/lib/Backend/Metal.cpp +++ b/hecl/lib/Backend/Metal.cpp @@ -133,9 +133,9 @@ std::string Metal::GenerateReflectionExpr(ReflectionType type) const default: return "float3(0.0, 0.0, 0.0)"; case ReflectionType::Simple: - return "reflectionTex.sample(samp, vtf.reflectTcgs1).rgb * vtf.reflectAlpha"; + return "reflectionTex.sample(reflectSamp, vtf.reflectTcgs1).rgb * vtf.reflectAlpha"; case ReflectionType::Indirect: - return "reflectionTex.sample(samp, (reflectionIndTex.sample(samp, vtf.reflectTcgs0).rg - " + return "reflectionTex.sample(reflectSamp, (reflectionIndTex.sample(samp, vtf.reflectTcgs0).rg - " "float2(0.5, 0.5)) * float2(0.5, 0.5) + vtf.reflectTcgs1).rgb * vtf.reflectAlpha"; } } @@ -254,7 +254,7 @@ std::string Metal::makeFrag(size_t blockCount, const char** blockNames, bool alp GenerateFragOutStruct() + "\n" + lightingSrc + "\n" + "fragment FragOut fmain(VertToFrag vtf [[ stage_in ]],\n" - "sampler samp [[ sampler(0) ]], sampler clampSamp [[ sampler(1) ]]" + texMapDecl + ")\n" + "sampler samp [[ sampler(0) ]], sampler clampSamp [[ sampler(1) ]], sampler reflectSamp [[ sampler(2) ]]" + texMapDecl + ")\n" "{\n" " FragOut out;\n"; @@ -367,7 +367,7 @@ std::string Metal::makeFrag(size_t blockCount, const char** blockNames, bool alp lightingSrc + "\n" + postSrc + "\n" + "fragment FragOut fmain(VertToFrag vtf [[ stage_in ]],\n" - "sampler samp [[ sampler(0) ]], sampler clampSamp [[ sampler(1) ]]" + texMapDecl + ")\n" + "sampler samp [[ sampler(0) ]], sampler clampSamp [[ sampler(1) ]], sampler reflectSamp [[ sampler(2) ]]" + texMapDecl + ")\n" "{\n" " FragOut out;\n";