82: Return Queue separately r=grovesNL a=kvark
What problem is this PR trying to solve? We want `Device` to be freely accessible from multiple threads/objects and internally synchronized. `Arc<Device>` seems like a natural choice of such a sharable object, especially since all except one methods are `&self`.
That one method is `get_queue()`, and it returns a temporary object `Queue<'a>`. If we turn it into `&self`, we'd end up with multiple instances of `Queue` created at any time, which contradicts the initial design (of this Rust wrapper). If it stays `&mut` and the user wraps the device into `Arc`, they'll never be able to submit any work...
So this PR solves this by moving the `Queue` completely outside of the device.
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
330: New swapchain model r=grovesNL a=kvark
Fixes#322
TODO:
- [x] Test on Metal
- [x] Test on DX12
- [x] Test on Vulkan
- [x] Try embedding the backend information into `SwapChainId`
- [x] Wait for https://github.com/amethyst/rendy/pull/202
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
332: Validate resource usage flags when used r=kvark a=yanchith
This PR adds usage flag validations to the functions discussed in https://github.com/gfx-rs/wgpu/issues/228#issuecomment-528949445 and https://github.com/gfx-rs/wgpu/issues/228#issuecomment-528953096
I added `usage` fields to `Buffer` and `Texture` for convenience.
The validations themselves are run before much else happens (seemed clearer that way). This means certain `VecMap`s and `FastHashMap`s might be queried more than necessary, though.
I also left one TODO in, which I'd like to resolve: With what usage flags should the swapchain textures be created? Currently it initializes the texture resource trackers with `UNINITIALIZED`, so I just copied the same flag for the texture. This just happens to work (that is not trigger the validations I added), because its value, `UNINITIALIZED`, pretends to be every usage flag by having all bits set. Is that by design?
Closes#228 ~(except for `BufferUsage::INDIRECT`, for which I can create another issue)~
Co-authored-by: yanchith <yanchi.toth@gmail.com>
329: Export function wgpu_render_pass_set_index_buffer r=kvark a=alichay
The function didn't have the `#[no_mangle]` flag, that's all.
Co-authored-by: Alichay <allisonalichay@gmail.com>
328: Switch to use gfx-rs latest and greatest master r=kvark a=kvark
I'm going to implement #322 as a follow-up commit, but this one is already standalone and mergeable.
Closes#320
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
316: Testing adding iOS matrix. r=kvark a=seivan
I'm not sure `GLFW3` would work for iOS, but lets see what Travis says?
Co-authored-by: Seivan Heidari <seivan.heidari@icloud.com>
314: Handle frame acquisition failure internally r=grovesNL a=kvark
Fixes#313, which is critical to get us running on Metal today.
In the nearest future, all that code will be removed in favour of using the alternative swapchain model.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
73: Update wgpu-native to the commit that has no backend features. r=grovesNL a=kvark
This change removes the dependency on gfx-rs backends, refactors
Adapter and Surface creation to be done from nothing.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This PR removes optional backend features in favor of run-time
selection at the `request_adapter` entry point. Adapters from all
supported gpu backends on the platform are reported.
It also makes gfx-rs dependency to be public (for now).
This change merges `Id` with `GenericId` and abstracts away its contents, exposing itself as just u64. This will allow us to encode the backend type into it, in addition to index and epoch.
It also refactors `TypedId` to have a single function extracting all the fields, since this is how it's used all the times anyway.
307: Add cubemap hint to multiple of 6 layers textures r=kvark a=LaylConway
This is an attempt at addressing #306. Vulkan has specific requirements on what can and can't be marked with the CUBE hint.
Co-authored-by: Layl <2385329-layl@users.noreply.gitlab.com>
71: Use `HasRawWindowHandle` in `create_surface` r=kvark a=hecrj
This change lets users use `wgpu` without listing `raw-window-handle` as a direct dependency themselves.
Co-authored-by: Héctor Ramón Jiménez <hector0193@gmail.com>
70: Wholesome update for wgpu-0.3 r=everyone a=kvark
~~This update is a little more opinionated, i.e. the BGL creation just accepts a slice of things instead of a descriptor. I believe the reason for descriptors in the upstream API is mostly techincal - it's more convenient to generate bindings in Googles giant codegen. Following it verbatim doesn't appear to be strictly necessary, especially if we can extract better usability from Rust features.~~
The change also disables "gl" feature for the release. We'll re-enable it once we can provide it nicely, it will not be a breaking change.
I also noticed that barriers are not working correctly on the mipmap example. Will investigate separately - the native part is already published anyway. Edit: fixed by https://github.com/gfx-rs/wgpu/pull/302
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>