Commit graph

56 commits

Author SHA1 Message Date
Mátyás Mustoha
ced67af6b2 Add support for WebGL2 GetFragDataLocation
Adds support for the `GetFragDataLocation` WebGL2 call.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.7
2020-03-09 12:59:30 +01:00
Anthony Ramine
5a4f8cf93f Update SpiderMonkey 2020-03-06 11:13:28 +01:00
Mátyás Mustoha
8389189d94 Add support for WebGL2 FramebufferTextureLayer
Adds support for `FramebufferTextureLayer` WebGL2 call.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4
2020-03-04 10:07:13 +01:00
Mátyás Mustoha
cc07d930c8 Add support for WebGL2 framebuffer invalidation
Adds support for the `invalidateFramebuffer` and `invalideSubFramebuffer`
WebGL2 calls.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4
2020-03-03 14:54:17 +01:00
Mátyás Mustoha
8701d45715 Add support for WebGL2 clear buffer operations
Adds support for the following WebGL2 methods:

- `clearBufferfv`
- `clearBufferiv`
- `clearBufferuiv`
- `clearBufferfi`

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11
2020-02-24 10:57:46 +01:00
Mátyás Mustoha
d5d0a788e3 Add support for WebGL2 getFramebufferAttachmentParameter
Implements the WebGL2 variant of `getFramebufferAttachmentParameter`
and the related parameter checks.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4
2020-02-21 17:30:03 +01:00
Mátyás Mustoha
b41805a920 Add support for WebGL2 framebuffer attachments
Adds an initial implementation for the framebuffer attachments
introduced with WebGL2 and the related enums and constrains checks.
2020-02-21 11:04:30 +01:00
Mátyás Mustoha
796ee70597 Add initial support for WebGL2 read framebuffer
Adds support for binding to the read framebuffer slot and querying
its status.
2020-02-14 12:10:16 +01:00
Mátyás Mustoha
833485887e Add support for WebGL2 MAX_COLOR_ATTACHMENTS and MAX_DRAW_BUFFERS
Adds support for using the WebGL2 enums `MAX_COLOR_ATTACHMENTS` and
`MAX_DRAW_BUFFERS` with `GetParameter`.

See https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
2020-02-14 11:03:28 +01:00
Kunal Mohan
f7db4b7f80
Modify script to prevent further violations of snake_case 2020-01-18 14:22:15 +05:30
bors-servo
893fce1374
Auto merge of #25545 - szeged:mmatyas__webgl_fns_versions, r=jdm
Add WebGL2 specific version strings

Updated the `VERSION` and `SHADING_LANGUAGE_VERSION` WebGL parameters to report the correct version strings when WebGL2 is in use.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2

<!-- Please describe your changes on the following line: -->
cc @jdm @zakorgy @imiklos

---
<!-- 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] 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. -->
2020-01-17 13:55:51 -05:00
bors-servo
f200e21064
Auto merge of #25543 - szeged:mmatyas__webgl_fns_uniforms_p3, r=jdm
Add support for WebGL2 uniform matrix operations

Adds support for the `uniformMatrix[234]x[234]fv` WebGL2 functions.
See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8

<!-- Please describe your changes on the following line: -->

Note: Similarly to #25538, some of the functions here also overlap with their WebGL 1 variant.

cc @jdm @zakorgy @imiklos

---
<!-- 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] 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. -->
2020-01-17 12:55:14 -05:00
Mátyás Mustoha
01ca317235 Add WebGL2 specific version strings
Updated the `VERSION` and `SHADING_LANGUAGE_VERSION` WebGL parameters
to report the correct version strings when WebGL2 is in use.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
2020-01-17 12:10:13 +01:00
Mátyás Mustoha
7d5048f885 Add support for WebGL2 uniform matrix operations
Adds support for the `uniformMatrix[234]x[234]fv` WebGL2 functions.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
2020-01-17 11:42:45 +01:00
bors-servo
d3b37ead0a
Auto merge of #25538 - szeged:mmatyas__webgl_fns_uniforms_p2, r=jdm
Add support for WebGL2 uniform array operations

Adds support for the WebGL2 overloads of `uniform[1234][if]v`.

<!-- Please describe your changes on the following line: -->

WebGL2 adds two optional parameters for the `uniform[1234][if]v` functions to allow specifying input data ranges. However, because they have the same name and overlapping parameters, the Codegen cannot make a difference between their GL1 and 2 variants. As a workaround, I've added the new parameters to the WebGL1 side, which which isn't strictly what the spec says, but shouldn't break things either. (Note: Firefox devs also run into this issue: [[1](https://searchfox.org/mozilla-central/source/dom/webidl/WebGLRenderingContext.webidl#794), [2](https://bugzilla.mozilla.org/show_bug.cgi?id=1324543)]).

cc @jdm @zakorgy @imiklos

---
<!-- 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] 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. -->
2020-01-16 23:47:07 -05:00
Mátyás Mustoha
0650fc3199 Add support for WebGL2 uniform array operations
Adds support for the WebGL2 overloads of `uniform[1234][if]v`.
2020-01-16 12:09:23 +01:00
bors-servo
f9174a4717
Auto merge of #25519 - szeged:mmatyas__webgl_fns_uniforms, r=jdm
Add support for WebGL2 unsigned uniform operations

This adds support for the WebGL2 `uniform[1234]ui` and `uniform[1234]uiv` operations.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8

<!-- Please describe your changes on the following line: -->

