aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webidls
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-11-05 16:52:51 -0500
committerGitHub <noreply@github.com>2019-11-05 16:52:51 -0500
commitafbcbf75eaa63ff0eec8fd3858e9155eb8dbadaa (patch)
tree8b0f5cf2b882ba3b7fc0fef8df49ac9a3a9d0e6a /components/script/dom/webidls
parent593f8bd0f66d0c4a4f8f636a78337a7f029b9b8f (diff)
parent4050b7f9eca4c581d100fed778fa09f21d7e09dd (diff)
downloadservo-afbcbf75eaa63ff0eec8fd3858e9155eb8dbadaa.tar.gz
servo-afbcbf75eaa63ff0eec8fd3858e9155eb8dbadaa.zip
Auto merge of #24473 - mmatyas:webgl_fns_buffer, r=jdm
Implement the basic WebGL2 buffer data operations Adds support for the WebGL2 calls `bufferData`, `bufferSubData`, `copyBufferSubData` and `getBufferSubData`. Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.3 --- <!-- Please describe your changes on the following line: --> This patch depends on https://github.com/servo/sparkle/pull/8. Some tests cause a crash for me at the moment, as they depend on other, not yet implemented buffer calls and transform feedback objects. As for the code, there are a few parts I'm not sure about: - To get the element byte size of a TypedArray I've wrote a simple `match`, as the relevant field is not published in `rust-mozjs`. Is that okay or there's some other way to get this already? - The WebGL1 BufferData implementations were copied into the WebGL2 code as a workaround, due to the difference in the available buffer slots (ie. `self.bound_buffer`). An alternative could be is to pass this function and self as parameters to an internal buffer data implementation function, but personally I found that code to be quite ugly. cc @jdm @zakorgy --- <!-- 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 (with the sparkle patch) - [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 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. -->
Diffstat (limited to 'components/script/dom/webidls')
-rw-r--r--components/script/dom/webidls/WebGL2RenderingContext.webidl16
1 files changed, 8 insertions, 8 deletions
diff --git a/components/script/dom/webidls/WebGL2RenderingContext.webidl b/components/script/dom/webidls/WebGL2RenderingContext.webidl
index 586f260ccc2..c171a9bb866 100644
--- a/components/script/dom/webidls/WebGL2RenderingContext.webidl
+++ b/components/script/dom/webidls/WebGL2RenderingContext.webidl
@@ -299,18 +299,18 @@ interface mixin WebGL2RenderingContextBase
void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
void bufferSubData(GLenum target, GLintptr dstByteOffset, /*[AllowShared]*/ BufferSource srcData);
// WebGL2:
- // void bufferData(GLenum target, [AllowShared] ArrayBufferView srcData, GLenum usage, GLuint srcOffset,
- // optional GLuint length = 0);
- // void bufferSubData(GLenum target, GLintptr dstByteOffset, [AllowShared] ArrayBufferView srcData,
- // GLuint srcOffset, optional GLuint length = 0);
+ void bufferData(GLenum target, /*[AllowShared]*/ ArrayBufferView srcData, GLenum usage, GLuint srcOffset,
+ optional GLuint length = 0);
+ void bufferSubData(GLenum target, GLintptr dstByteOffset, /*[AllowShared]*/ ArrayBufferView srcData,
+ GLuint srcOffset, optional GLuint length = 0);
- // void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset,
- // GLintptr writeOffset, GLsizeiptr size);
+ void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset,
+ GLintptr writeOffset, GLsizeiptr size);
// MapBufferRange, in particular its read-only and write-only modes,
// can not be exposed safely to JavaScript. GetBufferSubData
// replaces it for the purpose of fetching data back from the GPU.
- // void getBufferSubData(GLenum target, GLintptr srcByteOffset, [AllowShared] ArrayBufferView dstBuffer,
- // optional GLuint dstOffset = 0, optional GLuint length = 0);
+ void getBufferSubData(GLenum target, GLintptr srcByteOffset, /*[AllowShared]*/ ArrayBufferView dstBuffer,
+ optional GLuint dstOffset = 0, optional GLuint length = 0);
/* Framebuffer objects */
// void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0,