Commit Graph
8897 Commits
Author SHA1 Message Date
Jasper St. Pierre 8729391e53 [glsl-in] Fix function lookup
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.
2021-06-27 21:54:04 +01:00
Aron Granberg 407ee82825 Fix stray header in changelog 2021-06-27 17:19:51 +02:00
Aron Granberg f0919141e2 Update changelog 2021-06-27 17:17:31 +02:00
Aron Granberg 6416bc5b68 Fix check for QUERY_SET_MAX_QUERIES was using >= instead of > 2021-06-27 17:08:49 +02:00
bors[bot]andAndreas Reich 8332493d3d Merge #1559
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>
2021-06-27 14:27:27 +00:00
Andreas Reich a745383516 Do multiple queries in pipeline-statistics-query test 2021-06-27 11:20:53 +02:00
Andreas Reich b44b5eded9 Fix query stride handling
Fixes #1374
2021-06-27 11:20:38 +02:00
Andreas Reich 2525d6ce9d Add player test for pipeline statistics 2021-06-27 08:43:48 +02:00
bors[bot]andDzmitry Malyshau 3ea833ea50 Merge #1558
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>
2021-06-27 05:45:16 +00:00
Dzmitry Malyshau 5ca1fe58e9 Update naga to 57b3256020 2021-06-27 01:44:49 -04:00
Dzmitry Malyshau 57b3256020 [glsl-out] binding location mapping 2021-06-27 01:09:53 -04:00
Gordon-F 19de60f6e4 [hlsl-out] Implement more expressions 2021-06-26 13:15:44 -04:00
Gordon-F 24b2c548bd [hlsl-out] Add note about entry points in ReflectionInfo 2021-06-26 13:15:44 -04:00
Jim Blandy c156fa9ad3 [spv-out] Properly reset Writers between module writes.
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.
2021-06-26 12:54:53 -04:00
Jim Blandy f0d41c3fd6 [spv-out] Track block termination statically.
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.
2021-06-26 12:45:47 -04:00
Andreas Reich 11b5e10c38 Fix Vulkan not advertising TIMESTAMP_QUERY & PIPELINE_STATISTICS_QUERY 2021-06-26 14:34:44 +02:00
Igor Shaposhnik 1f42d4f227 Fix CI validation tasks 2021-06-24 17:26:35 -04:00
Gordon-F a8119f005e Add extra fragment entry point to wgsl quad snapshot 2021-06-24 10:47:17 -04:00
Gordon-F e28344edbb [hlsl-out] Return entry points name to users 2021-06-24 10:47:17 -04:00
Gordon-F 391983459a [hlsl-out] Add enum with supported shader models 2021-06-24 10:47:17 -04:00
Gordon-F c9a782f8d6 [hlsl-out] Fix panic with shader with multiple entry points without argument 2021-06-24 10:47:17 -04:00
Gordon-F 1c5d538ab4 [glsl-out] Add entry point name to snapshot file name 2021-06-24 10:47:17 -04:00
bors[bot]andDzmitry Malyshau ebe2152719 Merge #1550
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>
2021-06-24 14:06:28 +00:00
bors[bot]andIgor Shaposhnik 8ddb3be82b Merge #1554
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>
2021-06-24 12:26:08 +00:00
Igor Shaposhnik 7df4815c41 Remove gfx-rs development section from wgpu README 2021-06-24 15:05:17 +03:00
bors[bot]andConnor Fitzgerald 86e4b9ba03 Merge #1549
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>
2021-06-24 05:42:57 +00:00
Dzmitry Malyshau cfed43face Update submission indices on all stateless resources 2021-06-24 01:40:18 -04:00
Connor Fitzgerald f1a6fe12db Fix cargo-tarpaulin 2021-06-24 01:30:17 -04:00
bors[bot]andConnor Fitzgerald 632f85b703 Merge #1538
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>
2021-06-24 04:43:25 +00:00
Connor Fitzgerald 7b3a7db72e Disable CI testing pending further investigation 2021-06-24 00:39:16 -04:00
Connor Fitzgerald 9377149e85 Remove holes from wgpu-info 2021-06-23 21:29:44 -04:00
Connor Fitzgerald cfb84748bf Exclude llvmpipe due to segfaults 2021-06-23 20:51:24 -04:00
Connor Fitzgerald b060bf1afe Assorted touchups 2021-06-23 20:23:19 -04:00
Connor Fitzgerald 3356f5f993 PR comments 2021-06-23 19:10:11 -04:00
Connor Fitzgerald 18ac365f79 Please CI 2021-06-23 19:10:11 -04:00
Connor Fitzgerald c0664c2bb7 Begin robust exception system 2021-06-23 19:10:11 -04:00
Connor Fitzgerald ad0c8d4f78 Add documentation 2021-06-23 19:10:11 -04:00
Connor Fitzgerald 382fc751c7 Keep raising the mipmap limit 2021-06-23 19:10:11 -04:00
Connor Fitzgerald ccef63e914 Isolate hello-compute examples to own file 2021-06-23 19:10:11 -04:00
Connor Fitzgerald f47a54009d Finish reftest and test running infra 2021-06-23 19:10:11 -04:00
Connor Fitzgerald 54f1b0ac01 Begin wgpu-info 2021-06-23 19:10:11 -04:00
Connor Fitzgerald d094712cd4 Make screenshots pass on laptop 2021-06-23 19:10:11 -04:00
Connor Fitzgerald ec74722d57 Add image comparison to all examples 2021-06-23 19:10:11 -04:00
Connor Fitzgerald 22b8e2851f Remove loom 2021-06-23 19:10:11 -04:00
Connor Fitzgerald ebbbf2216b Add image comparison to the mipmap example 2021-06-23 19:10:11 -04:00
Connor Fitzgerald 3d8a4baeb8 Add out multiple tests of vertex pulling 2021-06-23 19:09:45 -04:00
Connor Fitzgerald 528a311dd1 Get test functioning 2021-06-23 19:09:44 -04:00
Connor Fitzgerald cfda2258f5 Finish fs_main 2021-06-23 19:09:44 -04:00
Connor Fitzgerald 6432c4f6d8 Massively refactor testing infrastructure to better share code 2021-06-23 19:09:44 -04:00
Connor Fitzgerald 03c7f0097a Unify testing and examples and add useful external utilities 2021-06-23 19:09:44 -04:00