2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-20 21:39:12 +00:00

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

Submodule hecl/extern/boo updated: 03f155fcf5...a547eb9dbb

View File

@@ -270,7 +270,7 @@ std::string GLSL::makeFrag(const char* glslVer, bool alphaTest,
for (int i=0 ; i<extTexCount ; ++i) for (int i=0 ; i<extTexCount ; ++i)
{ {
const TextureInfo& extTex = extTexs[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); extTex.mapIdx, extTex.mapIdx);
} }
@@ -552,7 +552,7 @@ struct SPIRVBackendFactory : IShaderBackendFactory
objOut = objOut =
static_cast<boo::VulkanDataFactory::Context&>(ctx). static_cast<boo::VulkanDataFactory::Context&>(ctx).
newShaderPipeline(vertSource.c_str(), fragSource.c_str(), 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), boo::BlendFactor(m_backend.m_blendSrc), boo::BlendFactor(m_backend.m_blendDst),
tag.getPrimType(), tag.getDepthTest(), tag.getDepthWrite(), tag.getPrimType(), tag.getDepthTest(), tag.getDepthWrite(),
tag.getBackfaceCulling()); tag.getBackfaceCulling());
@@ -629,7 +629,7 @@ struct SPIRVBackendFactory : IShaderBackendFactory
boo::IShaderPipeline* ret = boo::IShaderPipeline* ret =
static_cast<boo::VulkanDataFactory::Context&>(ctx). static_cast<boo::VulkanDataFactory::Context&>(ctx).
newShaderPipeline(nullptr, nullptr, newShaderPipeline(nullptr, nullptr,
vertBlob, fragBlob, pipelineBlob, &vertBlob, &fragBlob, &pipelineBlob,
tag.newVertexFormat(ctx), tag.newVertexFormat(ctx),
blendSrc, blendDst, tag.getPrimType(), blendSrc, blendDst, tag.getPrimType(),
tag.getDepthTest(), tag.getDepthWrite(), tag.getDepthTest(), tag.getDepthWrite(),
@@ -673,7 +673,7 @@ struct SPIRVBackendFactory : IShaderBackendFactory
boo::IShaderPipeline* ret = boo::IShaderPipeline* ret =
static_cast<boo::VulkanDataFactory::Context&>(ctx). static_cast<boo::VulkanDataFactory::Context&>(ctx).
newShaderPipeline(vertSource.c_str(), fragSource.c_str(), newShaderPipeline(vertSource.c_str(), fragSource.c_str(),
pipeBlob.vert, pipeBlob.frag, pipeBlob.pipeline, &pipeBlob.vert, &pipeBlob.frag, &pipeBlob.pipeline,
tag.newVertexFormat(ctx), tag.newVertexFormat(ctx),
boo::BlendFactor((slot.srcFactor == hecl::Backend::BlendFactor::Original) ? boo::BlendFactor((slot.srcFactor == hecl::Backend::BlendFactor::Original) ?
m_backend.m_blendSrc : slot.srcFactor), m_backend.m_blendSrc : slot.srcFactor),
@@ -766,7 +766,7 @@ struct SPIRVBackendFactory : IShaderBackendFactory
boo::IShaderPipeline* ret = boo::IShaderPipeline* ret =
static_cast<boo::VulkanDataFactory::Context&>(ctx). static_cast<boo::VulkanDataFactory::Context&>(ctx).
newShaderPipeline(nullptr, nullptr, newShaderPipeline(nullptr, nullptr,
vertBlob, fragBlob, pipelineBlob, &vertBlob, &fragBlob, &pipelineBlob,
tag.newVertexFormat(ctx), tag.newVertexFormat(ctx),
boo::BlendFactor((slot.srcFactor == hecl::Backend::BlendFactor::Original) ? blendSrc : slot.srcFactor), boo::BlendFactor((slot.srcFactor == hecl::Backend::BlendFactor::Original) ? blendSrc : slot.srcFactor),
boo::BlendFactor((slot.dstFactor == hecl::Backend::BlendFactor::Original) ? blendDst : slot.dstFactor), boo::BlendFactor((slot.dstFactor == hecl::Backend::BlendFactor::Original) ? blendDst : slot.dstFactor),

View File

@@ -317,7 +317,7 @@ struct HLSLBackendFactory : IShaderBackendFactory
objOut = objOut =
static_cast<boo::ID3DDataFactory::Context&>(ctx). static_cast<boo::ID3DDataFactory::Context&>(ctx).
newShaderPipeline(vertSource.c_str(), fragSource.c_str(), newShaderPipeline(vertSource.c_str(), fragSource.c_str(),
vertBlob, fragBlob, pipelineBlob, ReferenceComPtr(vertBlob), ReferenceComPtr(fragBlob), ReferenceComPtr(pipelineBlob),
tag.newVertexFormat(ctx), tag.newVertexFormat(ctx),
boo::BlendFactor(m_backend.m_blendSrc), boo::BlendFactor(m_backend.m_blendSrc),
boo::BlendFactor(m_backend.m_blendDst), boo::BlendFactor(m_backend.m_blendDst),
@@ -412,7 +412,7 @@ struct HLSLBackendFactory : IShaderBackendFactory
boo::IShaderPipeline* ret = boo::IShaderPipeline* ret =
static_cast<boo::ID3DDataFactory::Context&>(ctx). static_cast<boo::ID3DDataFactory::Context&>(ctx).
newShaderPipeline(nullptr, nullptr, newShaderPipeline(nullptr, nullptr,
vertBlob, fragBlob, pipelineBlob, ReferenceComPtr(vertBlob), ReferenceComPtr(fragBlob), ReferenceComPtr(pipelineBlob),
tag.newVertexFormat(ctx), tag.newVertexFormat(ctx),
blendSrc, blendDst, tag.getPrimType(), blendSrc, blendDst, tag.getPrimType(),
tag.getDepthTest(), tag.getDepthWrite(), tag.getDepthTest(), tag.getDepthWrite(),
@@ -454,7 +454,7 @@ struct HLSLBackendFactory : IShaderBackendFactory
boo::IShaderPipeline* ret = boo::IShaderPipeline* ret =
static_cast<boo::ID3DDataFactory::Context&>(ctx). static_cast<boo::ID3DDataFactory::Context&>(ctx).
newShaderPipeline(vertSource.c_str(), fragSource.c_str(), 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), tag.newVertexFormat(ctx),
boo::BlendFactor((slot.srcFactor == hecl::Backend::BlendFactor::Original) ? m_backend.m_blendSrc : slot.srcFactor), 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), boo::BlendFactor((slot.dstFactor == hecl::Backend::BlendFactor::Original) ? m_backend.m_blendDst : slot.dstFactor),
@@ -552,7 +552,7 @@ struct HLSLBackendFactory : IShaderBackendFactory
boo::IShaderPipeline* ret = boo::IShaderPipeline* ret =
static_cast<boo::ID3DDataFactory::Context&>(ctx). static_cast<boo::ID3DDataFactory::Context&>(ctx).
newShaderPipeline(nullptr, nullptr, newShaderPipeline(nullptr, nullptr,
vertBlob, fragBlob, pipelineBlob, ReferenceComPtr(vertBlob), ReferenceComPtr(fragBlob), ReferenceComPtr(pipelineBlob),
tag.newVertexFormat(ctx), tag.newVertexFormat(ctx),
boo::BlendFactor((slot.srcFactor == hecl::Backend::BlendFactor::Original) ? blendSrc : slot.srcFactor), boo::BlendFactor((slot.srcFactor == hecl::Backend::BlendFactor::Original) ? blendSrc : slot.srcFactor),
boo::BlendFactor((slot.dstFactor == hecl::Backend::BlendFactor::Original) ? blendDst : slot.dstFactor), 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]; const TextureInfo& extTex = extTexs[i];
if (extTexCall.size()) if (extTexCall.size())
extTexCall += ", "; extTexCall += ", ";
extTexCall += hecl::Format("tex%u", extTex.mapIdx); extTexCall += hecl::Format("extTex%u", extTex.mapIdx);
texMapDecl += hecl::Format(",\ntexture2d<float> tex%u [[ texture(%u) ]]", extTex.mapIdx, extTex.mapIdx); texMapDecl += hecl::Format(",\ntexture2d<float> extTex%u [[ texture(%u) ]]", extTex.mapIdx, extTex.mapIdx);
} }
std::string blockCall; std::string blockCall;