Closed
Bug 1207288
Opened 9 years ago
Closed 9 years ago
Enable the ANGLE shader validator for WebGL 2
Categories
(Core :: Graphics: CanvasWebGL, defect)
Core
Graphics: CanvasWebGL
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: jrmuizel, Unassigned)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(2 files, 2 obsolete files)
1000 bytes,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
9.76 KB,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Comment 1•9 years ago
|
||
Reporter | ||
Comment 2•9 years ago
|
||
It looks like the teleporter demo doesn't agree with the ANGLE 2466. It might be because of dynamic array indexing. Newer ANGLE seems like it might handle this better.
Updated•9 years ago
|
Whiteboard: [gfx-noted]
Reporter | ||
Comment 4•9 years ago
|
||
(In reply to Dan Glastonbury :djg :kamidphish from comment #3)
> I also did some work in this area when I first grabbed ANGLE.
Say more.
Flags: needinfo?(dglastonbury)
Patches are on my machine in Australia and I'm in Auckland. Will attach anything meaningful I have when I get home.
Flags: needinfo?(dglastonbury)
Reporter | ||
Comment 6•9 years ago
|
||
(In reply to Dan Glastonbury :djg :kamidphish from comment #5)
> Patches are on my machine in Australia and I'm in Auckland. Will attach
> anything meaningful I have when I get home.
Can you remember what any of them did so that work isn't duplicated?
Flags: needinfo?(dglastonbury)
From memory:
* Setup the input language depending on the shader
* Fix bugs in #version detection
* Select the `correct` target GLSL version depending on the version supported by driver
Flags: needinfo?(dglastonbury)
Reporter | ||
Updated•9 years ago
|
Attachment #8664413 -
Flags: review?(jgilbert)
Updated•9 years ago
|
Attachment #8664413 -
Flags: review?(jgilbert) → review+
Comment 9•9 years ago
|
||
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/01d6f8dc4daa - all the Windowses said https://treeherder.mozilla.org/logviewer.html#?job_id=15590480&repo=mozilla-inbound
Comment 10•9 years ago
|
||
Comment 11•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Comment 12•9 years ago
|
||
This patch configures the shader transpiler to output GLSL/ESSL
version that targets the version supported by GLContext.
Attachment #8675479 -
Flags: review?(jmuizelaar)
Attachment #8675479 -
Flags: review?(jgilbert)
Reporter | ||
Comment 13•9 years ago
|
||
Reporter | ||
Comment 14•9 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #13)
> Created attachment 8681005 [details] [diff] [review]
> My version of Dan's patch
It looks like I was wrong about the GLSL3.3 being sufficient. We should probably take something more like Dan's patch.
https://github.com/google/angle/blob/e623bd46a4145e5a25606c895ee4d031e6ba9325/src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp#L47
Reporter | ||
Comment 15•9 years ago
|
||
It's worth noting that GL_ARB_shading_language_packing is the extension associated with these functions. However, ANGLE doesn't seem that well set up to support GLSL3.3+GL_ARB_shading_language_packing
Comment 16•9 years ago
|
||
Comment on attachment 8675479 [details] [diff] [review]
Use Angle shader transpiler.
Review of attachment 8675479 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/canvas/WebGLShaderValidator.cpp
@@ +100,5 @@
> + return SH_ESSL_OUTPUT;
> +
> + uint32_t version = gl->ShadingLanguageVersion();
> + switch (version) {
> + case 100: return SH_ESSL_OUTPUT;
Surely ES3 returns 300+ here?
@@ +114,5 @@
> + case 440: return SH_GLSL_440_CORE_OUTPUT;
> + case 450: return SH_GLSL_450_CORE_OUTPUT;
> + default:
> + MOZ_CRASH("Unexpected GLSL version.");
> + }
It seems that ideal this would be:
if (isESSL) {
return SH_ESSL_OUTPUT; // Is there a SH_ESSL_300_OUTPUT?
} else {
// big old switch for GLSL versions
}
::: gfx/gl/GLContext.cpp
@@ +177,5 @@
> "GL_OES_vertex_array_object"
> };
>
> static bool
> +ParseGLSLVersion(GLContext* gl, uint32_t* out_version)
Also return whether or not this is ES or GL.
@@ +186,5 @@
> + }
> +
> + /**
> + * OpenGL 2.x, 3.x, 4.x specifications:
> + * The VERSION and SHADING_LANGUAGE_VERSION strings are laid out as follows:
More string parsing. Goodie.
@@ +224,5 @@
> + return false;
> + }
> +
> + const char kGLESVersionPrefix[] = "OpenGL ES ";
> + if (strncmp(versionString, kGLESVersionPrefix, strlen(kGLESVersionPrefix)) == 0)
s/strlen/ArrayLength/
Attachment #8675479 -
Flags: review?(jgilbert) → review-
Reporter | ||
Comment 17•9 years ago
|
||
Comment on attachment 8675479 [details] [diff] [review]
Use Angle shader transpiler.
Review of attachment 8675479 [details] [diff] [review]:
-----------------------------------------------------------------
Perhaps consider using mozilla::Tokenizer for the version string parsing instead of open coding it?
Reporter | ||
Comment 18•9 years ago
|
||
(In reply to Jeff Gilbert [:jgilbert] from comment #16)
>
> @@ +224,5 @@
> > + return false;
> > + }
> > +
> > + const char kGLESVersionPrefix[] = "OpenGL ES ";
> > + if (strncmp(versionString, kGLESVersionPrefix, strlen(kGLESVersionPrefix)) == 0)
>
> s/strlen/ArrayLength/
Why?
Reporter | ||
Comment 19•9 years ago
|
||
(In reply to Jeff Gilbert [:jgilbert] from comment #16)
> > static bool
> > +ParseGLSLVersion(GLContext* gl, uint32_t* out_version)
>
> Also return whether or not this is ES or GL.
Why?
Reporter | ||
Comment 20•9 years ago
|
||
I didn't understand the review comment that I didn't address.
Attachment #8675479 -
Attachment is obsolete: true
Attachment #8681005 -
Attachment is obsolete: true
Attachment #8675479 -
Flags: review?(jmuizelaar)
Attachment #8693246 -
Flags: review?(jgilbert)
Reporter | ||
Comment 21•9 years ago
|
||
This is currently failing on try with:
Assertion failure: false (glGetString(GL_SHADING_LANGUAGE_VERSION) has returned 0)
Comment 22•9 years ago
|
||
Comment on attachment 8693246 [details] [diff] [review]
Dan's patch with some of the review comments addressed.
Review of attachment 8693246 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/gl/GLContext.cpp
@@ +611,3 @@
> if (ShouldSpew()) {
> printf_stderr("OpenGL version detected: %u\n", version);
> + printf_stderr("OpenGL shading language version detected: %u\n", shadingLangVersion);
I would prefer we display "...shading language version NOT detected..." if ParseGLSLVersion fails.
@@ +619,5 @@
> mVersion = version;
> }
> +
> + if (shadingLangVersion >= mShadingLanguageVersion) {
> + mShadingLanguageVersion = shadingLangVersion;
Why is this added, but shadingLangVersion starts at 100?
Attachment #8693246 -
Flags: review?(jgilbert) → review+
Comment 23•9 years ago
|
||
Comment 24•9 years ago
|
||
Comment 25•9 years ago
|
||
Comment 26•9 years ago
|
||
bugherder |
You need to log in
before you can comment on or make changes to this bug.
Description
•