Ensure shader extension textures don't conflict

This commit is contained in:
Jack Andersen 2017-03-05 13:00:37 -10:00
parent b30381a5fd
commit 437fd54400
4 changed files with 12 additions and 12 deletions

2
hecl/extern/boo vendored

@ -1 +1 @@
Subproject commit 03f155fcf5ba4c79fa7537084a51a04da5bdbfdf
Subproject commit a547eb9dbb0a986f29d4a2d8072a858f3e98a100

View File

@ -270,7 +270,7 @@ std::string GLSL::makeFrag(const char* glslVer, bool alphaTest,
for (int i=0 ; i<extTexCount ; ++i)
{
const TextureInfo& extTex = extTexs[i];
texMapDecl += hecl::Format("TBINDING%u uniform sampler2D tex%u;\n",
texMapDecl += hecl::Format("TBINDING%u uniform sampler2D extTex%u;\n",
extTex.mapIdx, extTex.mapIdx);
}
@ -552,7 +552,7 @@ struct SPIRVBackendFactory : IShaderBackendFactory
objOut =
static_cast<boo::VulkanDataFactory::Context&>(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<boo::VulkanDataFactory::Context&>(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<boo::VulkanDataFactory::Context&>(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<boo::VulkanDataFactory::Context&>(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),

View File

@ -317,7 +317,7 @@ struct HLSLBackendFactory : IShaderBackendFactory
objOut =
static_cast<boo::ID3DDataFactory::Context&>(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<boo::ID3DDataFactory::Context&>(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<boo::ID3DDataFactory::Context&>(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<boo::ID3DDataFactory::Context&>(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),

View File

@ -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<float> tex%u [[ texture(%u) ]]", extTex.mapIdx, extTex.mapIdx);
extTexCall += hecl::Format("extTex%u", extTex.mapIdx);
texMapDecl += hecl::Format(",\ntexture2d<float> extTex%u [[ texture(%u) ]]", extTex.mapIdx, extTex.mapIdx);
}
std::string blockCall;