Commit cb5441ed by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Don't let glslang link shaders

The translator outputs intermediate shaders for Vulkan that are later to be modified by the SPIR-V transformer. glslang has no business trying to link them. Bug: angleproject:5740 Change-Id: I9ae418f54b91312b5fd0ef794acbc46a40261a0e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2753096 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 50f411e1
...@@ -5103,8 +5103,6 @@ angle::Result GlslangGetShaderSpirvCode(const GlslangErrorCallback &callback, ...@@ -5103,8 +5103,6 @@ angle::Result GlslangGetShaderSpirvCode(const GlslangErrorCallback &callback,
{gl::ShaderType::Geometry, &geometryShader}, {gl::ShaderType::Geometry, &geometryShader},
{gl::ShaderType::Compute, &computeShader}, {gl::ShaderType::Compute, &computeShader},
}; };
glslang::TProgram program;
for (const gl::ShaderType shaderType : linkedShaderStages) for (const gl::ShaderType shaderType : linkedShaderStages)
{ {
if (shaderSources[shaderType].empty()) if (shaderSources[shaderType].empty())
...@@ -5112,18 +5110,12 @@ angle::Result GlslangGetShaderSpirvCode(const GlslangErrorCallback &callback, ...@@ -5112,18 +5110,12 @@ angle::Result GlslangGetShaderSpirvCode(const GlslangErrorCallback &callback,
continue; continue;
} }
glslang::TProgram program;
ANGLE_TRY(CompileShader(callback, builtInResources, shaderType, shaderSources[shaderType], ANGLE_TRY(CompileShader(callback, builtInResources, shaderType, shaderSources[shaderType],
shaders[shaderType], &program)); shaders[shaderType], &program));
}
ANGLE_TRY(LinkProgram(callback, &program)); ANGLE_TRY(LinkProgram(callback, &program));
for (const gl::ShaderType shaderType : linkedShaderStages)
{
if (shaderSources[shaderType].empty())
{
continue;
}
glslang::TIntermediate *intermediate = program.getIntermediate(kShLanguageMap[shaderType]); glslang::TIntermediate *intermediate = program.getIntermediate(kShLanguageMap[shaderType]);
glslang::GlslangToSpv(*intermediate, (*spirvBlobsOut)[shaderType]); glslang::GlslangToSpv(*intermediate, (*spirvBlobsOut)[shaderType]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment