Commit e25ff9d8 by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Fix qualifiers for varyings

`out` variables in the vertex shader and `in` variables in the fragment shader were not decorated with `layout(location=?)` as they should according to the Vulkan GLSL spec. This change makes sure these decorations are present regardless of whether the compiler sees these variables as EvqVaryingIn/Out or EvqVertexOut/FragmentIn. Bug: angleproject:3412 Change-Id: I66473e876cb989a60b0c6d6a5850a8b2c763d8e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1590694 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 58957f3d
......@@ -84,8 +84,7 @@ void TOutputVulkanGLSL::writeLayoutQualifier(TIntermTyped *variable)
void TOutputVulkanGLSL::writeQualifier(TQualifier qualifier, const TSymbol *symbol)
{
if (qualifier != EvqUniform && qualifier != EvqVaryingIn && qualifier != EvqVaryingOut &&
qualifier != EvqAttribute)
if (qualifier != EvqUniform && qualifier != EvqAttribute && !sh::IsVarying(qualifier))
{
TOutputGLSLBase::writeQualifier(qualifier, symbol);
return;
......
......@@ -3522,9 +3522,6 @@ TEST_P(GLSLTest_ES3, ComplexVaryingStructsUsedInFragmentShader)
// Test that an inactive varying struct that doesn't get used in the fragment shader works.
TEST_P(GLSLTest_ES3, InactiveVaryingStructUnusedInFragmentShader)
{
// TODO(syoussefi): http://anglebug.com/3412
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kVS[] =
"#version 300 es\n"
"in vec4 inputAttribute;\n"
......
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