260 Commits

Author SHA1 Message Date
firestar99
0655455b80 move mod: move arch::barrier to barrier 2026-04-08 13:34:02 +02:00
Christian Legnitto
adb7e0be7b Resolve new collapsible-match clippy lints in example runners 2026-03-30 07:03:29 +00:00
firestar99
d01051d280 adjust clippy lints, rename empty_enum to empty_enums
All checks were successful
Rust Toolchain Upgrade / check-and-upgrade (push) Has been skipped
2026-03-03 23:20:53 +00:00
firestar99
6a67e7b595 adjust clippy lints, remove deprecated string_to_string
All checks were successful
Rust Toolchain Upgrade / check-and-upgrade (push) Has been skipped
2026-03-02 23:44:12 +00:00
firestar99
083db3c9f3 build_script: replace enum MetadataPrintout with struct BuildScriptConfig for more flexibility 2026-02-03 10:44:26 +00:00
firestar99
e2e810ff84 wgpu 27: fixup example-runner-wgpu for android
Some checks failed
Rust Toolchain Upgrade / check-and-upgrade (push) Has been cancelled
2025-12-23 23:56:59 +00:00
firestar99
ed9887fdb5 wgpu 27: update example-runner-wgpu 2025-12-23 23:56:59 +00:00
firestar99
b2b171663d wgpu 27: update deps 2025-12-23 23:56:59 +00:00
firestar99
a57c1a4342 cargo-release: disable release for example and test crates 2025-12-10 16:41:54 +00:00
firestar99
e97524f6b4 dylib: fix Android
All checks were successful
Rust Toolchain Upgrade / check-and-upgrade (push) Has been skipped
2025-12-05 23:29:56 +00:00
firestar99
ecb41c22dc dylib: remove crate-type declarations from examples and difftests 2025-12-05 23:29:56 +00:00
firestar99
18f9e0266d replace tabs with spaces 2025-12-05 10:35:47 +00:00
firestar99
77a4ecfccb watch: add try_recv, a non-blocking variant 2025-11-28 11:39:36 +00:00
firestar99
7c5cc3446f watch: handle errors and changes during compile gracefully 2025-11-28 11:39:36 +00:00
firestar99
8ae34046cd watch: always consume SpirvBuilder 2025-11-28 11:39:36 +00:00
tuguzT
30b9b70c6e watch: Redesign spirv-builder's watch API 2025-11-28 11:39:36 +00:00
firestar99
d4dd2e2151 ash runner: cleanup debug callback
All checks were successful
Rust Toolchain Upgrade / check-and-upgrade (push) Has been skipped
2025-11-27 10:12:45 +00:00
firestar99
5e582833a7 ash runner: switch Vulkan Memory Model from extension to core feature 2025-11-27 10:12:45 +00:00
firestar99
081e2b5057 ash runner: remove ash-molten, require vulkan sdk on macos 2025-11-27 10:12:45 +00:00
firestar99
c33650e5ec ash runner: fix lints 2025-11-27 10:12:45 +00:00
firestar99
e99d6d2342 ash runner: split it into different modules 2025-11-27 10:12:45 +00:00
firestar99
c796d6c542 ash runner: rewrite
* use Vulkan 1.3
* use DynamicRendering feature replacing Framebuffers
* extract `MyDevice` struct containing vk initialization
* decouple rendering from swapchain management
* redo swapchain sync, fixes validation errors, intentionally kept basic
* make rendering lazily recreate its pipeline
2025-11-27 10:12:45 +00:00
firestar99
81d7268ee2 ash runner: general code cleanup 2025-11-27 10:12:45 +00:00
firestar99
794c9054c2 ash runner: use bytemuck 2025-11-27 10:12:45 +00:00
firestar99
1c345c2cc3 ash runner: remove multimodule, simplify pipeline creation 2025-11-27 10:12:45 +00:00
firestar99
aa62233258 ash runner: constant window updates, don't wait for new events 2025-11-27 10:12:45 +00:00
firestar99
807ea2a922 ash runner: make debug msgs easier to read 2025-11-27 10:12:45 +00:00
firestar99
e767f24f25 remove example build scripts forwarding PROFILE env var
All checks were successful
Rust Toolchain Upgrade / check-and-upgrade (push) Has been skipped
no longer necessary since d416b65572
2025-10-20 06:44:12 +00:00
Nicholas Nethercote
29ba02d61e Simplify the ash runner.
The ash runner is over-engineered: it supports multiple pipelines, each
one with a separate vertex/fragment shader pair, but it only ever uses
one pipeline. The other runners don't support multiple pipelines, so
this just seems like unnecessary complexity. This is bad because the
examples are currently some of the best rust-gpu documentation there is.

More specifically:
- `rebuild_pipelines` is now just `rebuild_pipeline`, and
  `build_pipelines` is no longer needed.
- `compile_shaders` returns a pair instead of a `Vec`: one element for
  the vertex shader data, and one for the fragment shader data.
- RenderBase no longer needs `Vec` and `HashMap` elements, it can just
  store a single pipeline, a single vertex shader module, and a single
  fragment shader module.
