First look for exact matches before trying the implicit
lookup. Otherwise, finding two wrong matches first will
result in an ambiguous function error.
This logic could use with a bit of a cleanup, keeping
track of a closer score and doing more exact matching
on types, but this might be good enough for now.
1559: Query support fixes r=kvark a=Wumpf
**Connections**
Fixes#1374 for master
If PR is accepted,I already have a fix for 0.9 which came out as a sideproduct: https://github.com/Wumpf/wgpu/tree/v0.9-fix-buffer-init-on-query-resolve
**Description**
Fixes:
* (affects master, v0.8, v0.9) query resolve operation not marking buffers as initialized
* (affects master) Broken query stride handling for Vulkan
* (affects master) Vulkan not advertising query support
**Testing**
* added new test
* mipmap sample
Co-authored-by: Andreas Reich <r_andreas2@web.de>
1558: Update naga to 57b3256020 r=kvark a=kvark
**Connections**
Needed for #1510
Picks up https://github.com/gfx-rs/naga/pull/1039 and https://github.com/gfx-rs/naga/pull/916
**Description**
Updates Naga to latest on Git. Refactors the use of `ResourceBinding` and Metal's binding map.
Also enables safe bound check handling on Vulkan (`Restrict` policy, cc @jimblandy).
**Testing**
Examples.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
A single `Writer` can be reused to convert any number of Naga IR modules to
SPIR-V. This lets us reuse the heap allocations, but makes us responsible for
resetting the state of the `Writer` fully between modules. The old code
neglected to clear several different fields: logical_layout (all fields),
lookup_type, and cached_constants.
This commit uses Rust struct literal expressions to construct the re-initialized
`Writer`, which makes the compiler check that each field has been handled.
It also introduces a policy limiting how much storage will be retained, so that
processing the occasional whale doesn't leave us with leviathan buffers
permanently.
Rather than giving `Block` an optional `terminator` field in addition to its
`body`, track block termination statically, with two types:
- `Block` is a block without a termination instruction. This is what most code
generation functions operate on.
- `TerminatedBlock` is a block with a termination instruction. This is what
`Function::blocks` holds.
The `Function::consume` method takes a `Block` by value, together with a
termination instruction, and turns it into a `TerminatedBlock`.
This lets us remove some unwraps and awkward conditions.
As part of this change, `Writer::write_block` no longer hits an `unimplemented!`
for Naga statements following `Break`, `Return`, and so on. Instead, it simply
doesn't emit code for them, which is a correct translation. If we want to forbid
these, we should handle that in validation instead.
1550: Update submission indices on all stateless resources r=pythonesque a=kvark
**Connections**
This is partially a regression by #1547, but also fixing more things.
**Description**
We stopped tracking the stateless resources included in bind groups. But we still need to update their submission indices, so that they don't get removed too early.
The PR also does the same for render bundles, but with a twist: bind groups used in a bundle are merged early.
**Testing**
untested
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1554: Remove gfx-rs development section from wgpu README r=grovesNL a=Gordon-F
Outdated part of README.
Co-authored-by: Igor Shaposhnik <Gordon-F@users.noreply.github.com>
1549: Fix cargo-tarpaulin r=kvark a=cwfitzgerald
I have no way of actually testing this is tarpaulin is linux only, but this should work
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
1538: Implement Integration and Example Tests r=kvark a=cwfitzgerald
**Connections**
Closes#1379! Closes#1465.
**Description**
This adds a testing framework for wgpu. This includes testing infrastructure for integration and example based reftests and other tests.
I have added env-based adapter and backend choices as a common utility in wgpu-rs. This is how the framework based examples choose their adapters, so WGPU_ADAPTER_NAME is how you can choose adapters based on a substring of the name.
I added explicit seeding to all examples that use random numbers so reftesting was deterministic. conservative-raster, mipmap, and texture-arrays (#1532) are broken and are marked as such. This testing framework will make CI fails if this is fixed, so tests don't fall out of date.
Note: as we get more integration tests, we can factor out more of the `pulling_common` to be common between all the tests.
**Testing**
It is testing :)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>