diff --git a/dom/canvas/WebGLProgram.cpp b/dom/canvas/WebGLProgram.cpp index 5b0166393806..3eaa295b2428 100644 --- a/dom/canvas/WebGLProgram.cpp +++ b/dom/canvas/WebGLProgram.cpp @@ -172,7 +172,7 @@ webgl::UniformInfo::UniformInfo(WebGLActiveInfo* activeInfo) ////////// -#define DUMP_SHADERVAR_MAPPINGS +//#define DUMP_SHADERVAR_MAPPINGS static already_AddRefed QueryProgramInfo(WebGLProgram* prog, gl::GLContext* gl) @@ -240,12 +240,22 @@ QueryProgramInfo(WebGLProgram* prog, gl::GLContext* gl) /////// - const GLint loc = gl->fGetAttribLocation(prog->mGLName, - mappedName.BeginReading()); + GLint loc = gl->fGetAttribLocation(prog->mGLName, + mappedName.BeginReading()); + if (gl->WorkAroundDriverBugs() && + mappedName.EqualsIgnoreCase("gl_", 3)) + { + // Catch when this is fixed, so we can remove this. + // Or, discover if this happens outside ANGLE. + MOZ_ASSERT(gl->IsANGLE() == (loc != -1)); + + loc = -1; + } #ifdef DUMP_SHADERVAR_MAPPINGS printf_stderr("[attrib %u/%u] @%i %s->%s\n", i, numActiveAttribs, loc, userName.BeginReading(), mappedName.BeginReading()); #endif + MOZ_ASSERT_IF(mappedName.EqualsIgnoreCase("gl_", 3), loc == -1); /////// diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/00_test_list.txt index c193d793b56c..c815d83d8430 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance2/00_test_list.txt +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/00_test_list.txt @@ -4,6 +4,7 @@ context/00_test_list.txt extensions/00_test_list.txt glsl3/00_test_list.txt misc/00_test_list.txt +programs/00_test_list.txt query/00_test_list.txt reading/00_test_list.txt renderbuffers/00_test_list.txt diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/programs/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/00_test_list.txt new file mode 100644 index 000000000000..8f3726fdd200 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/00_test_list.txt @@ -0,0 +1,2 @@ +active-built-in-attribs.html +gl-get-frag-data-location.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/programs/active-built-in-attribs.html b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/active-built-in-attribs.html new file mode 100644 index 000000000000..5818e2b3ae20 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/active-built-in-attribs.html @@ -0,0 +1,107 @@ + + + + + + +WebGL Conformance Tests: Verify validation for active built-in attribs + + + + + + +
+ +
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/programs/gl-get-frag-data-location.html b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/gl-get-frag-data-location.html new file mode 100644 index 000000000000..dba36e58c26d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/programs/gl-get-frag-data-location.html @@ -0,0 +1,121 @@ + + + + + + +WebGL Conformance Tests: Verify getFragDataLocation + + + + + + +
+ +
+ + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated-mochitest.ini b/dom/canvas/test/webgl-conf/generated-mochitest.ini index a0e7b274ba33..d56824949922 100644 --- a/dom/canvas/test/webgl-conf/generated-mochitest.ini +++ b/dom/canvas/test/webgl-conf/generated-mochitest.ini @@ -2457,6 +2457,9 @@ support-files = always-fail.html checkout/conformance2/misc/expando-loss-2.html checkout/conformance2/misc/instanceof-test.html checkout/conformance2/misc/uninitialized-test-2.html + checkout/conformance2/programs/00_test_list.txt + checkout/conformance2/programs/active-built-in-attribs.html + checkout/conformance2/programs/gl-get-frag-data-location.html checkout/conformance2/query/00_test_list.txt checkout/conformance2/query/occlusion-query.html checkout/conformance2/query/query.html @@ -4548,6 +4551,10 @@ skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5. skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) [generated/test_2_conformance2__misc__uninitialized-test-2.html] skip-if = (os == 'mac') || (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__programs__active-built-in-attribs.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) +[generated/test_2_conformance2__programs__gl-get-frag-data-location.html] +skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) [generated/test_2_conformance2__query__occlusion-query.html] skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1')) [generated/test_2_conformance2__query__query.html] diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__active-built-in-attribs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__active-built-in-attribs.html new file mode 100644 index 000000000000..bdc4599f94f8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__active-built-in-attribs.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__gl-get-frag-data-location.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__gl-get-frag-data-location.html new file mode 100644 index 000000000000..45aadacd087d --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__programs__gl-get-frag-data-location.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + +