This is intended to be a meta-bug.
Some of the remaining methods are blocked on https://github.com/servo/servo/issues/5014 (those that receive ArrayBufferView
or BufferDataSource
and 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
.
Click to expand
The WebGL 1.0 spec is here.
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.
The DOM side of the WebGL code can be found in the following files:
components/script/dom/webglrenderingcontext.rs
components/script/dom/webglactiveinfo.rs
components/script/dom/webglbuffer.rs
components/script/dom/webglcontextevent.rs
components/script/dom/webglframebuffer.rs
components/script/dom/webglobject.rs
components/script/dom/webglprogram.rs
components/script/dom/webglrenderbuffer.rs
components/script/dom/webglrenderingcontext.rs
components/script/dom/webglshader.rs
components/script/dom/webglshaderprecisionformat.rs
components/script/dom/webgltexture.rs
components/script/dom/webgluniformlocation.rs
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.rs
The rest of the WebGL definitions and the command implementations are in webrender_traits
's webgl.rs
file, in order to be shared by both Servo and WebRender.
You'll want to take a look to the WebGLCommand
definition and to the apply
function.
To work actively with it the best is to use a Cargo override.
Note that WebGLCommand
is re-exported from canvas_traits
as CanvasWebGLMessage
for legacy reasons (to avoid extra rebase pain while webrender hadn't merged yet).
gl.shaderSource()
(#21754)antialiasing
's WebGL context option (#21285)ImageBitmap
(#20650)WebGLRenderingContext.bufferSubData
(#20558)[AllowShared]
(#20515)drawingBufferWidth
/drawingBufferHeight
in WebGLRenderingContext
(#20530)WebGLRenderingContext.getContextAttributes
(#20532)WebGLRenderingContext.bufferData
(#20557)[Throws]
does not apply per-overload (#20516)WebGLRenderingContext.getProgramInfoLog
(#20561)handle_object_deletion
may 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_FORMAT
and IMPLEMENTATION_COLOR_READ_TYPE
(#20547)MAX_FRAGMENT_UNIFORM_VECTORS
and MAX_VERTEX_UNIFORM_VECTORS
(#20548)gl.getParameter(gl.MAX_VARYING_VECTORS)
(#20549)SCISSOR_TEST
and SCISSOR_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.bindBuffer
checks (#20556)gl.renderbufferStorage
(#20563)WebGLRenderingContext.getFramebufferAttachmentParameter
(#20593)WebGLRenderingContext.clear
(#20623)GLclampf
correctly (#20652)gl.getParameter
and friends (#20655)renderbufferStorage
(#13710)WebGLShader
destructor frequently asserts when closing webgl pages (#21177)WebGLRenderingContext
s in the same page.WebGLCommand
as CanvasWebGLMessage
(https://github.com/servo/servo/issues/10211)gl.getActiveAttrib
and gl.getActiveUniform
(#20600)gl.getVertexAttrib
and gl.getVertexAttribOffset
(#20608)gl-pointcoord.html
doesn't draw anything (#21719)oes-texture-half-float.html
panics with a GL error when running in desktop mode (#21663)preserveDrawingBuffer
's WebGL context option (#21132)cc @dmarcos
I will be working on implementing generateMipmap
@ConnorGBrewster I opened https://github.com/servo/servo/issues/10226, let's discuss there :)
I'd like to work on getActiveUniform
@saurvs I opened https://github.com/servo/servo/issues/10397 for you, feel free to ask any question you might have there :)
I'd like to work on all of the remaining uniform methods, if that's okay
@autrilla They're yours! I've opened https://github.com/servo/servo/issues/10417 to keep track of them, feel free to leave any questions there :)
I'm looking at the stencil* functions.
I'm taking a crack at copyTex*
and texSubImage2D
Attempting
Implement isShader
Implement isTexture
I would like to help texSubImage2D
@daoshengmu: sounds great!
@danlrobertson, are you still working on texSubImage2D
?
@danlrobertson Sorry for I didn't notice you are working on texSubImage2D
. I just want to help some implementation of WebGL. If you are still working on it, I can pick copyTexImage2D
and copyTexSubImage2D
@emilio
@daoshengmu No problem! It's totally okay! It's my bad for taking so long to get a PR in, but alas life happens :smile:...
Are you okay with taking texSubImage2D
? I already implemented the necesary components in wr_traits. I should have a PR in shortly for copyTex*
, but I actually hadn't started on texSubImage2D
. If you want texSubImage2D
, go for it! I have no particular attachment to it. Just wanted to learn a bit about webgl code...
@danlrobertson Sure. I will take texSubImage2D
. Thanks! 😄
If it's okay I am going to work on
Implement isFramebuffer
and
Implement isRenderBuffer
@DDEFISHER go for it! Mind opening an issue for those so I can assign you there?
I am going to also work on isBuffer
since it is similar to the other 2
Please make a comment here if you intend to work on this issue. Thank you!
Separate issues for individual APIs are E-easy material; not this one.
Can anyone point to an E-easy(ish) implementation I can work on? Thanks :)
@ofekd isEnabled
might be a good choice, since enable
and disable
are already implemented!
@jdm I'll take it
@ofekd isEnabled might be tricky as a new contributor, because you need to change things across modules. Some of the testcases in webgl-specific.html
, like the blending func or stencil func ones, should be really good starting points. invalid-passed-params.html
likely also has good easy tasks.
@anholt As long as it's not significantly complicated I don't mind having to work some more. I didn't start working on this yet, but for starters it looks like I need to change:
webrender_traits/src/webgl.rs
servo/components/script/dom/webglrenderingcontext.rs
servo/components/script/dom/webidls/WebGLRenderingContext.webidl
Unless it somehow hinders other efforts, I would continue working on isEnabled
I'll be working on implementing validateProgram and getProgramInfoLog
I'll be working at uniformMatrix2fv, uniformMatrix3fv, uniformMatrix4fv and framebufferRenderbuffer, framebufferTexture2D, renderbufferStorage.
I'm going to run more demanding webgl demos and measure perf on servo and I need those functions ;)
@MortimerGoro I've been working on FBO support (see a couple of recent merges, and https://github.com/anholt/servo/tree/webgl-fbo). I also put together https://github.com/anholt/servo/tree/webgl-uniform-matrix-v for uniformmatrix, but the testing needs to get debugged.
@anholt awesome! do you need any help with the uniformmatrix testing?
@MortimerGoro just figuring out what's going on with the unreliable results.
I've opened #13639 for tracking FBO support. Want to add that to framebufferRenderbuffer/framebufferTexture2D?
@shravan-achar might be interested in working on the remaining ones here.
It looks like misisng toDataURL()
for WebGL is the cause of a whole lot of remaining testcase issues (like asin_001_to_006.html
)
Only 5 missing APIs now.
me, @taki-jaro, @mrowqa and @xanewok will work on this issue as a student project
cc @KiChjang
I plan to attempt glGetTexParameter.
Working on getFramebufferAttachmentParameter()
.
I'd like to do getRenderbufferParameter
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.
Most helpful comment
I plan to attempt glGetTexParameter.