Commit Graph
8897 Commits
Author SHA1 Message Date
Rob Parrett 5b2b6f514b Fix index buffer state not being reset in reset_state 2022-01-13 14:34:22 -05:00
Mikko Lehtonen 99b3a6ebfb metal: Set preserveInvariance for shader options
This enables invariance for metal, for stable vertex positions, which
are useful for depth prepass and similiar things.
2022-01-12 15:03:16 -05:00
Benoît du Garreau 9f37624592 Don't pin indexmap version 2022-01-12 13:31:40 -05:00
Dzmitry Malyshau 16edd91976 Support writeTexture for surface textures 2022-01-12 13:31:03 -05:00
Dzmitry Malyshau 6bc896fe8c hal/vk: use stencil read/write masks 2022-01-11 13:38:40 -05:00
Dzmitry Malyshau 36220b4da5 Update WGSL example shaders to use assignment ops 2022-01-11 11:45:33 -05:00
Dzmitry Malyshau 1bab287eae Update naga to c0b7ac7 2022-01-11 11:45:33 -05:00
Dzmitry Malyshau c0b7ac7f54 WGSL: assignment binary operators 2022-01-11 11:01:24 -05:00
Dzmitry Malyshau dbec075cdc Texture format MSAA capabilities 2022-01-11 09:32:25 -05:00
Dzmitry Malyshau 7555df952e Adjust the MSL stack size lower bound 2022-01-11 09:30:14 -05:00
Dzmitry Malyshau 01f62baad2 Limits 1D texture mips to 1 2022-01-10 12:22:49 -05:00
Igor Shaposhnik 298a8c30bd [wgsl-in] Write a real type in type mismatch error 2022-01-10 10:02:05 -05:00
Dzmitry Malyshau f8a63c4055 hal/gles: small fixes for external context 2022-01-08 12:32:17 -05:00
João Capucho 70b5ddaaad spv-out: use OpFRem instead of OpFMod 2022-01-07 20:19:15 -05:00
Samuel Hurel e924aa1a05 Add util::indirect helper structs 2022-01-07 11:39:26 -05:00
João Capucho a8929603ac spv-in: OpVectorInsertDynamic allow unsigned index 2022-01-07 11:08:04 -05:00
João Capucho eeb3de6f86 spv-in: sign agnostic unary operations 2022-01-07 11:03:44 -05:00
João Capucho e2fc32387b spv-in: more sign agnostic binary operations 2022-01-07 11:03:44 -05:00
xiaopengli89 10a07e4807 Add raw_device for dx12, vulkan device 2022-01-06 12:59:08 -05:00
Dzmitry Malyshau 043e36c59a Test WebGPU backend with extra features 2022-01-06 12:48:40 -05:00
Dzmitry Malyshau 4bfa2722f7 hal: limit binding sizes to i32 2022-01-06 12:37:26 -05:00
Dzmitry Malyshau eda3d4fa34 Update naga to 09d35f3 2022-01-05 23:33:43 -05:00
Dzmitry Malyshau 09d35f3631 gl-out: skip unsized types if unused 2022-01-05 23:11:43 -05:00
Lucas Kent b88808b454 Replace run-wasm-example.sh with aliased rust crate (xtask) 2022-01-04 23:56:47 -05:00
Jim Blandy 53eeb654aa [msl-out] Don't give level in texture1d accesses.
Fixes #1642.

Since 1d textures cannot have mipmaps, MSL requires that the `level` argument to
texel accesses and dimension queries be a constexpr 0. For our purposes, just
omit the level argument altogether.
2022-01-04 15:33:23 -08:00
Jim Blandy a1e8805360 Use ExpressionContext::resolve_type where appropriate. 2022-01-04 15:33:23 -08:00
Ibiyemi Abiodun 9a0f1b395c Add a way to emit errors with a path (#1640)
* Add a way to emit errors with a path

I am using `naga` in my build script to validate all of my shaders, and it would be nice to be able to display the file path inside of the diagnostic, so I added a method `emit_to_stderr_with_path` to `naga::front::wgsl::ParserError`.

* change path to &str

* fix rustfmt
2022-01-04 18:21:44 +00:00
Jakob Hellermann bec6ec6235 fix compilation on wasm32-unknown-unknown without webgl feature (#2355) 2022-01-04 16:09:48 +00:00
João Capucho 743d058b49 glsl-out: Use constructors shorthand for zero init 2022-01-04 13:52:00 +00:00
João Capucho b9c4893112 glsl-out: Write struct initializers 2022-01-04 13:52:00 +00:00
João Capucho 32205e3097 glsl-out: write array initializers 2022-01-04 13:52:00 +00:00
João Capucho 79233ba5e5 glsl-out: Fix array constants constructor 2022-01-04 13:52:00 +00:00
Dzmitry Malyshau 75b885b0ca hal/gles: support externally initialized contexts 2022-01-04 00:23:47 -05:00
Alex S 43f09fdb21 Don't create array layer trackers for 3D textures. 2022-01-03 14:09:20 -05:00
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