Closed
Bug 1236785
Opened 9 years ago
Closed 8 years ago
[WebGL2] pass getTexParameter in gl-object-get-calls.html
Categories
(Core :: Graphics: CanvasWebGL, defect)
Core
Graphics: CanvasWebGL
Tracking
()
RESOLVED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: pchang, Assigned: jerry)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
mtseng
:
review+
|
Details | Diff | Splinter Review |
Test getTexParameter
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER) is gl.NEAREST
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER) is gl.NEAREST
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S) is gl.CLAMP_TO_EDGE
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T) is gl.CLAMP_TO_EDGE
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_BASE_LEVEL) is 0
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC) is gl.LEQUAL
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE) is gl.COMPARE_REF_TO_TEXTURE
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MAX_LEVEL) is 10
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MAX_LOD) is 10
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MIN_LOD) is 0
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_R) is gl.CLAMP_TO_EDGE
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_IMMUTABLE_FORMAT) is false
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_IMMUTABLE_LEVELS) is 0
FAIL getTexParameter returned 6403 instead of null for invalid parameter enum: 0x8e42
PASS getTexParameter correctly handled invalid target enums
FAIL getError expected: NO_ERROR. Was INVALID_ENUM :
Reporter | ||
Comment 1•9 years ago
|
||
After checking, the fail is caused by TEXTURE_IMMUTABLE_LEVELS is not supported in OpenGL 4.1 which is used on OSX now. But this test could be passed in ubuntu.
The things we could fix here is to return invalild enum number for GetTexParameters instead of MOZ_CRASH in [1].
[1]https://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLTexture.cpp#780
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → howareyou322
Reporter | ||
Comment 2•9 years ago
|
||
BTW, I got the same error with chrome.
Reporter | ||
Comment 3•9 years ago
|
||
(In reply to peter chang[:pchang][:peter] from comment #1)
> After checking, the fail is caused by TEXTURE_IMMUTABLE_LEVELS is not
> supported in OpenGL 4.1 which is used on OSX now. But this test could be
> passed in ubuntu.
>
> The things we could fix here is to return invalild enum number for
> GetTexParameters instead of MOZ_CRASH in [1].
>
> [1]https://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLTexture.
> cpp#780
After checking, I'm wrong with above comment. And there is nothing I can do for this bug right now. Change to work for me now.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
Comment 4•8 years ago
|
||
While running gl-object-get-calls.html for WebGL 2, it will trigger MOZ_CRASH("Unexpected error with MOZ_GL_DEBUG_ABORT_ON_ERROR. (Run"" with MOZ_GL_DEBUG_ABORT_ON_ERROR=0 to disable)");
that uses GL_TEXTURE_IMMUTABLE_LEVELS on WebGLTexture::GetTexParameter().
I have confirmed it would happen on Win10, Mac OSX debug build.
Updated•8 years ago
|
Flags: needinfo?(howareyou322)
Assignee | ||
Comment 5•8 years ago
|
||
I also can get the moz_crash for TEXTURE_IMMUTABLE_LEVELS.
From:
https://www.opengl.org/registry/specs/ARB/texture_view.txt
TEXTURE_IMMUTABLE_LEVELS is supported OpenGL 4.2
Mac 10.11 is only 4.1.
But I think we still can emulate the behavior in 4.1
Assignee: howareyou322 → hshih
Status: RESOLVED → REOPENED
Flags: needinfo?(howareyou322)
Resolution: WORKSFORME → ---
Assignee | ||
Comment 6•8 years ago
|
||
Attachment #8775464 -
Flags: review?(jgilbert)
Assignee | ||
Comment 7•8 years ago
|
||
Comment on attachment 8775464 [details] [diff] [review]
return WebGLTexture cache value for GL_TEXTURE_IMMUTABLE_LEVELS. v1
Review of attachment 8775464 [details] [diff] [review]:
-----------------------------------------------------------------
Please check comment 5.
::: dom/canvas/WebGLTexture.cpp
@@ +810,2 @@
> switch (pname) {
> case LOCAL_GL_TEXTURE_MIN_FILTER:
Why don't we just return the cached value in this WebGLTexture object for all GetTexParameter() query?
Is the cached value inconsistent with the glContext?
Updated•8 years ago
|
Attachment #8775464 -
Flags: review?(jgilbert) → review+
Assignee | ||
Comment 8•8 years ago
|
||
In WebGLTexture::GetTexParameter()[1], most of gl_enums are available in WebGLTexture object. Why do we still go through the glContext? How about just return the cached value in WebGLTexture?
[1]
https://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLTexture.cpp?q=WebGLTexture%3A%3AGetTexParameter%28TexTarget+texTarget%2C+GLenum+pname%29&redirect_type=single#803
Flags: needinfo?(jgilbert)
Comment 9•8 years ago
|
||
(In reply to Jerry Shih[:jerry] (UTC+8) from comment #8)
> In WebGLTexture::GetTexParameter()[1], most of gl_enums are available in
> WebGLTexture object. Why do we still go through the glContext? How about
> just return the cached value in WebGLTexture?
>
> [1]
> https://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLTexture.
> cpp?q=WebGLTexture%3A%3AGetTexParameter%28TexTarget+texTarget%2C+GLenum+pname
> %29&redirect_type=single#803
We should return cached values if we have them. Originally we didn't have the cached values.
Flags: needinfo?(jgilbert)
Assignee | ||
Comment 10•8 years ago
|
||
return the cache value if we already have.
Attachment #8776520 -
Flags: review?(jgilbert)
Assignee | ||
Updated•8 years ago
|
Attachment #8775464 -
Attachment is obsolete: true
Assignee | ||
Comment 11•8 years ago
|
||
Comment on attachment 8776520 [details] [diff] [review]
return WebGLTexture cache value for GetTexParameter() call. v2
Review of attachment 8776520 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/canvas/WebGLTexture.cpp
@@ +1017,5 @@
>
> switch (pname) {
> case LOCAL_GL_TEXTURE_BASE_LEVEL:
> + if (mImmutable) {
> + intParam = ClampLevelBaseAndMax(intParam, false);
Clamp the intParam if we use immutable texture.
@@ +1024,5 @@
> break;
>
> case LOCAL_GL_TEXTURE_MAX_LEVEL:
> + if (mImmutable) {
> + intParam = ClampLevelBaseAndMax(intParam, true);
Clamp the intParam if we use immutable texture.
Comment 12•8 years ago
|
||
Comment on attachment 8776520 [details] [diff] [review]
return WebGLTexture cache value for GetTexParameter() call. v2
Review of attachment 8776520 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/canvas/WebGLTexture.cpp
@@ +32,5 @@
> return const_cast<T&>(x);
> }
>
> +uint32_t
> +WebGLTexture::ClampLevelBaseAndMax(uint32_t aLevel, bool aIsBase)
Remove these changes from this patch.
Attachment #8776520 -
Flags: review?(jgilbert) → review-
Assignee | ||
Comment 13•8 years ago
|
||
revert ClampLevelBaseAndMax() change.
Attachment #8777192 -
Flags: review?(jgilbert)
Assignee | ||
Updated•8 years ago
|
Attachment #8776520 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Attachment #8777192 -
Flags: review?(jgilbert) → review?(mtseng)
Comment 14•8 years ago
|
||
Comment on attachment 8777192 [details] [diff] [review]
return WebGLTexture cache value for GetTexParameter() call. v3
Review of attachment 8777192 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
Attachment #8777192 -
Flags: review?(mtseng) → review+
Assignee | ||
Comment 15•8 years ago
|
||
Please land the attachment 8777192 [details] [diff] [review] to m-c.
try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8a42ad4b16b8
Keywords: checkin-needed
Comment 16•8 years ago
|
||
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/48a734359ef2
return WebGLTexture cache value for GetTexParameter() call. r=mtseng
Keywords: checkin-needed
Comment 17•8 years ago
|
||
bugherder |
Status: REOPENED → RESOLVED
Closed: 9 years ago → 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in
before you can comment on or make changes to this bug.
Description
•