diff --git a/hecl/lib/Backend/GLSL.cpp b/hecl/lib/Backend/GLSL.cpp index a65732c70..32ec3f589 100644 --- a/hecl/lib/Backend/GLSL.cpp +++ b/hecl/lib/Backend/GLSL.cpp @@ -510,7 +510,8 @@ struct SPIRVBackendFactory : IShaderBackendFactory tag.getColorCount(), tag.getUvCount(), tag.getWeightCount(), tag.getSkinSlotCount(), tag.getTexMtxCount(), 0, nullptr); - std::string fragSource = m_backend.makeFrag("#version 330"); + std::string fragSource = m_backend.makeFrag("#version 330", + tag.getDepthWrite() && m_backend.m_blendDst == hecl::Backend::BlendFactor::InvSrcAlpha); std::vector vertBlob; std::vector fragBlob; @@ -629,7 +630,9 @@ struct SPIRVBackendFactory : IShaderBackendFactory tag.getColorCount(), tag.getUvCount(), tag.getWeightCount(), tag.getSkinSlotCount(), tag.getTexMtxCount(), slot.texCount, slot.texs); - std::string fragSource = m_backend.makeFrag("#version 330", slot.lighting, slot.post, slot.texCount, slot.texs); + std::string fragSource = m_backend.makeFrag("#version 330", + tag.getDepthWrite() && m_backend.m_blendDst == hecl::Backend::BlendFactor::InvSrcAlpha, + slot.lighting, slot.post, slot.texCount, slot.texs); pipeBlobs.emplace_back(); Blobs& pipeBlob = pipeBlobs.back(); boo::IShaderPipeline* ret =