233 Commits

Author SHA1 Message Date
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
Eduard-Mihai Burtescu
fe852baa80 rustup: update to nightly-2025-04-27. 2025-07-09 19:51:09 +00:00
Christian Legnitto
f7f0d07df2 Switch all crates to Rust 2024 edition. 2025-07-09 19:51:09 +00:00
Eduard-Mihai Burtescu
f08f3b1381 Fix new clippy warnings. 2025-07-09 19:51:09 +00:00
Eduard-Mihai Burtescu
794377dc32 rustfmt using nightly-2025-02-16. 2025-07-09 19:51:09 +00:00
Eduard-Mihai Burtescu
6480420ede Fix new clippy::precedence warnings. 2025-07-09 19:51:09 +00:00
Firestar99
f58374079a Upgrade wgpu 23 -> 25 (#309)
* difftest: replace error enums with anyhow

* upgrade wgpu 23 -> 25
2025-07-01 10:28:33 +00:00
Firestar99
3b60bf9982 print possible values only once 2025-05-21 17:32:02 +00:00
Firestar99
f4a4ffb303 cargo fmt 2025-05-21 17:32:02 +00:00
jer
0b7db6432c fix: remove unused import 2025-05-21 17:32:02 +00:00
jer
cfa458e277 fix: buff the help menu for the wgpu-runner 2025-05-21 17:32:02 +00:00
Firestar99
e6933e7a91 compile_codegen: allow SpirvBuilder watch to return something on first completion 2025-05-06 08:57:34 +00:00
Firestar99
a89fd93f81 compile_codegen: change default MetadataPrintout to None 2025-05-06 08:57:34 +00:00
Brice Videau
561d2eb733 Fix C string char type to use portable type c_char. 2024-12-22 02:30:30 +00:00
Eduard-Mihai Burtescu
0750b3059a examples/runners/wgpu: update wgpu to 23. 2024-12-18 20:09:36 +00:00
Eduard-Mihai Burtescu
332b38dbf1 examples/runners/{ash,wgpu}: update winit to 0.30 (but using deprecated APIs). 2024-12-18 20:09:36 +00:00
Eduard-Mihai Burtescu
f069c58c0c examples/runners/wgpu: avoid holding onto to multiple surfaces at the same time. 2024-12-18 15:34:21 +00:00
Eduard-Mihai Burtescu
e62b14ce4a Shrink dupe deps via deny.toml, updating ash example in the process. 2024-12-18 15:33:41 +00:00
Eduard-Mihai Burtescu
596512884a Update formatting for nightly-2024-10-12 (~1.83). 2024-12-18 10:46:51 +00:00
Eduard-Mihai Burtescu
3e56c3deda rustup: update to nightly-2024-07-20 (~1.81). 2024-12-18 10:46:51 +00:00
Eduard-Mihai Burtescu
5279b19a51 rustup: update to nightly-2024-06-08 (~1.80). 2024-12-18 10:46:51 +00:00
Firestar99
05e9439bd4 examples: fix ash searching shaders relative to cwd instead of its Cargo.toml 2024-11-18 22:38:25 +00:00
Rowan Jones
d2eb777510 Make timestamping dependent on support (#38) 2024-10-15 13:02:37 -04:00
Firestar99
ab3254a6da project: add optional bytemuck dependency to mark structs as Pod 2024-10-14 13:11:12 +02:00
Bruce Mitchener
529aaf4f3f Reduce typo count. (#18) 2024-09-26 07:04:55 +12:00
Eduard-Mihai Burtescu
a1b2eeb39d rustup: update to nightly-2024-04-24. 2024-09-21 08:20:05 -04:00
Eduard-Mihai Burtescu
cc752312c3 rustup: update to nightly-2024-03-01. 2024-09-21 08:20:05 -04:00
Eduard-Mihai Burtescu
d5a31c1fca examples/shaders/shared: remove unused feature(lang_items). 2024-09-21 08:20:05 -04:00