Commit Graph
9013 Commits
Author SHA1 Message Date
Dzmitry Malyshau 8003e3e30a Validate structure resource types 2022-01-03 12:44:58 -05:00
Vinh Truong 6aca3e0b36 Fix data packing functions on MSL (#1637)
* Fix data packing functions on MSL

`snorm` and `unorm` got mixed up.

* Fix bits.msl
2021-12-31 16:44:54 +00:00
Dzmitry Malyshau 55cbbdea62 metal: fix surface texture clear view 2021-12-31 11:41:00 -05:00
Dzmitry Malyshau a1251dc36a Improve detection and validation of cubemap views 2021-12-30 11:34:40 -05:00
Dmitry Sharshakov 52f11d8d1f Search for different versions of libwayland
Workaround for distributions that do not have symlinks for Wayland libraries

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
2021-12-30 10:58:39 -05:00
Connor Fitzgerald 276de0e2d6 Fix trac(y/ing) compile issue 2021-12-30 10:46:07 -05:00
Benoît du Garreau 66a661d14b Update ash to 0.35 2021-12-29 10:26:53 -05:00
João Capucho 1d0f484b37 glsl-in: fix composite constructors (#1631)
* glsl-in: Remove unneeded mutability from reference

* glsl-in: Fix composite constructors

In the recent rework of the constructors it seems that the logic for
composite types (arrays and structs) was accidentally removed by me.
2021-12-28 20:16:56 -05:00
Wumpf 2fa75aaf05 Do texture init via clear passes when possible (#2307)
* CLEAR_COMMANDS extension is now more of a window into wgpu zero-init
this has mostly implications on the constraints, but also allows a more leaky documentation which makes sense for this non-standard function as there is no other place to look it up

* clear_texture via renderpasses wip

* 3D depth textures are no longer allowed, volumes are always cleared via CPY_DST

* cleanup texture's clear_views

* rename CLEAR_COMMANDS to CLEAR_TEXTURE

* separate clear_texture into reusable & more descriptive parts

* texture clear views are now created ahead of time

* discarded surface fixup goes through new clear_texture method now

* onq ueue texture initialization now goes threw clear_texture
pending inits need to store Stored textures now though, causing more ref count bumping

* texture init on queue_write_texture now also goes through new clear_texture

* transfer functions on commandbuffer use now new texture init route

* merge collect_zero_buffer_copies_for_clear_texture into clear_texture_via_buffer_copies

* clear functions now take TextureInitRange

* Fix clippy lints

* command_encoder_clear_texture no longer takes write lock on texture

* TextureClearMode encodes now is_color

* code cleanup, mostly about `use`

* Handle volume textures in clear_texture_via_render_passes properly

* texture clear no longer requires id::Stored

* init tracking fixes for volumes and init on partial subresource writes

* texture creation enforces COPY_DST only if absolutely necessary

* unrolled functional chain, reduce unsafe scope size

* fix clippy lints

* clear_texture test no longer creates 1D textures

see #2323

* 3D textures are no longer cleared as render target since this isn't supported on Metal

* fix deno building issue, fix formatting

* TextureInner::Surface can now be zero initialized
2021-12-28 17:05:53 -05:00
victorvde 588777fa2d explicitly set Vulkan debug message types instead of !empty() (#2321)
Fixes:
  The Vulkan spec states: messageType must be a valid combination of VkDebugUtilsMessageTypeFlagBitsEXT values

Full message:
VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-parameter(ERROR / SPEC): msgNum: -553000032 - Validation Error: [ VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-parameter ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xdf09e3a0 | vkCreateDebugUtilsMessengerEXT: value of pCreateInfo->messageType contains flag bits that are not recognized members of VkDebugUtilsMessageTypeFlagBitsEXT The Vulkan spec states: messageType must be a valid combination of VkDebugUtilsMessageTypeFlagBitsEXT values (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-parameter)
    Objects: 1
        [0] 0, type: 3, name: NULL
2021-12-28 00:15:20 -05:00
Dzmitry Malyshau 2738ad80b9 msl: fix packed vec access (#1634) 2021-12-28 05:13:13 +00:00
João Capucho 5a26606a09 glsl-in: Fix using swizzle as out arguments (#1632)
This worked at one point but because of some changes to the IR it was
temporarily broken.
2021-12-27 19:09:33 -05:00
Dzmitry Malyshau b1ab59925d msl: fix packed float support (#1630) 2021-12-27 02:57:47 +00:00
Jeff Muizelaar 848ae3dc6e Turn on panic = "abort" by default (#1597)
This reduces the size of a release naga binary on macOS
from 3.5MB to 3.2MB. It's also the configuration we use
for naga in Firefox.
2021-12-26 20:01:49 -05:00
Dzmitry Malyshau f2832b8999 hlsl: support arrays of matrices (#1629) 2021-12-27 00:30:57 +00:00
Luke Street 0d1fc2131f [wgsl-in] Support radians/degrees builtin functions (#1627) 2021-12-27 00:29:33 +00:00
Wumpf bdfddca628 [dx12] Fix partial texture barrier not affecting stencil aspect (#2308)
* [dx12] Fix partial texture barrier not affecting stencil aspect
Fix clearing of D24Plus also clearing "hidden" stencil

* [dx12] fix handling stencil only formats for clears & barriers
2021-12-26 12:07:08 -05:00
Wumpf b0654e17af [example] fix conserative-raster low res target getting zero sized on resize (#2318)
* [example] fix conserative-faster low res target getting zero sized on resize

* [sample] conservative-raster: fix low res target aspect ratio being wrong
2021-12-26 12:02:21 -05:00
Dzmitry Malyshau 39b7a8a202 Update naga to 8df5421 2021-12-25 00:03:15 -05:00
TheOnlyMrCat 61fa8a3b63 Implement push constants for metal backend (#2314)
* Implement push constants for metal backend

* Clear push constants on reset; get upload size from layout
2021-12-24 19:49:57 +00:00
Igor Shaposhnik 8df5421e2e [glsl-out] Add stage postfix to generated global name (#1616) 2021-12-23 22:19:07 -05:00
Josh Groves 97e6ea7b71 Improve shader source documentation (#2315)
- remove outdated note about WGSL web support
- try to combine the note about parsing/validation/translation
2021-12-24 03:00:57 +00:00
Alphyr 890f326461 Update ash to 0.34 (#2313) 2021-12-23 11:23:13 -05:00
Jonathan Behrens a3b9fc3af6 Make ShaderSource #[non_exhaustive] 2021-12-22 17:15:57 -05:00
Jay Oster 924ab17b62 Fixes for fma function (#1580)
* [hlsl-out] Write `mad` intrinsic for `fma` function

- This should be enough because we only support f32 for now.
- Adds a new test for WGSL functions, in the spirit of operators.wgsl.
- Closes #1579

* Add FMA feature to glsl backend

- I think this is right. Just iterate all known expressions in all
  functions and entry points to locate any `fma` function call.
  Should not need to walk the statement DAG.

* Transform GLSL fma function into an airthmetic expression when necessary

* Add tests for GLSL fma function tranformation

* Remove the hazard comment from the webgl test input

* Add helper method for fma function support checks

* Address review comment
2021-12-22 09:41:07 -05:00
Jakob Hellermann 54178dede2 impl Clone for WithSpan<E> (#1620) 2021-12-21 20:14:10 +00:00
Jonathan Behrens f9b348557a Add FindLsb / FindMsb (#1473)
* Add FindLsb / FindMsb

* Fixes and tests for FindLsb/FindMsb

* Add findLsb / findMsb as WGSL builtins

* Fix tests

* Fix incompatible type issue with MSL output

* Requested changes

* Test fewer cases of findLsb/findMsb
2021-12-20 14:48:54 -05:00
Dzmitry Malyshau 54f20bedef hal/dx12: Fix UMA check 2021-12-19 00:09:35 -05:00
MultisampledNight b19288a78b Add defaults to new limits and correct older ones 2021-12-18 17:29:49 -05:00
Dzmitry Malyshau c00e471274 Release 0.12 v0.12 2021-12-18 12:36:41 -05:00
Dzmitry Malyshau c2328fea75 Release v0.8 2021-12-18 12:05:12 -05:00
Dzmitry Malyshau 8caa2bd87e Gather operations 2021-12-18 11:46:49 -05:00
Jim Blandy db98743a5a [glsl-out] Don't return early from snapshot tests. 2021-12-17 20:27:27 -05:00
Ashley 75ce45d4f3 spv-in: fix support for degrees and radians conversion 2021-12-17 11:56:47 -05:00
Christofer Nolander d13e9e3b83 wgsl-in: correctly parse else if (#1611)
* wgsl-in: correctly parse `else if`

* wgsl-in: use early exit in `else if` parsing
2021-12-17 16:19:38 +00:00
João Capucho e1552fd9d5 wgsl-in: Implement matrix construction from scalar 2021-12-17 10:39:31 -05:00
Dzmitry Malyshau ec1d022a75 Error scopes API (#2299) 2021-12-17 04:39:48 +00:00
João Capucho 33c1daecee glsl-in: Cull the body of do while if needed 2021-12-16 18:42:59 -05:00
Dzmitry Malyshau 18f644e19b hal: check for surface caps in the example (#2298) 2021-12-16 21:41:45 +00:00
João Capucho 322be0772e spv-in: Implement CompositeInsert for arrays
Only adds support for unspecialized arrays
2021-12-16 16:31:51 -05:00
Dzmitry Malyshau 6df9656e96 spv-out: Force wrapping of push constant structs 2021-12-16 16:21:06 -05:00
Dzmitry Malyshau 7bb886bf36 Enforce casting width better, fix IEqual/INotEqual in spv 2021-12-16 16:14:56 -05:00
João Capucho 12baa1e909 spv-in: Implement OpCopyObject
Treat it as a noop since the IR has no concept of copying objects
2021-12-16 13:11:20 -05:00
João Capucho 2a8d64fc59 spv-in: Implement remaining sign agnostic ops 2021-12-16 11:22:16 -05:00
João Capucho cf0c31cc85 spv-in: Allow branch weights in OpBranchConditional 2021-12-16 10:58:27 -05:00
João Capucho 9c75f3cdce glsl-in: Flatten entry point arguments
The IR doesn't allow having structs has bindings for entry point
input/output, so the glsl frontend must flatten them.

Glsl defines that the locations are sequential from the block base location.
2021-12-16 10:55:06 -05:00
stshine f42342bbbf hal/dx12: enable TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES (#2295) 2021-12-16 14:40:19 +00:00
João Capucho 049b48b319 spv-in: Remove if when both branches are equal 2021-12-15 23:55:20 -05:00
João Capucho 4334f0e6a9 Support bitwise And on booleans 2021-12-15 23:53:23 -05:00
João Capucho c64d5eff50 Support bitwise Or on booleans 2021-12-15 23:53:23 -05:00