- The following types are no longer needed: `SpvFile`,
  `VertextShaderEntryPoint`, `FragmentShaderEntryPoint`.
- Less iteration and `collect`ing in general.
2025-09-30 09:53:23 +00:00
Nicholas Nethercote
50a8507528 rustup: update to nightly-2025-06-30.
- `filter_landing_pad` no longer has a return value.
- `build_session` no longer has the `sysroot` argument.
- `manual_is_multiple_of` clippy lint was enabled.
2025-09-30 05:09:06 +00:00
Nicholas Nethercote
ad2a34abb0 Update some out-of-date comments. 2025-09-29 06:37:39 +00:00
Nicholas Nethercote
d0f5c9e730 Enable simplest-shader and mouse-shader on the ash runner.
mouse-shader doesn't work fully. But it's an example, so partial
function is still reasonable.
2025-09-29 06:37:39 +00:00
Nicholas Nethercote
71cf99d84e Fix simplest-shader on ash runner.
The background should be green, not blue, to match the wgpu runner.
2025-09-29 06:37:39 +00:00
tuguzT
6cd6785a51 Return JoinHandle of watching thread to the caller 2025-09-29 05:29:06 +00:00
Nicholas Nethercote
b6c42be040 Improve examples documentation.
All checks were successful
Rust Toolchain Upgrade / check-and-upgrade (push) Has been skipped
Better explain the shaders and runners, and explain how to invoke them,
and even document the `+`/`-` feature of the sky shader on ash, which
is currently invisible unless you read the code.
2025-09-22 07:43:54 +00:00
Nicholas Nethercote
f0f66143c2 Change the intensity keys in the sky-on-shader example.
Currently you can use '+'/'-' on the numeric keypad to adjust the
intensity, but lots of keyboards lack a numeric keypad. This commit
changes it to use the up and down arrows instead.
2025-09-22 07:43:54 +00:00
Nicholas Nethercote
7ee80e65d5 Improve the documentation of the compute shader example.
Also make it include `1` in the output sequence, because that is the
first number according to https://oeis.org/A006877.
2025-09-22 07:43:54 +00:00
Nicholas Nethercote
19d23e5428 Fix the CPU sky-shader demo.
All checks were successful
Rust Toolchain Upgrade / check-and-upgrade (push) Has been skipped
It's supposed to produce a landscape with a small white sun, blue sky,
and yellow ground. Instead it produces a small white sun and everything
else is black. The problem is with the
`sun_intensity_extra_spec_const_factor` argument to `sky_shader::fs`.

- When running on the GPU, `sky_shader::fs` is called from `main_fs`,
  which has a spec_constant with a default value of 100.

- When running on the CPU, `sky_shader::fs` is called directly from the
  CPU shader's `main`, and it passes 1.

In other words, the CPU shader's sun intensity is 100x too small, which
explains why it's so dark. This commit changes the value to 100, which
makes the CPU shader produce the expected result.

(The shader later divides the intensity value by 100. There are comments
about integration testing for specialization constants that I don't
understand.)
2025-09-18 08:28:58 +00:00
firestar99
5b5237416a adjust examples and difftests to new safe functions 2025-09-17 15:46:24 +00:00
firestar99
d1fce90567 example-runner-wgpu: replace custom PortableInstant with web-time crate 2025-09-17 10:39:29 +00:00
Eduard-Mihai Burtescu
d9bb8aa770 example-runner-wgpu: fix remaining issues, and default to mouse shader, for wasm/WebGPU.
All checks were successful
Rust Toolchain Upgrade / check-and-upgrade (push) Has been skipped
2025-09-16 19:44:28 +00:00
Eduard-Mihai Burtescu
62307dc850 example-runner-wpgu: emulate push constants on wasm/WebGPU. 2025-09-16 19:44:28 +00:00
Eduard-Mihai Burtescu
97357ebc5e example-runner-wpgu: force sRGB, even on wasm->WebGPU. 2025-09-16 19:44:28 +00:00
Eduard-Mihai Burtescu
7203a07c45 run-wasm helper (cargo-run-wasm) for testing the wgpu runner on the web. 2025-09-16 19:44:28 +00:00
Eduard-Mihai Burtescu
4086e53499 example-runner-wpgu: use window.performance.now() on wasm. 2025-09-16 19:44:28 +00:00
Eduard-Mihai Burtescu
72c79f36f9 example-runner-wgpu: fix wasm build (winit 0.29 breaking changes). 2025-09-16 19:44:28 +00:00
Eduard-Mihai Burtescu
688103f26e Update ShaderPanicStrategy::DebugPrintfThenExit documentation for Vulkan SDK changes. 2025-08-03 14:04:50 +00:00
Nazar Mokrynskyi
8c85b916d5 Update most significant versions of direct dependencies 2025-07-28 10:10:08 +00:00
Eduard-Mihai Burtescu
bfce65327c Fix new clippy::collapsible_if warnings. 2025-07-09 20:55:41 +00:00
Eduard-Mihai Burtescu
45266f5480 rustup: update to nightly-2025-05-09 (~1.88). 2025-07-09 19:51:09 +00:00