Commit Graph
8323 Commits
Author SHA1 Message Date
Connor Fitzgerald f0520f8c54 Merge pull request #1792 from ecton/surface-safety-docs
Document additional safety requirements of `Instance::create_surface`
2021-08-12 12:29:04 -04:00
Jonathan Johnson 494bde01c2 Added safety clarification to create_surface
This clarifies that the window that a surface is created on must be kept
alive for the lifetime of the surface. This requirement and a proposal
to change it are described in https://github.com/gfx-rs/wgpu/issues/1463
2021-08-12 09:04:02 -07:00
Dzmitry Malyshau d55645ac1e Fix bitflags at 1.2 (#1190) 2021-08-12 00:57:13 -04:00
Connor Fitzgerald 4dc0e265ac Merge pull request #1764 from kvark/submitted-work
Implement onSubmittedWorkDone
2021-08-12 00:06:45 -04:00
Dzmitry Malyshau 4a1ae0d7ec Issue surface texture transitions 2021-08-11 20:58:42 -04:00
Dzmitry Malyshau dffe1f1793 Return a texture by the surface 2021-08-11 20:58:42 -04:00
Dzmitry Malyshau f78061bcef Merge swap chain into surface 2021-08-11 20:58:42 -04:00
Jim Blandy 47b9f4a2e5 [spv-out] Writer::write_texture_coordinates: Fix result type. (#1188)
Some SPIR-V texture access instructions take coordinates as integers, others as
floats. The types of coordinates in Naga expressions generally match those in
SPIR-V, but Naga indices for arrayed textures are always integers, whereas
SPIR-V combines coordinates and array indices into a single vector, so indices
need to be cast to match the coordinate component type.

This commit makes `write_texture_coordinates` properly cast array indices to
match the coordinates' component type before combining them all into a single
result vector.

Fixes #1186.
2021-08-11 14:55:54 -07:00
Alex Es fd70116668 Proof of concept for "span" feature, with WGSL & GLSL parsing augmented. (#1092)
* Proof of concept for "span" feature, with WGSL parsing augmented.

* Review:

1) add_span was actually a bad idea, make it set_span and add
set_span_if_unknown too.
2) panics on getting/setting span for invalid handles.
3) only set span for constants with a name
4) don't overwrite spans for types.

* Added spans to blocks & more expressions getting spans in frontends.

Definitely the shotgunny type of commit, but what can you do. The design
I went with made spans mandatory to specify, so I had to go and wire
them through wherever I could.

* Moved Block to a separate module, +clippy

* More spans for types in GLSL.

* Remove pointless body method.

* Make Arena interface require spans.

Another shotgun commit, oh boy...

* Fix tests.

My loathsome habit to "quickly fix things along the way" made a lot of
extra work for me here, having to fix my "fixes" for WGSL parser.

* Rustfmt + clippy.

* Fix compile-errors with span feature enabled.

* Nuked set_span* from orbit. Deleting code feels great!

* Code review - move feature flags inside functions.

