Commit Graph
46 Commits
Author SHA1 Message Date
teoxoy ef0ce05d3a [wgpu-core] fix .zip() usages 2024-07-10 16:42:35 +02:00
teoxoy 9d3d4ee297 implement exclusive pipeline validation
This gets the bind_group_layout_dedup test passing again.
2024-07-02 18:06:19 +02:00
teoxoy 4a19ac279c introduce MultiError and use it for BGL incompatibility errors 2024-07-02 18:06:19 +02:00
teoxoy 42e16c7e7d simplify logic of Entry.is_valid 2024-07-02 18:06:19 +02:00
teoxoy 0d539874ed simplify the BGL compatibility check 2024-07-02 18:06:19 +02:00
teoxoy 9ec0f45efd move the BGL compatibility check in the binder 2024-07-02 18:06:19 +02:00
teoxoy c3ebfde302 remove Resource trait 2024-07-02 18:06:19 +02:00
teoxoy ae7da8f669 introduce Labeled trait 2024-07-02 18:06:19 +02:00
teoxoy a56698cbe6 use .error_ident() in a few more places 2024-06-25 11:14:41 +02:00
teoxoy 43177d78d6 replace uses of Id.backend() with A::VARIANT 2024-06-20 16:34:17 +02:00
Andreas Reich 77a83fb0dd Remove lifetime constraints from wgpu::ComputePass methods (#5570)
* basic test setup

* remove lifetime and drop resources on test - test fails now just as expected

* compute pass recording is now hub dependent (needs gfx_select)

* compute pass recording now bumps reference count of uses resources directly on recording

TODO:
* bind groups don't work because the Binder gets an id only
* wgpu level error handling is missing

* simplify compute pass state flush, compute pass execution no longer needs to lock bind_group storage

* wgpu sided error handling

* make ComputePass hal dependent, removing command cast hack. Introduce DynComputePass on wgpu side

* remove stray repr(C)

* changelog entry

* fix deno issues -> move DynComputePass into wgc

* split out resources setup from test
2024-05-14 20:05:17 +00:00
Connor Fitzgerald e26a853654 BGL Weak Pointer Deduplication Pool (#4927)
* Ho boy

* BGL pool finished

* Remove id32 feature

* Add BGL Test

* Iteration

* Working Dedupe

* Tests

* Iteration

* Re-iteration

* Hash Cleanup

* Add large slew of tests

* Whoops
2024-01-02 09:27:22 -05:00
Mikko Lehtonen 159ac9e373 validation: More detailed on incompatible BGL (#4826) 2023-12-17 18:22:39 -05:00
6e21f7a929 Arcanization of wgpu core resources (#3626)
Arcanization of wgpu_core resources

---------

Co-authored-by: Elabajaba <Elabajaba@users.noreply.github.com>
Co-authored-by: Niklas Korz <niklas@niklaskorz.de>
Co-authored-by: grovesNL <josh@joshgroves.com>
Co-authored-by: Jim Blandy <jimb@red-bean.com>
Co-authored-by: Mauro Gentile <Mauro.Gentile@ubisoft.com>
Co-authored-by: Sludge <96552222+SludgePhD@users.noreply.github.com>
2023-11-20 08:41:52 +01:00
Nicolas SilvaandConnor Fitzgerald 32b761a591 Implement a missing part of bind group layout deduplication (#4200)
* Don't create a raw bind group layout for duplicates.

* Fully support bind group layout deduplication in Pipeline::get_bind_group_layout

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-10-04 11:12:19 +02:00
Nicolas Silva 399637e2b8 Bind group layout dedup (#3925)
* Remove generic parameter in compat::Manager.

The code is specific to bind group layout ids and the generic parameter gets in the way.

* Add a test.

The test actually covers wgpu's configuration where deduplication does not require the indirection rather than the new code. I used it to debug the new code with the configuration hard-coded. It's tedious to add a test to cover dedpuplication of bind group layouts for users of wgpu_core to provide their IDs, we can rely on the CTS which has test for that.

* Implement bind group layout deduplication for all configurations

Currently wgpu-core implement bind group layout deduplication only when it creates its own resource IDs. In other words it works for wgpu but not in Firefox.
This PR bridges the gap by allowing an optional indirection in bind group layouts: each BGL may store an ID referring to its "deduplicated" BGL.
When referring to a BGL the rest of the code must make sure to follow the indirection. The exception is command buffer processing which is considered hot code and where we first validate against the provided BGL ID and only follow the indirection if the initial check failed.

The main pain point with this approach is the various places where wgpu-core manually updates reference counts: we have to be careful about following the indirection to track the right BGL.

* Avoid making decisions based on the size of some generic type.
2023-08-25 21:48:22 +02:00
Jim Blandy 4d1fbeb753 wgpu-core: Move storage code to new storage module. 2023-05-24 09:54:03 -07:00
Jim Blandy 13bd3eea55 wgpu-core: Move HalAPI to new hal_api module. 2023-05-24 09:54:03 -07:00
Jim Blandy 215884184b Reformat comments in wgpu-core. (#3102) 2022-10-13 18:34:44 +00:00
Dzmitry Malyshau ddac6a369b Validate min_binding_size at draw time (#2195) 2021-11-20 16:15:54 -05:00
adamnemecek efd52e02af use self 2021-08-20 19:36:06 -07:00
Benoît du Garreau e7269e72f3 Upgrade arrayvec to 0.7 2021-07-06 00:45:24 +02:00
Dzmitry Malyshau 568ac3fa24 Switch all bitflag names to plural 2021-06-30 14:43:36 -04:00
Gordon-F 2873ac32d9 Remove MPL 2.0 header in files 2021-06-19 21:06:08 +03:00
Dzmitry Malyshau 0a82c232ba hal: port the rest of wgpu-core 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau 569cd0cdd6 WIP new wgpu-hal 2021-06-08 00:46:08 -04:00
Connor Fitzgerald cf6f9c3ca8 Move from tracing to log + profiling 2021-03-17 01:22:30 -04:00
Dzmitry Malyshau 692e82d521 Reset the bindings on the push constant change 2021-02-11 14:47:35 -05:00
Dzmitry Malyshau 262d0c6dfc Isolate binding compatibility logic into a separate module 2021-02-04 01:16:40 -05:00
Dzmitry Malyshau 0345c56758 Properly implement compute pass usage scopes 2020-09-23 19:01:47 -04:00
Dzmitry Malyshau 1886149cae Don't bind groups that aren't expected by the layout 2020-09-04 23:47:24 -04:00
Dzmitry Malyshau dbd7e2c579 Separate valid internal IDs from external ones 2020-08-04 11:16:59 -04:00
Connor Fitzgerald cb485f3798 Convert all logging to tracing and add fmt logger 2020-07-25 19:33:21 -04:00
Connor Fitzgerald b9498952a1 Fix push constant pipeline invalidation 2020-07-24 18:19:36 -04:00
Connor Fitzgerald c8bcc50ed6 Implement PUSH_CONSTANTS feature 2020-07-13 12:47:09 -04:00
Connor Fitzgerald b4f2c02941 Validate dynamic bindings are in-bounds 2020-06-30 22:54:24 -04:00
Dzmitry Malyshau 7aa5753701 Re-architecture the bundles using normalized command streams.
This is a major change in how the bundles are implemented. Instead of
transparently injecting them into the pass command stream, we are now
treating bundles as first-class API objects and API tracing them
accordingly. The bundle contains a normalized command stream that is
very easy to inject into a native command buffer multiple times.
2020-06-11 15:34:45 -04:00
Dzmitry Malyshau afc4517db1 Render bundle reset states, updated descriptors 2020-06-11 15:28:55 -04:00
Dzmitry Malyshau a3aefe2535 Rustfmt stable pass 2020-04-06 08:55:39 -04:00
Joshua Groves b58c15815b Move more shared types into wgpu-types 2020-03-14 23:08:05 -02:30
Dzmitry Malyshau a0759b983d Fix binding compatibility of an absent group 2020-02-16 20:17:53 -05:00
Dzmitry Malyshau ab416bcc68 All the missing Gecko fixes 2020-02-09 20:15:55 -05:00
Dzmitry Malyshau bf8c9fe27b Make device tracker to be the last home for destroyed resources 2020-01-08 18:13:43 -05:00
Dzmitry Malyshau 7be921495d Fix clippy warnings and errors 2020-01-04 13:20:28 -05:00
Dzmitry Malyshau 0880986a97 Stop dynamic offset iteration when the bind groups stop 2019-11-28 14:36:36 -05:00
Dzmitry Malyshau 6c632d1366 Separate native from the core 2019-11-16 00:36:23 -05:00