Commit graph

83 commits

Author SHA1 Message Date
Alan Jeffrey
c1d064b626 Make textures that come from webxr invalid outside an rAF 2020-08-06 17:51:58 -05:00
Alan Jeffrey
bf7f4eae31 Update WebXR Layer IDL, and matching changes to the Rust code. 2020-08-03 12:37:01 -05:00
Alan Jeffrey
349619ed2d Support for webxr layer management 2020-06-28 16:37:45 -05:00
Tobias Tschinkowitz
9c343fcc96 Replaced failible boolean with an enum 2020-04-23 18:23:01 +02:00
Josh Matthews
c002a29582 Support WebGL2 contexts in XRWebGLLayer. 2020-04-08 12:52:01 -04:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Mátyás Mustoha
0afe27ef18 Add support for WebGL2 read and draw buffer settings
Adds support for the `ReadBuffer` and `DrawBuffers`
WebGL2 calls and the related parameter getters.

See:

- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4
- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11
2020-03-16 12:17:15 +01:00
Josh Matthews
fbcf2bbc3e Integrate swapchain surface provider changes into webgl and webxr implementations. 2020-03-09 17:50:54 -04:00
Mátyás Mustoha
5cb6eb2744 Improved the WebGL2 framebuffer render validation
It seems `MissingColorAttachment` should be returned only when
all of the color attachments are missing.
2020-03-05 16:48:42 +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
859a3a4924 Allow more WebGL2 FBO attachment formats
Add support for most of the framebuffer attachment formats
introduced in WebGL2 for textures and renderbuffers.

Related format tables:

- https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml
- https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glRenderbufferStorage.xhtml
2020-03-03 14:50:48 +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
Simon Sapin
bea73951db Use #![register_tool] instead of #![register_attr]
CC https://github.com/rust-lang/rust/issues/66079
2019-11-15 17:24:42 +01:00
bors-servo
56537fad58
Auto merge of #24616 - teapotd:imageinfo-option-refactoring, r=jdm
Store Option<ImageInfo> instead of making fields of ImageInfo optional

Fixes #24582

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #24582
- [X] These changes do not require tests
2019-11-01 20:13:59 -04:00
teapotd
a4fa36f9fb Store Option<ImageInfo> instead of making fields optional 2019-11-01 14:48:16 +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
Josh Matthews
ea715a7a4c webgl: Update framebuffer completion status when attached renderbuffer/texture storage changes. 2019-09-23 12:01:08 -04:00
Josh Matthews
7e4cf13f5b webgl: Support RGB color attachments for complete framebuffers. 2019-09-20 01:28:22 -04:00
Josh Matthews
8f5c37c0b5 Don't panic if WebGL thread can't be reached during finalization. 2019-07-29 10:09:24 -04: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
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Josh Matthews
59b8f971b5 webgl: Mark framebuffers as uninitialized when their attached renderbuffer's storage changes. 2018-09-14 16:17:47 -04:00
Josh Matthews
4edb7b194c webgl: Remove knowledge of attached framebuffers from renderbuffers and textures. 2018-09-10 16:31:33 -04:00
Josh Matthews
8ede221a83 webgl: Ensure that renderbuffers have been bound before attaching to a framebuffer. 2018-09-10 16:31:31 -04:00
Josh Matthews
bb8d9ba74c webgl: Ensure that depth and stencil attachments are rebound after messing with DEPTH_STENCIL attachments. 2018-09-10 16:31:30 -04:00
Josh Matthews
1b08dd5232 webgl: Move framebuffer initialization logic to WebGL thread. 2018-09-10 16:31:29 -04:00
Josh Matthews
df8e36aa78 webgl: Differentiate between missing colour attachments and incomplete attachments. 2018-09-10 16:31:28 -04:00
Josh Matthews
690c98dda7 webgl: return missing attachment status from framebuffers with no attachments. 2018-09-10 15:56:17 -04:00
Josh Matthews
da3b0ef88f webgl: Clear renderbuffers on first read/write operation. 2018-09-10 15:56:16 -04:00
Josh Matthews
944d1d1f29 webgl: Check internal format of textures when determining attachment completeness. 2018-09-10 15:56:16 -04:00
Josh Matthews
d179435eab webgl: Ensure that framebuffers have a color attachment before reading or writing. 2018-09-10 15:56:15 -04:00
Josh Matthews
80ed829241 webgl: Mark framebuffers as incomplete if attachments do not meet format requirements. 2018-09-10 15:54:41 -04:00
Josh Matthews
3334e477c1 webgl: Mark zero-sized framebuffers as incomplete attachments. 2018-08-01 15:40:46 -04:00
Anthony Ramine
661e258b28 Store a reference to the WebGLRenderingContext in WebGLObject 2018-07-24 13:27:33 +02:00
Igor Gutorov
ee5bdbbd8b Implement WebGL getFramebufferAttachmentParameter API 2018-03-22 18:26:18 +02:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
2017-10-16 17:16:20 +02:00
Anthony Ramine
f87c2a8d76 Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
2017-09-26 09:49:10 +02:00
Anthony Ramine
577370746e Rename DOMRefCell<T> to DomRefCell<T>
I don't want to do such a gratuitous rename, but with all the other types
now having "Dom" as part of their name, and especially with "DomOnceCell",
I feel like the other cell type that we already have should also follow
the convention. That argument loses weight though when we realise there
is still DOMString and other things.
2017-09-26 09:49:08 +02:00
Anthony Ramine
7be32fb237 Rename JS<T> to Dom<T> 2017-09-26 09:48:55 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Anthony Ramine
676f2c8acf Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox"
This reverts commit 4d10d39e8f, reversing
changes made to ee94e2b7c0.
2017-08-16 23:23:18 +02:00
Emilio Cobos Álvarez
cfe22e3979
Revert "Auto merge of #17891 - MortimerGoro:webgl_move, r=glennw,emilio"
This reverts commit 90f55ea458, reversing
changes made to 2e60b27a21.
2017-08-16 16:42:13 +02:00
Imanol Fernandez
703962fe61 Improve WebGL architecture. 2017-08-15 22:14:32 +02:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00