Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example-runner-wgpu: add --force-spirv-passthru and rely on it for debugPrintf. #1036

Merged
merged 7 commits into from
Jul 20, 2023

Conversation

eddyb
Copy link
Contributor

@eddyb eddyb commented Apr 17, 2023

Not sure yet if this is the way to do it, but I used this for testing the mouse shader (before #1018).


EDIT: turns out that this is the main requirement for using debugPrintf from wgpu!

Quick demo panic:

--- a/examples/shaders/sky-shader/src/lib.rs
+++ b/examples/shaders/sky-shader/src/lib.rs
@@ -65,2 +65,3 @@ fn sun_intensity(zenith_angle_cos: f32) -> f32 {
     let cutoff_angle = PI / 1.95; // Earth shadow hack
+    assert!(zenith_angle_cos > 0.07479);
     SUN_INTENSITY_FACTOR

Enabling debugPrintf output without code changes (nor debug mode):

VK_LOADER_LAYERS_ENABLE='VK_LAYER_KHRONOS_validation' \
VK_LAYER_ENABLES='VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT' \
DEBUG_PRINTF_TO_STDOUT=1 \
  cargo run -p example-runner-wgpu --release -- --force-spirv-passthru

(also check out the updated DebugPrintfThenExit docs!)

@eddyb eddyb marked this pull request as ready for review July 20, 2023 07:17
@eddyb eddyb requested review from fu5ha and VZout as code owners July 20, 2023 07:17
@eddyb eddyb requested review from repi, fu5ha and VZout and removed request for fu5ha and VZout July 20, 2023 07:17
@eddyb eddyb changed the title example-runner-wgpu: add --force-spirv-passthru for testing. example-runner-wgpu: add --force-spirv-passthru and rely on it for debugPrintf. Jul 20, 2023
@eddyb eddyb enabled auto-merge (rebase) July 20, 2023 17:20
@eddyb eddyb merged commit 55edc4e into EmbarkStudios:main Jul 20, 2023
7 checks passed
@eddyb eddyb deleted the passthru branch July 20, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants