Keep track of the comparison property per global variable instead of type.
Only track images that can actually be comparison-sampled.
Instead of mutating the type, just add a new type in the end
if we detect it to be necessary, cloning the old name.
1190: Fix crash on zero init of buffer with no more ref count r=kvark a=Wumpf
**Description**
Previously, if a buffer would no longer have any reference, the zero init step crashed when trying to unwrap its ref_count.
**Testing**
Tested successfully on https://github.com/Wumpf/blub/commit/54a0f4ff13fcd969d87e4469067c6403999f79e2 where this problem would pop up
Co-authored-by: Andreas Reich <r_andreas2@web.de>
1191: Buffer zero init test for binding (and use in a compute shader) r=kvark a=Wumpf
**Connections**
Buffer zero init #1159
Buffer zero crash on unused buffer fix#1190
**Description**
Tried to create a player ron file repro case for #1190 but didn't work out quite well (test keeps buffers alive even when I tried to go through an indirection via buffer copies). But with a bit of cleanup the test still felt very useful since it gives more coverage to buffer zero init.
Generally zero init is hard to test since the way to get the result is to map it which is one particular case of requiring zero init. But there's a few ways like in this test here where we look at what modifications a compute shader did to a buffer - since the buffer was not explicitly initialized, the outcome would be different if the compute shader would have seen a buffer without zero init.
Given how few tests there are right now this ofc implicitly tests a bunch of other things ;)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
710: Implement read_buffer r=kvark a=fintelia
I'm not sure about the exact interface that makes sense, but this PR sketches out how read_buffer (and eventually also read_texture) could be implemented.
Resolves#694
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Co-authored-by: Jonathan Behrens <fintelia@gmail.com>
1201: Don't check the index format for non-indexed calls r=kvark a=kvark
**Connections**
Fixes#1200
**Description**
Avoid the check that shouldn't be done.
**Testing**
Not tested, but should work.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1198: Fix command allocator race condition with maintenance r=kvark a=kvark
**Connections**
Fixes#1196
**Description**
This was a recent change, where I thought it would be more pure to just prepare the pool but not create anything right away. It looked more elegant, but now we see it was flowed.
**Testing**
Not really tested the concurrent aspect of it, but it should work.
Perhaps, we can hook up Loom in the future for this task?
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1194: Isolate binding compatibility logic into a separate module r=cwfitzgerald a=kvark
**Connections**
Fixes#1188
**Description**
The actual problem was the following: when a pipeline changed, we used to go through the binding entries and re-bind only those that *became* compatible. However, we were missing ones that were already compatible, but were not activated because they were behind some previously incompatible ones.
So it's not a very complex fix. However, working with the binding code had me concerned that it wasn't isolated enough. It got quite a few issues discovered in it over the time, which only proven the point that it was way too fragile. So I took this opportunity to bring us closer to the world I want wgpu to be in: the world of semi-independent testable components.
This PR makes the binding compatibility checker one of these components. It's fully isolated, has unit tests, fairly straightforward to reason about, and integrates nicely with the render pass logic (without too many generics!). It's more profitable in the long run, I think, to build this kind of architecture versus integration-testing the thing (even at `wgpu` playtest level).
There is less magic overall now: no binding iterator, no fancy chaining, no complex matching. The logic is straightforward, hopefully. And the 40 LOC saved is a good indication of it.
**Testing**
Tested on wgpu-rs examples.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>