Commit Graph
99 Commits
Author SHA1 Message Date
Dzmitry Malyshau 15cdc794fa Shader binding validation 2020-06-05 12:48:34 -04:00
Dzmitry Malyshau 534d7ac504 Validate pipeline layout creation 2020-06-05 12:48:34 -04:00
Dzmitry Malyshau f158709dd0 Validate bind group layouts 2020-06-05 12:48:34 -04:00
Connor Fitzgerald 08c0460e32 Add assert that old SwapChainOutput is dead after SwapChain is remade 2020-06-04 23:42:59 -04:00
Connor Fitzgerald ade7ce10b2 Rustification of Extensions and SamplerDescriptor 2020-06-02 21:04:25 -04:00
Dzmitry Malyshau 075e683cb5 Fix tracing of buffers that are mapped at creation 2020-06-02 16:30:41 -04:00
Dzmitry Malyshau 1acd1901de Fix bytes_per_row used in write_texture 2020-06-02 13:44:12 -04:00
Dzmitry Malyshau ae17ea7625 New map_async logic, change the semantic of mapped buffers. 2020-06-02 13:44:00 -04:00
Dzmitry Malyshau aa12e7dc14 Read-only depth-stencil support 2020-06-01 19:54:56 -04:00
Dzmitry Malyshau 321a5cee0f Enforce copy buffer-texture row pitch alignment 2020-06-01 16:51:42 -04:00
Connor Fitzgerald 415ce97415 Implement anisotropic filtering and extensions/limits 2020-06-01 10:43:54 -04:00
Dzmitry Malyshau 6fb2b272e4 Fix recycling of command buffers 2020-05-31 11:50:24 -04:00
Dzmitry Malyshau 7181bfe977 Move BufferSize to wgpu-types 2020-05-30 01:19:42 -04:00
bors[bot]andDavid Peicho 4c136418ff Merge #667
667: Add asserts to validate that a resource exists when used r=kvark a=DavidPeicho

Hi,

As discussed in #610, this is mostly for C/C++ users. Some questions:
* Would it be possible to display the ID of the resource that failed? I don't know what you think about implementing the `Display` trait on the `Id` struct? 
* Do you see other places needing for checks?

Thanks!

Co-authored-by: David Peicho <david.peicho@gmail.com>
2020-05-26 22:23:31 +00:00
bors[bot]andAlphaModder 6650b94ff6 Merge #668
668: Return failures to the user in swap_chain_get_next_texture, rather than transparently reconfiguring. r=kvark a=AlphaModder