cc @jdm @zakorgy @imiklos

---
<!-- 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] 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. -->
2020-01-15 10:45:07 -05:00
Mátyás Mustoha
bc914381a8 Add support for WebGL2 unsigned uniform operations
This adds support for the WebGL2 `uniform[1234]ui` and `uniform[1234]uiv`
operations.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
2020-01-15 13:48:35 +01:00
Mátyás Mustoha
500b36b669 Add support for WebGL2 RASTERIZER_DISCARD enum.
Add support for the `RASTERIZER_DISCARD` enum for the WebGL2 version
of the `Enable`, `Disable` and `IsEnabled` functions.

See https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
2020-01-14 12:30:59 +01:00
Mátyás Mustoha
da94f8d0e7 Add initial support for WebGL2 uniform buffer functions
Adds initial support for the following WebGL2 calls:

- bindBufferBase
- bindBufferRange
- getUniformIndices
- getUniformBlockIndex
- getActiveUniforms
- getActiveUniformBlockParameter
- getActiveUniformBlockName
- uniformBlockBinding

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16
2020-01-09 11:17:50 +01:00
Mátyás Mustoha
8fefa23019 Add support for WebGL2 ReadPixels functions
Adds support for the new ReadPixels functions introduced with WebGL2
and the relevant PixelStorei parameters.

Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.10
2019-11-26 16:09:13 +01:00
Istvan Miklos
4f112b1705 Add Support for WebGL Transormfeedback
Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15
2019-11-08 15:22:52 +01:00
Mátyás Mustoha
4050b7f9ec Implement the basic WebGL2 buffer data operations
Adds support for `bufferData`, `bufferSubData`, `copyBufferSubData`
and `getBufferSubData`.

Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.3
2019-11-05 11:33:13 +01:00
Patrick Walton
a358bca766 Use surfman for managing GL surfaces
Co-authored-by: Alan Jeffrey <ajeffrey@mozilla.com>
Co-authored-by: Zakor Gyula <gyula.zakor@h-lab.eu>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2019-11-01 08:47:11 -05:00
Mátyás Mustoha
26df1962c3 Add WebGLSampler support
Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13
2019-10-08 16:21:43 +02:00
Istvan Miklos
248545ddda Initial implementation of WebGLSync
This patch adds initial support for WebGLSync.

Note:
There is no test for the isSync, deleteSync and waitSync functions in the `conformance2/sync/sync-webgl-specific.html`.
2019-10-02 12:51:32 +02:00
Mátyás Mustoha
f2e2b3d34b Initial implementation of WebGLQueries
This patch adds initial support for WeGLQueries. Most related WebGL
functions and objects are implemented [1]. What's still missing is
the `EXT_disjoint_timer_query_webgl2` support.

[1]: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.12
2019-10-01 12:30:24 +02:00
marmeladema
2c5d0a6ebc Convert CGTraitInterface to use safe JSContext instead of raw JSContext 2019-07-24 08:24:50 +01:00
Emilio Cobos Álvarez
3d57c22e9c Update euclid.
There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.

Given the size of this patch, I think it's useful to get this landed as-is.
2019-07-23 23:09:55 +02:00
Josh Matthews
3121f42d52 Remove offscreen_gl_context dependency from canvas_traits and script. 2019-03-07 09:27:36 -05:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Anthony Ramine
a3392610c3 Make HTMLCanvasElement::get_size return a Size2D<u32>
The changes keep trickling down.
2018-10-02 14:21:06 +02:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Anthony Ramine
0579fbe4fa Use WebGLResult for returns of instanced draw methods 2018-09-06 10:41:58 +02:00
Anthony Ramine
900a19058e Support unions of objects in overloads
Part of #20513, implementing the parts useful for WebGL.
2018-08-30 16:15:40 +02:00
Anthony Ramine
3e8c2d659a Implement gl.getUniform() 2018-07-18 21:37:41 +02:00
Anthony Ramine
4e6eea221a Implement instanced WebGL drawing calls (part of #20791) 2018-07-08 10:44:45 +02:00
Anthony Ramine
0e2e834d18 Fix gl.linkProgram() signature 2018-07-05 14:20:47 +02:00
Fausto Núñez Alberro
58760d91d1
Implement WebGL GetRenderbufferParameter
This needed a bump of gleam to version 0.4.33
2018-04-24 18:16:51 +02:00
Anthony Ramine
bb2b6a7a41 Fix the signature of WebGLRenderingContext::BufferSubData 2018-04-04 13:12:42 +02:00
Anthony Ramine
866a523914 Properly use Float32List and Int32List for WebGL uniform methods 2018-04-03 12:22:32 +02:00
Anthony Ramine
088ebcb095 Remove obsolete BufferDataSource 2018-04-03 11:15:54 +02:00
Anthony Ramine
a62bed82e4 Implement WebGLRenderingContextBase.getAttachedShaders 2018-03-24 13:58:07 +01:00
Igor Matuszewski
daceeb4002 Appease test-tidy 2018-03-23 19:25:19 +01:00
Igor Matuszewski
20f21cb5f8 Adapt uniform[fv] and similar to accept typed array args 2018-03-23 19:25:19 +01:00
Igor Matuszewski
36f39ce27a Change WebGL function signatures accepting typed arrays 2018-03-23 19:25:19 +01:00
Anthony Ramine
8061d8c3d2 Fix some more WebGL methods 2018-03-23 01:23:39 +01:00