50 Commits
Author SHA1 Message Date
Andy Leiserson 0c629bb3c2 [naga] cli support for process_overrides compaction (#7792) 2025-06-26 14:12:18 -07:00
Zachary HarroldandConnor Fitzgerald 4c39227510 Allow Naga spv-in and spv-out in no_std (#7760)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-26 16:45:47 -04:00
Andy Leiserson 82fa8e2a94 [naga] Remove non-essential override references via compaction
Adds a mode to compaction that removes unused functions, global
variables, and named types and overrides. This mode is used
everywhere except the compaction at the end of lowering, where
it is important to preserve unused items for type checking and
other validation of the module.

Pruning all but the active entry point and then compacting makes
`process_overrides` tolerant of missing values for overrides that are
not used by the active entry point.

Fixes #5885
2025-06-12 14:22:18 +09:00
Andy Leiserson 096f1f1f6d [naga] Remove the compact feature 2025-06-12 14:22:18 +09:00
Andy Leiserson 850c3d4310 [naga] Write only the current entrypoint (#7626)
Changes the MSL and HLSL backends to support writing only a single entry
point, and uses them that way in wgpu-hal.

This is working towards a fix for #5885.

* Increase the limit in test_stack_size
2025-04-30 09:59:41 +02:00
bf8cc43a15 Add stderr and termcolor features to Naga (#7482)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-04-18 21:06:22 +00:00
Connor Fitzgerald 45d8f42513 Use workspace package information everywhere 2025-04-10 20:41:28 -04:00
Connor Fitzgerald 8c2c2ce203 Release v25 (#7505) 2025-04-10 16:13:02 +00:00
Zachary Harrold 175b66c796 Update codespan-reporting to 0.12 (#7398)
* Update `codespan-reporting` to 0.12

* Use explicit path for `term::termcolor`

* Revert changes to `Cargo.lock`
2025-03-26 02:10:30 +00:00
Bruce Mitchener f89ede7cd8 [doc] Fix unbalanced backticks (#7385) 2025-03-21 03:03:37 +00:00
Wouter de Bruijn dfb09c260f naga-cli: forward '--keep-coordinate-space' flag to GLSL backend (#7206) 2025-02-24 23:21:48 +00:00
Connor Fitzgerald 8caefceb8e Add rust-version to more crates (#7036) 2025-01-31 10:33:10 +01:00
@brody4hire - C. Jonathan Brody a8cc83e17a avoid default features in many dependencies (etc.) (#7031) 2025-01-30 10:30:42 -05:00
Connor Fitzgerald d8e7ab1ad1 Refactor Cargo.toml Significantly (#6980) 2025-01-23 22:49:48 +00:00
Connor Fitzgerald 779261e64d Release v24 (#6923) 2025-01-15 16:29:22 -05:00
Connor Fitzgerald fdb6266d36 Update Some Repository Documentation (#6708)
* Update Some Repository Documentation

* Capitalization
2024-12-12 04:54:42 +00:00
Erich Gubler 16f012bc93 fix(naga-cli): allow output files with --stdin-file-path 2024-10-31 16:13:48 -07:00
Erich Gubler 25f0819edd feat(naga-cli)!: init. logger to INFO by default 2024-10-30 10:25:34 -07:00
Erich Gubler 08c9d8c397 chore: bump WGPU workspace crates to 23 2024-10-30 07:14:10 -07:00
Erich Gubler 7aa00a07e1 refactor(naga-cli): inline emit_annotated_error 2024-10-22 14:42:27 -04:00
Erich Gubler 28912feb00 fix(naga-cli): reimpl. emit_annotated_error with WithSpan::emit_to_stderr_with_path 2024-10-22 14:42:27 -04:00
Hamir Mahal 8e787eb70a style: simplify string formatting for readability (#6316) 2024-09-24 23:40:53 -04:00
Dzmitry Malyshau eb18854b46 spv-out: configure source language in debug info 2024-09-13 11:37:23 -07:00
Kornel 222f1ea733 Reduce code size of error handling 2024-08-19 14:38:20 +01:00
teoxoy ccd6d2ca48 remove BoundsCheckPolicies.image_store 2024-07-26 10:44:22 -07:00
Bruce Mitchener 3166d37754 Use workspace dependencies more. (#6020) 2024-07-26 18:48:01 +02:00
Erich Gubler 6a1432c132 chore: release 22.0.0 2024-07-18 11:54:46 -04:00
Imbris 3a6814770a Allow unconsumed inputs in fragment shaders (#5531)
* Allow unconsumed inputs in fragment shaders by removing them from vertex
outputs when generating HLSL.

Fixes https://github.com/gfx-rs/wgpu/issues/3748

* Add naga::back::hlsl::FragmentEntryPoint for providing information
  about the fragment entry point when generating vertex entry points via
  naga::back::hlsl::Writer::write. Vertex outputs not consumed by the
  fragment entry point are omitted in the final output struct.
* Add naga snapshot test for this new feature,
* Remove Features::SHADER_UNUSED_VERTEX_OUTPUT,
  StageError::InputNotConsumed, and associated validation logic.
* Make wgpu dx12 backend pass fragment shader info when generating
  vertex HLSL.
* Add wgpu regression test for allowing unconsumed inputs.

* Address review

* Add note that nesting structs for the inter-stage interface can't
  happen.
* Remove new TODO notes (some addressed and some transferred to an issue
  https://github.com/gfx-rs/wgpu/issues/5577)
* Changed issue that regression test refers to 3748 -> 5553
* Add debug_assert that binding.is_some() in hlsl writer
* Fix typos caught in CI

Also, fix compiling snapshot test when hlsl-out feature is not enabled.
2024-07-04 09:08:46 +02:00
Théo Monnom 0f6abc99ee [naga-cli] add --defines options for the glsl parser (#5859) 2024-06-23 07:21:56 +00:00
Erich Gubler f1b06f55ce chore: satisfy clippy::assigning_clones 2024-05-13 10:10:54 -04:00
Andreas Reich 452cf24fa1 Remove unnecessary Cargo.toml dependencies via cargo machete (#5692) 2024-05-12 19:05:00 -04:00
Connor Fitzgerald 4521502da6 Release v0.20.0 (#5619) 2024-04-28 18:06:35 -04:00
matt rice e0ac24aeab [naga-cli] Add input-kind and shader-stage args (#5411) 2024-04-18 12:41:18 +02:00
ea77d5674d Subgroup Operations (#5301)
Co-authored-by: Jacob Hughes <j@distanthills.org>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: atlas dostal <rodol@rivalrebels.com>
2024-04-17 15:25:52 -04:00
vero 911baf3e8c Add DirectX ShaderModel 6.1-6.7 detection (#5498) 2024-04-06 11:35:59 +02:00
teoxoy 7df0aa6364 move the burden of evaluating override-expressions to users of naga's API 2024-04-05 18:07:41 +02:00
Jim Blandy 7bed9e8bce [naga-cli] Add --override option. 2024-04-05 18:07:41 +02:00
teoxoy 3bda381812 add pipeline constants plumbing 2024-04-05 18:07:41 +02:00
Patrick Cleavelin a63bec8cd6 add cli arg to choose metal version 2024-03-15 10:39:40 +01:00
dependabot[bot] e04a9f4c6f build(deps): bump the patch-updates group with 29 updates (#5376)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 13:00:43 -04:00
wayneandAlphyr c4b5cc94ad don't panic if naga parsing of shader source fails (#5034)
* naga: glsl parser should return singular ParseError similar to wgsl

* wgpu: treat glsl the same as wgsl when creating ShaderModule

* naga: update glsl parser tests to use new ParseError type

* naga: glsl ParseError errors field should be public

* wgpu-core: add 'glsl' feature

* fix some minor bugs in glsl parse error refactor

* naga/wgpu/wgpu-core: improve spirv parse error handling

* wgpu-core: feature gate use of glsl and spv naga modules

* wgpu: enable wgpu-core glsl and spirv features when appropriate

* obey clippy

* naga: derive Clone in Type

* naga: don't feature gate Clone derivation for Type

* obey cargo fmt

* wgpu-core: use bytemuck instead of zerocopy

* wgpu-core: apply suggested edit

* wgpu-core: no need to borrow spirv code

* Update wgpu/src/backend/wgpu_core.rs

Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>

---------

Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
2024-01-23 10:25:25 -05:00
Connor Fitzgerald 8b2098bd4e Release 0.19 (#5082) 2024-01-17 14:42:11 -05:00
Connor Fitzgerald a2dced12b3 Disable naga-cli's docs 2024-01-08 08:48:13 +01:00
Jim Blandy 9013e226c3 [naga-cli] Add --bulk-validate option. 2023-12-24 12:03:28 -08:00
Jim Blandy 79a6a4b0d2 [naga-cli] Abstract out parsing of input file. 2023-12-24 12:03:28 -08:00
Connor Fitzgerald 06e9876adf Move to A Single Example Executable (#4756)
* Move to combined examples

* Fix paths

* Curtail some tests

* Format

* Clippy

* Fix wasm

* Refactor main for wasm

* Style sheet

* Readme

* Lock
2023-11-23 05:26:42 -05:00
Jim Blandy a820a3ffba [naga]: Make snapshot tests include paths in errors.
Following Rust convention, let `naga::front::wgsl::ParseError`'s
methods `emit_to_stderr_with_path` and `emit_to_string_with_path`
accept any `AsRef<Path>` argument as the path.

Pass input paths in snapshot tests, so that failures processing
shaders name the input file being processed.
2023-11-21 21:47:03 +01:00
Teodor Tanasoaia a26e4a009a [naga] remove span and validate features (#4706) 2023-11-17 13:37:25 -05:00
Connor Fitzgerald 2a9fdf9aa1 Misc Repo Cleanup Tasks (#4579)
* Misc Repo Cleanup Tasks

* Dependency Trimming

* Dep cleanup

* Restrict libfuzzer

* Flip cfg

* mod fuzz
2023-10-27 00:15:51 -04:00
Connor Fitzgerald 34e947de4b Integration of Naga into Repo (#4296) 2023-10-25 16:51:36 -04:00