Commit Graph
8897 Commits
Author SHA1 Message Date
Tnze e9d68a332d [rs] Use the "max" function to ensure that the swapchain size is not less than 1. For better readability. 2021-02-09 14:20:22 +08:00
Dzmitry Malyshau 4f19903f46 [wgsl] fix variable initializers wrt control flow 2021-02-09 00:47:41 -05:00
Dzmitry Malyshau 5b94ecd9b2 Add a snapshot for parsing spirv input 2021-02-08 15:59:47 -05:00
Dzmitry Malyshau cf0a86afd4 [spv-in] move all the image-related logic into a sub-module 2021-02-08 15:59:47 -05:00
Dzmitry Malyshau 6b9d3eafc8 [spv-in] Rewrite the comparison image/sample handling.
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.
2021-02-08 15:59:47 -05:00
Dzmitry Malyshau 10867879d4 [spv-in] support projection sampling and sampling from arrays 2021-02-08 11:31:45 -05:00
Dzmitry Malyshau 680fda9e1b [spv-out] fix initial ID 0 and 1 assignments 2021-02-08 00:20:37 -05:00
Dzmitry Malyshau 76094aa553 [mtl] fix nested loop service variable 2021-02-08 00:13:12 -05:00
Joshua Groves 832e259a03 Ues updated paths in Makefile 2021-02-07 18:16:26 -05:00
Joshua Groves 31be7099f2 Move snapshot inputs and outputs around 2021-02-07 18:16:26 -05:00
bors[bot]andImbris f72ff5e1ee [rs] Merge #752
752: Expose missing constants from wgpu-types r=cwfitzgerald a=Imberflur



Co-authored-by: Imbris <imbrisf@gmail.com>
2021-02-07 20:11:22 +00:00
Imbris 5a9801d86c [rs] Expose missing constants from wgpu-types 2021-02-07 15:08:17 -05:00
Dzmitry Malyshau 6f50ca6bee Push constant support 2021-02-07 11:54:56 -05:00
Dzmitry Malyshau 960aabec20 [spv-in] Implement OpCompositeInsert 2021-02-07 11:49:52 -05:00
Dzmitry Malyshau 75427cf95c [spv-in] handle matrix decorations 2021-02-07 11:44:47 -05:00
João Capucho 993521965d Add support for unary ops to glsl 2021-02-06 22:23:09 -05:00
bors[bot]andAndreas Reich dc18ac72e4 Merge #1190
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>
2021-02-06 22:15:44 +00:00
bors[bot]andAndreas Reich 9841b9b5dd Merge #1191
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>
2021-02-06 22:07:22 +00:00
João Capucho 708751a805 Add support for relational functions to glsl-in 2021-02-06 16:57:30 -05:00
João Capucho da8f9ecbb9 Add support for more math functions in glsl-in 2021-02-06 16:57:30 -05:00
João Capucho e0005211a3 Fix the way equality is handled in glsl 2021-02-06 16:04:24 -05:00
36fde2821b [rs] Merge #710
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>
2021-02-06 20:53:26 +00:00
Jonathan Behrens 7a02bfca78 [rs] Implement read_buffer utility function 2021-02-06 11:22:37 -05:00
bors[bot]andDzmitry Malyshau 0abcb247ca Merge #1201
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>
2021-02-06 15:59:27 +00:00
Dzmitry Malyshau d0dcb105f5 Don't check the index format for non-indexed calls 2021-02-06 10:58:46 -05:00
Dzmitry Malyshau 251f800825 Remove the typifier hack for void functions 2021-02-06 10:42:54 -05:00
Dzmitry Malyshau d0c84a5ffa [spv-in] support for void function calls 2021-02-06 10:42:54 -05:00
Dzmitry Malyshau 11a3ed9837 WGSL support for void function calls 2021-02-06 10:42:54 -05:00
Dzmitry Malyshau d949d58f7b Statement for void function call 2021-02-06 10:42:54 -05:00
Andreas Reich fd810f839e merged buffer-zero-init-for-binding and buffer-zero-init-for-mapping-and-writing tests 2021-02-06 12:09:38 +01:00
Andreas Reich 3486fde638 Fix crash on zero init of buffer with no more ref count
Previously, if a buffer would no longer have any reference, the zero init step crashed when trying to unwrap its ref_count.
2021-02-06 11:11:10 +01:00
João Capucho f9f41fc9bf Add support for more math functions in glsl 2021-02-06 00:41:00 -05:00
João Capucho 2f9c957198 Add support for pow and fix mix arguments 2021-02-06 00:41:00 -05:00
João Capucho ae72fb0933 Add support for component wise comparison to glsl 2021-02-06 00:41:00 -05:00
João Capucho 647dd76dba Moved the ConstantSolver to the glsl frontend 2021-02-06 00:25:30 -05:00
João Capucho 88eee833d7 Add binary op support for the ConstantSolver 2021-02-06 00:25:30 -05:00
bors[bot]andImbris 21f0e66074 [rs] Merge #745
745: Bump wgpu-core r=kvark a=Imberflur

For the fix of this issue https://github.com/gfx-rs/wgpu/issues/1188

Co-authored-by: Imbris <imbrisf@gmail.com>
2021-02-06 05:16:11 +00:00
Imbris b1e535d2b7 [rs] Bump wgpu-core 2021-02-05 22:02:48 -05:00
Dzmitry Malyshau b1fa7471d2 Basic image query support in SPV and WGSL frontends 2021-02-05 15:26:45 -05:00
Dzmitry Malyshau 50f0ad6249 Image queries 2021-02-05 15:26:45 -05:00
Dzmitry Malyshau c496c05ba4 Makefile commands for native shader validation 2021-02-05 14:04:02 -05:00
Dzmitry Malyshau f9eb133370 [rs] Experimental ReadBuffer structure 2021-02-05 12:59:49 -05:00
Dzmitry Malyshau ac27a1abaa Don't break upon a void function in the typifier 2021-02-05 10:08:34 -05:00
bors[bot]andDzmitry Malyshau 3ebe198911 Merge #1198
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>
2021-02-05 05:59:16 +00:00
Dzmitry Malyshau e357e3083a Fix command allocator race condition with maintenance 2021-02-05 00:57:18 -05:00
bors[bot]andDzmitry Malyshau c513bb03a6 Merge #1194
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>
2021-02-05 02:29:45 +00:00
Dzmitry Malyshau f563b5810b [spv-in] support OpImage, OpImageFetch, OpLogicalOr, OpLogicalAnd, relational functions, and fix OpUndef 2021-02-04 09:49:40 -05:00
Dzmitry Malyshau 423ccc2074 [spv-in] parse OpConstantNull and OpUndef 2021-02-04 09:49:40 -05:00
Dzmitry Malyshau 0970ef0ea5 [spv-in] derive the block status of a structure from its members 2021-02-04 09:49:40 -05:00
Dzmitry Malyshau 262d0c6dfc Isolate binding compatibility logic into a separate module 2021-02-04 01:16:40 -05:00