* Fix build with "deserialize" feature enabled.
2021-08-11 16:04:32 -04:00
Jim Blandy e2fc7ffd03 [spv-out]: Use OpCompositeConstruct's schmear behavior.
In `back::spv::Writer::write_texture_coordinates`, OpCompositeConstruct can
concatenate scalars and vectors, so when combining coordinates with an array
index, there is no need to extract the coordinate vector's components
individually: once the index has been converted to the appropriate component
type, it can be combined with the coordinates in a single instruction.
2021-08-11 11:22:43 -04:00
Jim Blandy 172f6bf62f [spv-out]: De-indent write_texture_coordinates with an early return.
No intended change in behavior.
2021-08-11 11:22:43 -04:00
Connor Fitzgerald 3afab9c5aa Splits non-uniform indexing into two different features (#1785) 2021-08-10 22:43:08 -04:00
Dzmitry Malyshau 67dd604b0c [wgsl-out] atomic load/stores, [glsl-out] revert the prefix 2021-08-10 21:48:02 -04:00
Dzmitry Malyshau 1121a815ac Separate enum for atomic binary operations 2021-08-10 21:48:02 -04:00
Dzmitry Malyshau 78f225a37a Implemented atomics in HLSL-out 2021-08-10 21:48:02 -04:00
Dzmitry Malyshau bc4576c0a2 Make atomic operations to be statements 2021-08-10 21:48:02 -04:00
Dzmitry Malyshau 88c1c9037d Add atomic exchange function 2021-08-10 21:48:02 -04:00
Dzmitry Malyshau 8c371e8063 Atomic expressions, support in backends except HLSL and the validator. 2021-08-10 21:48:02 -04:00
Dzmitry Malyshau 33db45e681 Atomic parsing in WGSL 2021-08-10 21:48:02 -04:00
Dzmitry Malyshau 8cb09c24c5 Atomics in the IR 2021-08-10 21:48:02 -04:00
Connor Fitzgerald 551b711943 [spv-in] use grad image operand 2021-08-10 16:38:34 -04:00
Connor Fitzgerald a60d2f6f3b Merge pull request #1774 from ElArtista/gles_storage_limits 2021-08-10 13:09:49 -04:00
João Capucho e384bce771 [glsl-in] Don't clone HirExpr when lowering 2021-08-10 11:18:08 -04:00
Dzmitry Malyshau 07c286255d [spv-in] fix struct spans for layout-less structs 2021-08-09 21:19:31 -04:00
Dzmitry Malyshau 021bfd5289 [hlsl-out] fix member offset consideration for storage buffers 2021-08-09 16:45:07 -04:00
João Capucho c73c1efe33 [glsl-in] Apply comments 2021-08-09 10:51:15 -04:00
João Capucho b0b4891045 [glsl-in] Document public api 2021-08-09 10:51:15 -04:00
João Capucho 48a4a9b902 [glsl-in] Cleanup public api 2021-08-09 10:51:15 -04:00
João Capucho 1aaf77489b [glsl-in] Improve error api and make more errors deferred 2021-08-09 10:51:15 -04:00
João Capucho f6e35f5b66 [glsl-in] Improved preprocessor and error handling 2021-08-09 10:51:15 -04:00
João Capucho a8a316da15 [glsl-in] API revamp
The new api allows for reuse while keeping some allocations and to
please the borrow checker in future work, it also splits the parser into
logical modules to make it easier to work on.
2021-08-09 10:51:15 -04:00
Agorgianitis Loukas 8796089636 Gather downlevel flags and require them all at once 2021-08-07 11:17:43 +03:00
Agorgianitis Loukas 5bc42843cf Add downlevel flag for storage buffers in vertex shaders 2021-08-06 21:22:16 +03:00
Connor Fitzgerald 7798534d42 Merge pull request #1773 from pythonesque/patch-1
Fix dynamic offset handling for render bundles
2021-08-06 13:55:51 -04:00
Joshua Yanovski bff04c1502 Fix dynamic offset handling for render bundles
I found this while testing a "bundlemark" version of bunnymark.
2021-08-06 10:38:35 -07:00
Agorgianitis Loukas dd24b48b11 Fix scissor test leak when presenting gles backend (#1772)
* Fix scissor test leak when presenting gles backend

* Set color mask before presenting gles backend to avoid potential leak
2021-08-06 10:54:09 -04:00
Zicklag 9310f264f1 Update Naga With New Storage Classes API (#1766) 2021-08-05 13:50:51 -04:00
João Capucho 0bd78ef85e [spv-out] Use NotEqual for boolean casts 2021-08-05 13:48:26 -04:00
Dzmitry Malyshau 7c3cc904a0 [spv-in] fix storage buffer access decorations 2021-08-05 12:59:19 -04:00
Zicklag 300039e247 Fix Invalid Type Attribute Error Message
The message previously made reference to the now-removed `access`
attribute.
2021-08-05 10:12:23 -04:00
Zicklag 553fc52f67 Implement adapter_is_surface_supported() for Web (#1767) 2021-08-05 10:01:43 -04:00
Gordon-F 4080bfe502 Add vec select to operators snapshot 2021-08-05 09:43:47 -04:00
Gordon-F b2e51c97c8 [glsl-out] Handle wgsl vector version of select 2021-08-05 09:43:47 -04:00
João Capucho 2ff7dcb417 [glsl-in] Fix mix ordering for boolean selector
The mix builtin is defined with the inverse order for it's arguments
compared to the IR when the selector is a boolean vector.
2021-08-04 12:39:36 -04:00
João Capucho a1395ddb99 [glsl-in] Fix matrix constructor with a scalar
Glsl defines that if a matrix constructor is called with only a scalar
it's result will be the matrix where the scalar is used if the row and
column are equal and everywhere else a zero
2021-08-04 12:39:36 -04:00
João Capucho 151a36352e [glsl-in] Be more conservative with vector resizes 2021-08-04 12:39:36 -04:00
João Capucho de6399a9c7 [glsl-in] Follow spec when choosing default layout 2021-08-04 12:39:36 -04:00
João Capucho 5ec129bbf0 [glsl-in] Lower the for loop init expression 2021-08-04 12:39:36 -04:00
João Capucho ec0d97d961 [glsl-in] Respect user defined interpolation 2021-08-04 12:39:36 -04:00
Dzmitry Malyshau 6f21004369 Allow mixing on a scalar selector 2021-08-04 12:09:05 -04:00