Closed
Bug 1237193
Opened 8 years ago
Closed 8 years ago
[WebGL2] pass getActiveUniforms in gl-object-get-calls.html
Categories
(Core :: Graphics: CanvasWebGL, defect)
Core
Graphics: CanvasWebGL
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: ethlin, Assigned: ethlin)
References
()
Details
Attachments
(1 file, 3 obsolete files)
Test getActiveUniforms PASS gl.getProgramParameter(program, gl.LINK_STATUS) is true PASS gl.getError() is gl.NO_ERROR FAIL typeof rowMajors[i] should be boolean. Was number. FAIL typeof rowMajors[i] should be boolean. Was number. FAIL typeof rowMajors[i] should be boolean. Was number. FAIL getActiveUniforms returned -454761244,-454761244,-454761244 instead of null for invalid pname enum: NO_ERROR
Assignee | ||
Comment 1•8 years ago
|
||
By spec [1], the getActiveUniforms return type will vary with different pname. So I change the return type to any and set correct gl error when the pname is not in the table. [1] https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16
Attachment #8704618 -
Flags: review?(jgilbert)
Comment 2•8 years ago
|
||
Comment on attachment 8704618 [details] [diff] [review] Fix getActiveUniforms return type Review of attachment 8704618 [details] [diff] [review]: ----------------------------------------------------------------- Does this JS look right? ::: dom/canvas/WebGL2Context.h @@ +360,5 @@ > void GetUniformIndices(WebGLProgram* program, > const dom::Sequence<nsString>& uniformNames, > dom::Nullable< nsTArray<GLuint> >& retval); > + void GetActiveUniforms(JSContext* cx, > + WebGLProgram* program, Fix the indents here. ::: dom/canvas/WebGLContext.h @@ +1287,5 @@ > uint32_t* const out_width, uint32_t* const out_height); > > bool ValidateQueryEnum(GLenum pname, const char* info); > > + bool ValidateUniformEnum(GLenum pname, const char* info); Why does this need to be a member of WebGLContext, and not just a static that takes a WebGLContext?
Attachment #8704618 -
Flags: review?(jgilbert)
Attachment #8704618 -
Flags: review?(efaustbmo)
Attachment #8704618 -
Flags: review+
Comment 3•8 years ago
|
||
Comment on attachment 8704618 [details] [diff] [review] Fix getActiveUniforms return type Review of attachment 8704618 [details] [diff] [review]: ----------------------------------------------------------------- All the JSAPI stuff looks fine to me.
Attachment #8704618 -
Flags: review?(efaustbmo) → review+
Assignee | ||
Comment 4•8 years ago
|
||
Comment on attachment 8704618 [details] [diff] [review] Fix getActiveUniforms return type Review of attachment 8704618 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/canvas/WebGL2Context.h @@ +360,5 @@ > void GetUniformIndices(WebGLProgram* program, > const dom::Sequence<nsString>& uniformNames, > dom::Nullable< nsTArray<GLuint> >& retval); > + void GetActiveUniforms(JSContext* cx, > + WebGLProgram* program, Okay. ::: dom/canvas/WebGLContext.h @@ +1287,5 @@ > uint32_t* const out_width, uint32_t* const out_height); > > bool ValidateQueryEnum(GLenum pname, const char* info); > > + bool ValidateUniformEnum(GLenum pname, const char* info); Originally I thought it's some kind of rule to put all ValidateSomething here. I will move this to WebGL2ContextUniforms.cpp as a static function.
Assignee | ||
Comment 5•8 years ago
|
||
apply jgilbert's comments.
Attachment #8704618 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 6•8 years ago
|
||
try server result: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6ad28c837a74
Updated•8 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 8•8 years ago
|
||
Comment on attachment 8705487 [details] [diff] [review] Fix getActiveUniforms return type (carry r+: jgilbert)(carry r+: efaust) Could you help review WebIDL changes? Thanks.
Flags: needinfo?(ethlin)
Attachment #8705487 -
Flags: review?(bugs)
Comment 9•8 years ago
|
||
Comment on attachment 8705487 [details] [diff] [review] Fix getActiveUniforms return type (carry r+: jgilbert)(carry r+: efaust) >+ JS::Rooted<JSObject*> array(cx, JS_NewArrayObject(cx, count)); >+ if (!array) { >+ return; >+ } >+ >+ switch (pname) { >+ case LOCAL_GL_UNIFORM_TYPE: >+ case LOCAL_GL_UNIFORM_SIZE: >+ case LOCAL_GL_UNIFORM_BLOCK_INDEX: >+ case LOCAL_GL_UNIFORM_OFFSET: >+ case LOCAL_GL_UNIFORM_ARRAY_STRIDE: >+ case LOCAL_GL_UNIFORM_MATRIX_STRIDE: >+ for (uint32_t i = 0; i < count; ++i) { >+ JS::RootedValue value(cx); >+ value = JS::Int32Value(samples[i]); >+ if (!JS_DefineElement(cx, array, i, value, JSPROP_ENUMERATE)) { >+ return; >+ } >+ } >+ break; >+ case LOCAL_GL_UNIFORM_IS_ROW_MAJOR: >+ for (uint32_t i = 0; i < count; ++i) { >+ JS::RootedValue value(cx); >+ value = JS::BooleanValue(samples[i]); >+ if (!JS_DefineElement(cx, array, i, value, JSPROP_ENUMERATE)) { >+ return; >+ } Sad to see so much JSAPI usage here. But I guess ToJSValue wouldn't have worked here since samples contains different type of values than what LOCAL_GL_UNIFORM_IS_ROW_MAJOR expects for the js array. r+ to the .webidl
Attachment #8705487 -
Flags: review?(bugs) → review+
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 10•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b7d242697573
Keywords: checkin-needed
Comment 11•8 years ago
|
||
caused bustage like https://treeherder.mozilla.org/logviewer.html#?job_id=20551706&repo=mozilla-inbound and so got backedout
Flags: needinfo?(ethlin)
Comment 12•8 years ago
|
||
Backout: https://hg.mozilla.org/integration/mozilla-inbound/rev/2f509b7156c7
Assignee | ||
Comment 13•8 years ago
|
||
Fix the warning problem.
Attachment #8705487 -
Attachment is obsolete: true
Flags: needinfo?(ethlin)
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 14•8 years ago
|
||
try server: https://treeherder.mozilla.org/#/jobs?repo=try&revision=37e3163614e4
Assignee | ||
Comment 15•8 years ago
|
||
Transfer the patch to hg format.
Attachment #8719387 -
Attachment is obsolete: true
Comment 16•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a3f46ba96f95
Keywords: checkin-needed
Comment 17•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a3f46ba96f95
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•