Update OpenGL ES 3.1 Shader Interface Matching

According to the OpenGL ES 3.1 spec Chapter 7.4.1 "Shader Interface
Matching" Page 91, an output variable is considered to match an
input variable in the subsequent shader if:

- the two variables match in name, type, and qualification; or
- the two variables are declared with the same location qualifier
  and match in type and qualification.

We currently only check the variable names, so this bug will add
checking the locations as well.

Bug: angleproject:3699
Test: dEQP, end2end
Change-Id: I45e91654450fd033299ff0a81bc26a23b3e25a04
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1700160
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
This commit is contained in:
Tim Van Patten
2019-07-15 09:24:01 -06:00
committed by Commit Bot
parent 9d943af7ce
commit f20605944e

View File

@@ -2944,7 +2944,7 @@ bool Program::linkVaryings(InfoLog &infoLog) const
return true;
}
// [OpenGL ES 3.1] Chapter 7.4.1 "Shader Interface Matchining" Page 91
// [OpenGL ES 3.1] Chapter 7.4.1 "Shader Interface Matching" Page 91
// TODO(jiawei.shao@intel.com): add validation on input/output blocks matching
bool Program::linkValidateShaderInterfaceMatching(gl::Shader *generatingShader,
gl::Shader *consumingShader,
@@ -2967,9 +2967,17 @@ bool Program::linkValidateShaderInterfaceMatching(gl::Shader *generatingShader,
continue;
}
// An output variable is considered to match an input variable in the subsequent
// shader if:
// - the two variables match in name, type, and qualification; or
// - the two variables are declared with the same location qualifier and
// match in type and qualification.
for (const sh::Varying &output : outputVaryings)
{
if (input.name == output.name)
bool namesMatch = input.name == output.name;
bool locationsMatch = (input.location != -1) && (input.location == output.location);
if (namesMatch || locationsMatch)
{
ASSERT(!output.isBuiltIn());