Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement GetVertexAttrib #10776
Implement GetVertexAttrib #10776
Conversation
highfive
commented
Apr 21, 2016
highfive
commented
Apr 21, 2016
73c724f
to
2d69bc7
|
@emilio Thoughts on storing the 0'th vertex attrib in WebGLContext vs webrender_traits? The context seems to be where the state is so it makes sense to track there i guess. Also some tests fail because it looks like VertexAttrib[1234]fv don't end up actually setting while VertexAttrib[1234]f do. Another thing we should track down. |
2fdd79b
to
dbf8915
|
@emilio ok should be ready for review :) |
|
@bors-servo try |
Implement GetVertexAttrib <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10776) <!-- Reviewable:end -->
| @@ -122,6 +122,8 @@ pub struct WebGLRenderingContext { | |||
| bound_buffer_array: MutNullableHeap<JS<WebGLBuffer>>, | |||
| bound_buffer_element_array: MutNullableHeap<JS<WebGLBuffer>>, | |||
| current_program: MutNullableHeap<JS<WebGLProgram>>, | |||
| #[ignore_heap_size_of = "Because it's small"] | |||
This comment has been minimized.
This comment has been minimized.
dzbarsky
Apr 27, 2016
Author
Member
this was a hack, we probably need to implement this somewhere right?
|
|
|
-S-awaiting-review +S-awaiting-answer Review status: 0 of 7 files reviewed at latest revision, 4 unresolved discussions. components/script/dom/webglrenderingcontext.rs, line 125 [r3] (raw file): Not a huge deal (it has heapsize zero), but worth having. components/script/dom/webglrenderingcontext.rs, line 1001 [r3] (raw file): components/script/dom/webglrenderingcontext.rs, line 1018 [r3] (raw file): This applies to other sites where we use it. tests/wpt/metadata/webgl/conformance-1.0.3/conformance/attribs/gl-vertex-attrib.html.ini, line 3 [r3] (raw file): Comments from Reviewable |
|
Review status: 0 of 7 files reviewed at latest revision, 4 unresolved discussions. components/script/dom/webglrenderingcontext.rs, line 125 [r3] (raw file): components/script/dom/webglrenderingcontext.rs, line 1001 [r3] (raw file): components/script/dom/webglrenderingcontext.rs, line 1018 [r3] (raw file): tests/wpt/metadata/webgl/conformance-1.0.3/conformance/attribs/gl-vertex-attrib.html.ini, line 3 [r3] (raw file): Comments from Reviewable |
|
Looks good to me given the situation with the failing tests, let me know if you want to implement the Is the Buffer per-vertex or not? Not quite sure... |
highfive
commented
May 13, 2016
|
New code was committed to pull request. |
highfive
commented
May 13, 2016
|
New code was committed to pull request. |
|
@emilio Let's land this and do VERTEX_ATTRIB_ARRAY_BUFFER_BINDING as a followup |
|
@bors-servo r=emilio since he said "otherwise this is good to land". @dzbarsky Please don't forget to do or file the follow-up. :) |
|
|
Implement GetVertexAttrib <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10776) <!-- Reviewable:end -->
|
|
highfive
commented
May 18, 2016
|
|
@bors-servo: retry |
Implement GetVertexAttrib <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10776) <!-- Reviewable:end -->
|
|
|
|
| @@ -83,6 +83,8 @@ pub struct WebGLRenderingContext { | |||
| bound_buffer_array: MutNullableHeap<JS<WebGLBuffer>>, | |||
| bound_buffer_element_array: MutNullableHeap<JS<WebGLBuffer>>, | |||
| current_program: MutNullableHeap<JS<WebGLProgram>>, | |||
| #[ignore_heap_size_of = "Because it's small"] | |||
| current_vertex_attrib_0: Cell<(f32, f32, f32, f32)>, | |||
This comment has been minimized.
This comment has been minimized.
nox
Jul 31, 2018
Member
@dzbarsky Do you remember why it's necessary to keep the value of vertex attrib 0 on the DOM side?
This comment has been minimized.
This comment has been minimized.
dzbarsky
Aug 2, 2018
Author
Member
When I first implemented this in 2bf016f GetVertexAttrib had a path to serve 0/CURRENT_VERTEX_ATTRIB from DOM side - I don't recall why I did this though...perhaps it was a fast path or something?
This comment has been minimized.
This comment has been minimized.
dzbarsky
Aug 2, 2018
Author
Member
Oh I see now that this is the original place we added it :) Most likely I was cargo-culting the pattern of retaining state like current_program, though this one was likely not necessary. Oops!
This comment has been minimized.
This comment has been minimized.
nox
Aug 2, 2018
Member
Seems like calling glGetVertexAttrib* with index 0 causes issues on some drivers.
dzbarsky commentedApr 21, 2016
This change is