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 upFully implement WebGL 1.0 #10209
Fully implement WebGL 1.0 #10209
Comments
|
cc @dmarcos |
|
I will be working on implementing generateMipmap |
|
@ConnorGBrewster I opened #10226, let's discuss there :) |
|
I'd like to work on |
|
I'd like to work on all of the remaining uniform methods, if that's okay |
|
I'm looking at the stencil* functions. |
|
I'm taking a crack at |
|
Attempting
|
add is_shader and is_texture functions For servo/servo#10209 (comment) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/gleam/83) <!-- Reviewable:end -->
add is_shader and is_texture commands For ` Implement isShader `and `Implement isTexture` in servo/servo#10209 (comment)
|
I would like to help |
|
@daoshengmu: sounds great! @danlrobertson, are you still working on |
|
@danlrobertson Sorry for I didn't notice you are working on |
|
@daoshengmu No problem! It's totally okay! It's my bad for taking so long to get a PR in, but alas life happens Are you okay with taking |
|
@danlrobertson Sure. I will take |
Impl copyTexImage2D and copyTexSubImage2D Thank you for contributing to Servo! Please add an `X` inside each `[ ]` when the step is complete, and replace `__` with appropriate data: - [X] `./mach build` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). Either: - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. Implement copyTexImage2D and copyTexSubImage2D for WebGLRenderingContext. Feedback would be appreciated. I did my best to follow the [spec](https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8). Please let me know if I missed anything. As always any feedback, comments,or critiques are very welcome😄 Part of #10209 <!-- 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/11147) <!-- Reviewable:end -->
Add glGetTexParameter Needed for servo/servo#10209. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/gleam/142) <!-- Reviewable:end -->
Add WebGL function glGetTexParameter <!-- Please describe your changes on the following line: --> Add WebGL function glGetTexParameter --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #10209 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20144) <!-- Reviewable:end -->
Add WebGL function glGetTexParameter <!-- Please describe your changes on the following line: --> Add WebGL function glGetTexParameter --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #10209 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20144) <!-- Reviewable:end -->
Add WebGL function glGetTexParameter <!-- Please describe your changes on the following line: --> Add WebGL function glGetTexParameter --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #10209 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20144) <!-- Reviewable:end -->
Add WebGL function glGetTexParameter <!-- Please describe your changes on the following line: --> Add WebGL function glGetTexParameter --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #10209 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20144) <!-- Reviewable:end -->
|
Working on |
…er, r=<try> Implement WebGL getFrameBufferAttachmentParameter API <!-- Please describe your changes on the following line: --> Implementation of `getFramebufferAttachmentParameter` as in WebGL1 specification. Part of #10209. r? emilio or jdm. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20317) <!-- Reviewable:end -->
…er, r=emilio Implement WebGL getFrameBufferAttachmentParameter API <!-- Please describe your changes on the following line: --> Implementation of `getFramebufferAttachmentParameter` as in WebGL1 specification. Part of #10209. r? emilio or jdm. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20317) <!-- Reviewable:end -->
…er, r=jdm Implement WebGL getFrameBufferAttachmentParameter API <!-- Please describe your changes on the following line: --> Implementation of `getFramebufferAttachmentParameter` as in WebGL1 specification. Part of #10209. r? emilio or jdm. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20317) <!-- Reviewable:end -->
…er, r=jdm Implement WebGL getFrameBufferAttachmentParameter API <!-- Please describe your changes on the following line: --> Implementation of `getFramebufferAttachmentParameter` as in WebGL1 specification. Part of #10209. r? emilio or jdm. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20317) <!-- Reviewable:end -->
…er API (from gootorov:webgl-getFramebufferAttachmentParameter); r=jdm <!-- Please describe your changes on the following line: --> Implementation of `getFramebufferAttachmentParameter` as in WebGL1 specification. Part of servo/servo#10209. r? emilio or jdm. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 4aaac61a87f4e45e46d0591be73ce108e562c33f --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : e73752c3c2074239d5db1a9fec8ea4d64eb572ef
|
I'd like to do |
|
This issue no longer seems to be keeping a record of edits anymore for some reason. Edit: It looks to be working now. |
|
I added a bunch of issues. |
Add initial support for WebGL compressed textures This patch is an initial implementation of WebGL compressed texture support, it contains - functions for registering and querying compressed texture extensions - initial implementation of `CompressedTexImage2D` and `CompressedTexSubImage2D` and their parameter validation - implementation of S3TC (DXT1, DXT3, DXT5) and ETC1 extensions as examples What's still missing: - some of the parameter validation steps are missing - the pixel comparison tests fail for more complex cases (I'm probably missing something trivial at the GL calls) Related: #10209 and #20594 cc @jdm @zakorgy --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] Related issues: #10209, #20594 - [x] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23226) <!-- Reviewable:end -->
Add initial support for WebGL compressed textures This patch is an initial implementation of WebGL compressed texture support, it contains - functions for registering and querying compressed texture extensions - initial implementation of `CompressedTexImage2D` and `CompressedTexSubImage2D` and their parameter validation - implementation of S3TC (DXT1, DXT3, DXT5) and ETC1 extensions as examples What's still missing: - some of the parameter validation steps are missing - the pixel comparison tests fail for more complex cases (I'm probably missing something trivial at the GL calls) Related: #10209 and #20594 cc @jdm @zakorgy --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] Related issues: #10209, #20594 - [x] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23226) <!-- Reviewable:end -->
Add initial support for WebGL compressed textures This patch is an initial implementation of WebGL compressed texture support, it contains - functions for registering and querying compressed texture extensions - initial implementation of `CompressedTexImage2D` and `CompressedTexSubImage2D` and their parameter validation - implementation of S3TC (DXT1, DXT3, DXT5) and ETC1 extensions as examples What's still missing: - some of the parameter validation steps are missing - the pixel comparison tests fail for more complex cases (I'm probably missing something trivial at the GL calls) Related: #10209 and #20594 cc @jdm @zakorgy --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] Related issues: #10209, #20594 - [x] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23226) <!-- Reviewable:end -->
Add initial support for WebGL compressed textures This patch is an initial implementation of WebGL compressed texture support, it contains - functions for registering and querying compressed texture extensions - initial implementation of `CompressedTexImage2D` and `CompressedTexSubImage2D` and their parameter validation - implementation of S3TC (DXT1, DXT3, DXT5) and ETC1 extensions as examples What's still missing: - some of the parameter validation steps are missing - the pixel comparison tests fail for more complex cases (I'm probably missing something trivial at the GL calls) Related: #10209 and #20594 cc @jdm @zakorgy --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] Related issues: #10209, #20594 - [x] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23226) <!-- Reviewable:end -->
…er API (from gootorov:webgl-getFramebufferAttachmentParameter); r=jdm <!-- Please describe your changes on the following line: --> Implementation of `getFramebufferAttachmentParameter` as in WebGL1 specification. Part of servo/servo#10209. r? emilio or jdm. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 4aaac61a87f4e45e46d0591be73ce108e562c33f UltraBlame original commit: 09f496975981051ad17639ee00242998598149d5
…er API (from gootorov:webgl-getFramebufferAttachmentParameter); r=jdm <!-- Please describe your changes on the following line: --> Implementation of `getFramebufferAttachmentParameter` as in WebGL1 specification. Part of servo/servo#10209. r? emilio or jdm. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 4aaac61a87f4e45e46d0591be73ce108e562c33f UltraBlame original commit: 09f496975981051ad17639ee00242998598149d5
…er API (from gootorov:webgl-getFramebufferAttachmentParameter); r=jdm <!-- Please describe your changes on the following line: --> Implementation of `getFramebufferAttachmentParameter` as in WebGL1 specification. Part of servo/servo#10209. r? emilio or jdm. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 4aaac61a87f4e45e46d0591be73ce108e562c33f UltraBlame original commit: 09f496975981051ad17639ee00242998598149d5
This is intended to be a meta-bug.
Some of the remaining methods are blocked on #5014 (those that receiveArrayBufferVieworBufferDataSourceand have overrides), but some others can be implemented without problems.I'll try to file individual issues for each remaining deficiency, since some of them can be
E-Easy.General information for WebGL bugs
Click to expand
Spec
The WebGL 1.0 spec is here.
GLES 2.0 spec
WebGL is based on the GLES 2.0 spec, so the WebGL spec often leverages details to it. You can find a PDF version here.
Current Code
DOM
The DOM side of the WebGL code can be found in the following files:
components/script/dom/webglrenderingcontext.rscomponents/script/dom/webglactiveinfo.rscomponents/script/dom/webglbuffer.rscomponents/script/dom/webglcontextevent.rscomponents/script/dom/webglframebuffer.rscomponents/script/dom/webglobject.rscomponents/script/dom/webglprogram.rscomponents/script/dom/webglrenderbuffer.rscomponents/script/dom/webglrenderingcontext.rscomponents/script/dom/webglshader.rscomponents/script/dom/webglshaderprecisionformat.rscomponents/script/dom/webgltexture.rscomponents/script/dom/webgluniformlocation.rsWebGL thread
The WebGL thread is the thread that receives the WebGL messages from the DOM, and either executes it or dispatchs it to the WebRender backend.
You probably don't need to touch anything here, but in case you want to take a look, the file is:
components/canvas/webgl_paint_thread.rsWebGL command definition, execution, and other types
The rest of the WebGL definitions and the command implementations are in
webrender_traits'swebgl.rsfile, in order to be shared by both Servo and WebRender.You'll want to take a look to the
WebGLCommanddefinition and to theapplyfunction.To work actively with it the best is to use a Cargo override.
Note that
WebGLCommandis re-exported fromcanvas_traitsasCanvasWebGLMessagefor legacy reasons (to avoid extra rebase pain while webrender hadn't merged yet).Missing safety checks
gl.shaderSource()(#21754)Pending implementations
antialiasing's WebGL context option (#21285)ImageBitmap(#20650)WebGLRenderingContext.bufferSubData(#20558)Other pending things and improvements
[AllowShared](#20515)drawingBufferWidth/drawingBufferHeightinWebGLRenderingContext(#20530)WebGLRenderingContext.getContextAttributes(#20532)WebGLRenderingContext.bufferData(#20557)[Throws]does not apply per-overload (#20516)Done stuff
WebGLRenderingContext.getProgramInfoLog(#20561)handle_object_deletionmay be wrong (#21352)WebGLRenderingContext.activeTexture(#20531)gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)(#20535)gl.getParameter(gl.BLEND_COLOR)(#20536)gl.getParameter(gl.COLOR_CLEAR_VALUE)(#20537)gl.getParameter(gl.COLOR_WRITEMASK)(#20538)gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS)(#20544)gl.getParameter(gl.DEPTH_RANGE)(#20545)gl.getParameter(gl.GENERATE_MIPMAP_HINT)(#20546)IMPLEMENTATION_COLOR_READ_FORMATandIMPLEMENTATION_COLOR_READ_TYPE(#20547)MAX_FRAGMENT_UNIFORM_VECTORSandMAX_VERTEX_UNIFORM_VECTORS(#20548)gl.getParameter(gl.MAX_VARYING_VECTORS)(#20549)SCISSOR_TESTandSCISSOR_BOX(#20551)gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL)(#20552)gl.getParameter(gl.UNPACK_FLIP_Y_WEBGL)(#20553)gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL)(#20554)WebGLRenderingContext.bindBufferchecks (#20556)gl.renderbufferStorage(#20563)WebGLRenderingContext.getFramebufferAttachmentParameter(#20593)WebGLRenderingContext.clear(#20623)GLclampfcorrectly (#20652)gl.getParameterand friends (#20655)renderbufferStorage(#13710)WebGLShaderdestructor frequently asserts when closing webgl pages (#21177)WebGLRenderingContexts in the same page.WebGLCommandasCanvasWebGLMessage(#10211)gl.getActiveAttribandgl.getActiveUniform(#20600)gl.getVertexAttribandgl.getVertexAttribOffset(#20608)gl-pointcoord.htmldoesn't draw anything (#21719)oes-texture-half-float.htmlpanics with a GL error when running in desktop mode (#21663)preserveDrawingBuffer's WebGL context option (#21132)