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)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: pchang, Assigned: jerry)

References

Details

Attachments

(1 file, 2 obsolete files)

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 :
Blocks: 1236394
Depends on: 1233353
No longer depends on: 1233353
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
Assignee: nobody → howareyou322
BTW, I got the same error with chrome.
(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
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.
Flags: needinfo?(howareyou322)
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 → ---
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?
Attachment #8775464 - Flags: review?(jgilbert) → review+
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)
(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)
return the cache value if we already have.
Attachment #8776520 - Flags: review?(jgilbert)
Attachment #8775464 - Attachment is obsolete: true
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 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-
revert ClampLevelBaseAndMax() change.
Attachment #8777192 - Flags: review?(jgilbert)
Attachment #8776520 - Attachment is obsolete: true
Attachment #8777192 - Flags: review?(jgilbert) → review?(mtseng)
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+
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
Status: REOPENED → RESOLVED
Closed: 9 years ago8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: