From 395e5c191b2f24491e48bfa56e44da064a2cbab3 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 18 Oct 2018 16:44:41 -1000 Subject: [PATCH] macOS build fixes --- Runtime/CMakeLists.txt | 3 ++- Shaders/CFogVolumeFilter.shader | 10 ++++++---- Shaders/shader_CFluidPlaneShaderMetal.cpp | 13 +++++++++---- hecl | 2 +- kabufuda | 2 +- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Runtime/CMakeLists.txt b/Runtime/CMakeLists.txt index 2b03f4442..177e98058 100644 --- a/Runtime/CMakeLists.txt +++ b/Runtime/CMakeLists.txt @@ -123,7 +123,8 @@ if(COMMAND cotire) set_target_properties(RuntimeCommon PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) cotire(RuntimeCommon) endif() +add_dependencies(RuntimeCommon ${HECL_APPLICATION_REPS_TARGETS_LIST}) if(WINDOWS_STORE) - set_property(TARGET RuntimeCommon PROPERTY VS_WINRT_COMPONENT TRUE) + set_property(TARGET RuntimeCommon PROPERTY VS_WINRT_COMPONENT TRUE) endif() diff --git a/Shaders/CFogVolumeFilter.shader b/Shaders/CFogVolumeFilter.shader index 1cb7652c6..cf6847a96 100644 --- a/Shaders/CFogVolumeFilter.shader +++ b/Shaders/CFogVolumeFilter.shader @@ -196,6 +196,7 @@ Texture2D zFrontfaceTex : register(t0); Texture2D zBackfaceTex : register(t1); Texture2D zLinearizer : register(t2); SamplerState samp : register(s0); +SamplerState zLinearizerSamp : register(s3); float4 main(in VertToFrag vtf) : SV_Target0 { float frontY; @@ -204,8 +205,8 @@ float4 main(in VertToFrag vtf) : SV_Target0 float frontX = modf((1.0 - zFrontfaceTex.Sample(samp, vtf.uv).r) * linScale, frontY); float backX = modf((1.0 - zBackfaceTex.Sample(samp, vtf.uv).r) * linScale, backY); const float uvBias = 0.5 / 256.0; - float frontLin = zLinearizer.Sample(samp, float2(frontX * 255.0 / 256.0 + uvBias, frontY / 256.0 + uvBias)).r; - float backLin = zLinearizer.Sample(samp, float2(backX * 255.0 / 256.0 + uvBias, backY / 256.0 + uvBias)).r; + float frontLin = zLinearizer.Sample(zLinearizerSamp, float2(frontX * 255.0 / 256.0 + uvBias, frontY / 256.0 + uvBias)).r; + float backLin = zLinearizer.Sample(zLinearizerSamp, float2(backX * 255.0 / 256.0 + uvBias, backY / 256.0 + uvBias)).r; return float4(vtf.color.rgb, (frontLin - backLin) * 10.0); } @@ -219,6 +220,7 @@ struct VertToFrag fragment float4 fmain(VertToFrag vtf [[ stage_in ]], sampler samp [[ sampler(0) ]], + sampler zLinearizerSamp [[ sampler(3) ]], texture2d zFrontfaceTex [[ texture(0) ]], texture2d zBackfaceTex [[ texture(1) ]], texture2d zLinearizer [[ texture(2) ]]) @@ -229,7 +231,7 @@ fragment float4 fmain(VertToFrag vtf [[ stage_in ]], float frontX = modf((1.0 - zFrontfaceTex.sample(samp, vtf.uv).r) * linScale, frontY); float backX = modf((1.0 - zBackfaceTex.sample(samp, vtf.uv).r) * linScale, backY); const float uvBias = 0.5 / 256.0; - float frontLin = zLinearizer.sample(samp, float2(frontX * 255.0 / 256.0 + uvBias, frontY / 256.0 + uvBias)).r; - float backLin = zLinearizer.sample(samp, float2(backX * 255.0 / 256.0 + uvBias, backY / 256.0 + uvBias)).r; + float frontLin = zLinearizer.sample(zLinearizerSamp, float2(frontX * 255.0 / 256.0 + uvBias, frontY / 256.0 + uvBias)).r; + float backLin = zLinearizer.sample(zLinearizerSamp, float2(backX * 255.0 / 256.0 + uvBias, backY / 256.0 + uvBias)).r; return float4(vtf.color.rgb, (frontLin - backLin) * 10.0); } diff --git a/Shaders/shader_CFluidPlaneShaderMetal.cpp b/Shaders/shader_CFluidPlaneShaderMetal.cpp index d740ab96c..5fb8e9476 100644 --- a/Shaders/shader_CFluidPlaneShaderMetal.cpp +++ b/Shaders/shader_CFluidPlaneShaderMetal.cpp @@ -551,7 +551,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) // ZERO, TEX, ONE, C0 // Output reg 0, subtract, clamp, no bias - combiner += " float3 lightVec = lights[3].pos.xyz - vtf.mvPos.xyz;\n" + combiner += " float3 lightVec = lu.lights[3].pos.xyz - vtf.mvPos.xyz;\n" " float lx = dot(vtf.mvTangent.xyz, lightVec);\n" " float ly = dot(vtf.mvBinorm.xyz, lightVec);\n"; combiner += hecl::Format(" float4 emboss1 = bumpMap.sample(samp, vtf.uv%d) + float4(0.5);\n" @@ -648,9 +648,6 @@ static std::string _BuildAdditionalTCGs(const SFluidPlaneShaderInfo& info) static std::string _BuildVS(const SFluidPlaneShaderInfo& info, bool tessellation) { - if (tessellation) - return TessCS; - std::string additionalTCGs = _BuildAdditionalTCGs(info); char *finalVSs; @@ -673,6 +670,13 @@ std::string StageObject_CFluidPlaneShader +std::string StageObject_CFluidPlaneShader::BuildShader + (const SFluidPlaneShaderInfo& in, bool tessellation) +{ + return TessCS; +} + static std::string BuildES(const SFluidPlaneShaderInfo& info) { int nextTex = 0; @@ -700,6 +704,7 @@ static std::string BuildES(const SFluidPlaneShaderInfo& info) return ret; } + template <> std::string StageObject_CFluidPlaneShader::BuildShader (const SFluidPlaneShaderInfo& in, bool tessellation) diff --git a/hecl b/hecl index 2ffa49b86..0d7f6d7f5 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 2ffa49b8667479c6a5db31d41889d0452183a83b +Subproject commit 0d7f6d7f5b5fba3ec79abaa754ed589b3705763a diff --git a/kabufuda b/kabufuda index bd1c3e99f..a1e224269 160000 --- a/kabufuda +++ b/kabufuda @@ -1 +1 @@ -Subproject commit bd1c3e99f2690f2b7e9543a053661f17dacfd757 +Subproject commit a1e224269104af52add34a737e41d1b56727e142