From 437fd54400e0f56a67dfe6380ca3626337867e88 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sun, 5 Mar 2017 13:00:37 -1000 Subject: [PATCH] Ensure shader extension textures don't conflict --- hecl/extern/boo | 2 +- hecl/lib/Backend/GLSL.cpp | 10 +++++----- hecl/lib/Backend/HLSL.cpp | 8 ++++---- hecl/lib/Backend/Metal.cpp | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hecl/extern/boo b/hecl/extern/boo index 03f155fcf..a547eb9db 160000 --- a/hecl/extern/boo +++ b/hecl/extern/boo @@ -1 +1 @@ -Subproject commit 03f155fcf5ba4c79fa7537084a51a04da5bdbfdf +Subproject commit a547eb9dbb0a986f29d4a2d8072a858f3e98a100 diff --git a/hecl/lib/Backend/GLSL.cpp b/hecl/lib/Backend/GLSL.cpp index 2484a7621..b07687bbd 100644 --- a/hecl/lib/Backend/GLSL.cpp +++ b/hecl/lib/Backend/GLSL.cpp @@ -270,7 +270,7 @@ std::string GLSL::makeFrag(const char* glslVer, bool alphaTest, for (int i=0 ; i(ctx). newShaderPipeline(vertSource.c_str(), fragSource.c_str(), - vertBlob, fragBlob, pipelineBlob, tag.newVertexFormat(ctx), + &vertBlob, &fragBlob, &pipelineBlob, tag.newVertexFormat(ctx), boo::BlendFactor(m_backend.m_blendSrc), boo::BlendFactor(m_backend.m_blendDst), tag.getPrimType(), tag.getDepthTest(), tag.getDepthWrite(), tag.getBackfaceCulling()); @@ -629,7 +629,7 @@ struct SPIRVBackendFactory : IShaderBackendFactory boo::IShaderPipeline* ret = static_cast(ctx). newShaderPipeline(nullptr, nullptr, - vertBlob, fragBlob, pipelineBlob, + &vertBlob, &fragBlob, &pipelineBlob, tag.newVertexFormat(ctx), blendSrc, blendDst, tag.getPrimType(), tag.getDepthTest(), tag.getDepthWrite(), @@ -673,7 +673,7 @@ struct SPIRVBackendFactory : IShaderBackendFactory boo::IShaderPipeline* ret = static_cast(ctx). newShaderPipeline(vertSource.c_str(), fragSource.c_str(), - pipeBlob.vert, pipeBlob.frag, pipeBlob.pipeline, + &pipeBlob.vert, &pipeBlob.frag, &pipeBlob.pipeline, tag.newVertexFormat(ctx), boo::BlendFactor((slot.srcFactor == hecl::Backend::BlendFactor::Original) ? m_backend.m_blendSrc : slot.srcFactor), @@ -766,7 +766,7 @@ struct SPIRVBackendFactory : IShaderBackendFactory boo::IShaderPipeline* ret = static_cast(ctx). newShaderPipeline(nullptr, nullptr, - vertBlob, fragBlob, pipelineBlob, + &vertBlob, &fragBlob, &pipelineBlob, tag.newVertexFormat(ctx), boo::BlendFactor((slot.srcFactor == hecl::Backend::BlendFactor::Original) ? blendSrc : slot.srcFactor), boo::BlendFactor((slot.dstFactor == hecl::Backend::BlendFactor::Original) ? blendDst : slot.dstFactor), diff --git a/hecl/lib/Backend/HLSL.cpp b/hecl/lib/Backend/HLSL.cpp index 4d6f78318..fd72ed623 100644 --- a/hecl/lib/Backend/HLSL.cpp +++ b/hecl/lib/Backend/HLSL.cpp @@ -317,7 +317,7 @@ struct HLSLBackendFactory : IShaderBackendFactory objOut = static_cast(ctx). newShaderPipeline(vertSource.c_str(), fragSource.c_str(), - vertBlob, fragBlob, pipelineBlob, + ReferenceComPtr(vertBlob), ReferenceComPtr(fragBlob), ReferenceComPtr(pipelineBlob), tag.newVertexFormat(ctx), boo::BlendFactor(m_backend.m_blendSrc), boo::BlendFactor(m_backend.m_blendDst), @@ -412,7 +412,7 @@ struct HLSLBackendFactory : IShaderBackendFactory boo::IShaderPipeline* ret = static_cast(ctx). newShaderPipeline(nullptr, nullptr, - vertBlob, fragBlob, pipelineBlob, + ReferenceComPtr(vertBlob), ReferenceComPtr(fragBlob), ReferenceComPtr(pipelineBlob), tag.newVertexFormat(ctx), blendSrc, blendDst, tag.getPrimType(), tag.getDepthTest(), tag.getDepthWrite(), @@ -454,7 +454,7 @@ struct HLSLBackendFactory : IShaderBackendFactory boo::IShaderPipeline* ret = static_cast(ctx). newShaderPipeline(vertSource.c_str(), fragSource.c_str(), - thisPipeBlobs.vert, thisPipeBlobs.frag, thisPipeBlobs.pipeline, + ReferenceComPtr(thisPipeBlobs.vert), ReferenceComPtr(thisPipeBlobs.frag), ReferenceComPtr(thisPipeBlobs.pipeline), tag.newVertexFormat(ctx), boo::BlendFactor((slot.srcFactor == hecl::Backend::BlendFactor::Original) ? m_backend.m_blendSrc : slot.srcFactor), boo::BlendFactor((slot.dstFactor == hecl::Backend::BlendFactor::Original) ? m_backend.m_blendDst : slot.dstFactor), @@ -552,7 +552,7 @@ struct HLSLBackendFactory : IShaderBackendFactory boo::IShaderPipeline* ret = static_cast(ctx). newShaderPipeline(nullptr, nullptr, - vertBlob, fragBlob, pipelineBlob, + ReferenceComPtr(vertBlob), ReferenceComPtr(fragBlob), ReferenceComPtr(pipelineBlob), tag.newVertexFormat(ctx), boo::BlendFactor((slot.srcFactor == hecl::Backend::BlendFactor::Original) ? blendSrc : slot.srcFactor), boo::BlendFactor((slot.dstFactor == hecl::Backend::BlendFactor::Original) ? blendDst : slot.dstFactor), diff --git a/hecl/lib/Backend/Metal.cpp b/hecl/lib/Backend/Metal.cpp index 1ead7c7aa..d9caae763 100644 --- a/hecl/lib/Backend/Metal.cpp +++ b/hecl/lib/Backend/Metal.cpp @@ -298,8 +298,8 @@ std::string Metal::makeFrag(size_t blockCount, const char** blockNames, bool alp const TextureInfo& extTex = extTexs[i]; if (extTexCall.size()) extTexCall += ", "; - extTexCall += hecl::Format("tex%u", extTex.mapIdx); - texMapDecl += hecl::Format(",\ntexture2d tex%u [[ texture(%u) ]]", extTex.mapIdx, extTex.mapIdx); + extTexCall += hecl::Format("extTex%u", extTex.mapIdx); + texMapDecl += hecl::Format(",\ntexture2d extTex%u [[ texture(%u) ]]", extTex.mapIdx, extTex.mapIdx); } std::string blockCall;