Bug 1725074 - Allow attribs with the same names as uniforms. r=gfx-reviewers,lsalzman

(and vice-versa)

Differential Revision: https://phabricator.services.mozilla.com/D133673
This commit is contained in:
Kelsey Gilbert 2021-12-13 20:42:30 +00:00
parent ae7a4611cf
commit b1a9bb84da
3 changed files with 1 additions and 31 deletions

View File

@ -1028,28 +1028,7 @@ bool WebGLProgram::ValidateAfterTentativeLink(
const auto& linkInfo = mMostRecentLinkInfo;
const auto& gl = mContext->gl;
// Check if the attrib name conflicting to uniform name
{
std::unordered_set<std::string> attribNames;
for (const auto& attrib : linkInfo->active.activeAttribs) {
attribNames.insert(attrib.name);
}
for (const auto& uniform : linkInfo->active.activeUniforms) {
auto name = uniform.name;
const auto maybe = webgl::ParseIndexed(name);
if (maybe) {
name = maybe->name;
}
if (attribNames.count(name)) {
*out_linkLog = nsPrintfCString(
"Attrib name conflicts with uniform name:"
" %s",
name.c_str())
.BeginReading();
return false;
}
}
}
// Check for overlapping attrib locations.
{
std::unordered_map<uint32_t, const std::string&> nameByLoc;
for (const auto& attrib : linkInfo->active.activeAttribs) {

View File

@ -8263,7 +8263,6 @@ subsuite = webgl2-ext
subsuite = webgl2-ext
[generated/test_2_conformance__glsl__misc__shaders-with-name-conflicts.html]
subsuite = webgl2-ext
fail-if = 1
[generated/test_2_conformance__glsl__misc__shaders-with-uniform-structs.html]
subsuite = webgl2-ext
[generated/test_2_conformance__glsl__misc__shaders-with-varyings.html]
@ -11711,7 +11710,6 @@ subsuite = webgl1-ext
subsuite = webgl1-ext
[generated/test_conformance__glsl__misc__shaders-with-name-conflicts.html]
subsuite = webgl1-ext
fail-if = 1
[generated/test_conformance__glsl__misc__shaders-with-uniform-structs.html]
subsuite = webgl1-ext
[generated/test_conformance__glsl__misc__shaders-with-varyings.html]

View File

@ -37,13 +37,6 @@ fail-if = 1
[generated/test_2_conformance__textures__misc__video-rotation.html]
# Ditto
fail-if = 1
[generated/test_conformance__glsl__misc__shaders-with-name-conflicts.html]
# https://bugzilla.mozilla.org/show_bug.cgi?id=1725074
# [unexpected link status] (expected: true) using the same name for a vertex shader attribute and fragment
fail-if = 1
[generated/test_2_conformance__glsl__misc__shaders-with-name-conflicts.html]
# Ditto
fail-if = 1
[generated/test_2_conformance2__extensions__webgl-multi-draw-instanced-base-vertex-base-instance.html]
# https://bugzilla.mozilla.org/show_bug.cgi?id=1725242
# E.g. vertid_prog: Expected [0,1,0,0], was [1,1,0,0]. desc: {"name":"drawArraysInstanced","base_vert":0,"vert_count":1,"base_inst":0,"inst_count":1,"first_vert":1}