Commit f2060594 by Tim Van Patten Committed by Commit Bot

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/+/1700160Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
parent 9d943af7
...@@ -2944,7 +2944,7 @@ bool Program::linkVaryings(InfoLog &infoLog) const ...@@ -2944,7 +2944,7 @@ bool Program::linkVaryings(InfoLog &infoLog) const
return true; 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 // TODO(jiawei.shao@intel.com): add validation on input/output blocks matching
bool Program::linkValidateShaderInterfaceMatching(gl::Shader *generatingShader, bool Program::linkValidateShaderInterfaceMatching(gl::Shader *generatingShader,
gl::Shader *consumingShader, gl::Shader *consumingShader,
...@@ -2967,9 +2967,17 @@ bool Program::linkValidateShaderInterfaceMatching(gl::Shader *generatingShader, ...@@ -2967,9 +2967,17 @@ bool Program::linkValidateShaderInterfaceMatching(gl::Shader *generatingShader,
continue; 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) 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()); ASSERT(!output.isBuiltIn());
......
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