diff options
author | bors-servo <servo-ops@mozilla.com> | 2020-06-18 09:58:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-18 09:58:55 -0400 |
commit | 1b55ab5804d99f54fd45b3a9ec4a20154b38bf9b (patch) | |
tree | 30ade403088ecb9b41fda5ffafcddcb58137a378 /components/canvas/webgl_thread.rs | |
parent | 40db56db4ba657107ccdd813b246b65772f68cea (diff) | |
parent | 6591fa54f929dd76a0383f5b40a7490f22d0f7cc (diff) | |
download | servo-1b55ab5804d99f54fd45b3a9ec4a20154b38bf9b.tar.gz servo-1b55ab5804d99f54fd45b3a9ec4a20154b38bf9b.zip |
Auto merge of #26787 - szeged:texi2d_3, r=jdm
Add support for WebGL2 TexImage2D
Adds initial support for one of the WebGL2 `TexImage2D` call.
I've enabled the `tests/wpt/webgl/tests/deqp/` tests.
---
<!-- 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 #26512
- [x] There are tests for these changes
@mmatyas @zakorgy @jdm
<!-- 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. -->
Diffstat (limited to 'components/canvas/webgl_thread.rs')
-rw-r--r-- | components/canvas/webgl_thread.rs | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs index ab0a2fd399e..d113f0aca85 100644 --- a/components/canvas/webgl_thread.rs +++ b/components/canvas/webgl_thread.rs @@ -927,7 +927,7 @@ impl WebGLThread { 0, gl::RGBA, gl::UNSIGNED_BYTE, - None, + gl::TexImageSource::Pixels(None), ); self.dom_outputs.insert( pipeline_id, @@ -1593,7 +1593,31 @@ impl WebGLImpl { 0, format.as_gl_constant(), effective_data_type, - Some(&pixels), + gl::TexImageSource::Pixels(Some(&pixels)), + ); + }, + WebGLCommand::TexImage2DPBO { + target, + level, + internal_format, + size, + format, + effective_data_type, + unpacking_alignment, + offset, + } => { + gl.pixel_store_i(gl::UNPACK_ALIGNMENT, unpacking_alignment as i32); + + gl.tex_image_2d( + target, + level as i32, + internal_format.as_gl_constant() as i32, + size.width as i32, + size.height as i32, + 0, + format.as_gl_constant(), + effective_data_type, + gl::TexImageSource::BufferOffset(offset), ); }, WebGLCommand::TexSubImage2D { |