TODO:
- [x] Change `Global::swap_chain_get_next_texture` in `wgpu-core`.
- [x] Update `wgpu_swap_chain_get_next_texture` in `wgpu-native`. (https://github.com/gfx-rs/wgpu-native/pull/32)
- [x] Wrap `SwapChainOutput`/`SwapChainStatus` in a nice enum in `wgpu-rs`. (https://github.com/gfx-rs/wgpu-rs/pull/323)
- [ ] Update `wgpu_bindings` (?)

Co-authored-by: AlphaModder <quasiflux@gmail.com>
2020-05-26 21:26:15 +00:00
AlphaModder e89c3d6b1c Alter swap_chain_get_next_texture to bubble up failures to the user. 2020-05-26 14:15:22 -07:00
Dzmitry Malyshau 79eb7b9c17 Minor fixes in Gecko 2020-05-26 16:41:24 -04:00
David Peicho 96bdaa2a9f storage: add attribute to pretty-print invalid resource usage 2020-05-26 18:46:10 +01:00
Paul KernfeldandPaul Kernfeld d529526e7f "Use the whole buffer" is !0, not 0 (#663)
* "Use the whole buffer" is !0, not 0

Fixes #654
Applies to BufferBinding, set_vertex_buffer, set_index_buffer

* Add BufferSize type alias

* Make BufferSize a transparent type

Add a custom serialization "buddy" type
Use BufferSize::WHOLE instead of crate::WHOLE_SIZE

* Move SerBufferSize into device::trace mod

Co-authored-by: Paul Kernfeld <paulkernfeld@gmail.com>
2020-05-26 13:25:06 -04:00
Dzmitry Malyshau e4659b6d05 Bring back BufferCopyView 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau 679dba044b Remove array layers from texture copies 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau dff37bb65d Move TextureDataLayout to wgpu-types 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau fcf1d2762d Use TextureDataLayout consistently 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau 2695d64269 Share code between write_buffer and write_texture 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau a4ea5358ef Implement write_texture 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau 4c62b20282 Multiple fixes and clean ups.
- Clean up after the pending writes on destroy.
- Fix temporary buffer creation.
- Fix internal thread initialization by the command allocator.
- Clean up player event_loop usage.
2020-05-11 14:07:02 -04:00
Dzmitry Malyshau 786ead9701 Destroy temporary buffers 2020-05-11 10:53:21 -04:00
Dzmitry Malyshau 35f2e8b70e Move queue logic into a submodule 2020-05-10 22:40:04 -04:00
Dzmitry Malyshau ba8c2eae54 Implement Queue::write_buffer 2020-05-10 01:21:47 -04:00
Gabriel Majeri f70f32af87 Add optional SPIR-V shader validation
# Conflicts:
#	Cargo.lock
2020-05-09 19:55:10 +03:00
Dzmitry Malyshau cf8513baf5 Proper maintenance of the command pools 2020-05-06 11:15:08 -04:00
Dzmitry Malyshau fbc533bfee Save bind group layout inside pipeline layouts 2020-05-04 23:46:06 -04:00
Dzmitry Malyshau 71d4f77ab8 Wait for idle before destroying swapchains 2020-05-03 23:39:05 -04:00
bors[bot]andDzmitry Malyshau e2100b6911 Merge #621
621: Keep Adapter alive r=grovesNL a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-05-01 04:30:09 +00:00
Dzmitry Malyshau f35dd741aa Android support (#625) 2020-05-01 00:22:00 -04:00
Dzmitry Malyshau 9500cfa4f3 Keep Adapter alive by the device 2020-05-01 00:20:54 -04:00
Paul KernfeldandPaul Kernfeld 29fe9a935a Make assertions in wgpu-core device/mod.rs verbose (#622)
Co-authored-by: Paul Kernfeld <paulkernfeld@gmail.com>
2020-05-01 00:05:13 -04:00
Dzmitry Malyshau f64b2dd3bb trace: make Id serialization nicer 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau 3c68fb17e4 player: full winit integration 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau 77a5eda796 trace: fix reusing object ids 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau 854c1be035 trace: support pipelines, refactor destruction sequence 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau 018417f174 trace: replaying all the commands 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau 47f37ad78e trace: player skeleton 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau 622d9ecc74 trace: all the commands 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau d4705b6008 trace: bind groups, shaders, and buffer contents 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau 1cc548a7a2 Make descriptors generic over Label 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau 4c1ea02553 trace: hook up RON output 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau 5035ffdfe2 Split limits and private features, add tracing module 2020-04-30 09:55:52 -04:00
bors[bot]andDzmitry Malyshau bc065e4abc Merge #615
615: Use General allocator at all times for now r=grovesNL a=kvark

In all user-managed resources, we don't have control of the lifetime. Since we don't know when it's released, we can't use any more specific allocator kind than `General`.

Previously, we assumed that buffers created for MAP_READ+COPY_SRC, for example, were one-time buffers created to copy data. However, there appear to be cases where they were used to fill data in once, and then persistently used as a copy source destination.

In the future, one WebGPU data transfer story is settled, we'll be able to use `Linear` kind again for all internally managed uploads. I.e. writeBuffer, writeTexture, and createBuffeMappedOnlyAtStart.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-25 02:08:54 +00:00
Dzmitry Malyshau fc68b5ef54 Use General allocator at all times for now 2020-04-24 21:59:41 -04:00