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

Include identifying information (e.g. crate names) in --dump-* filenames. #967

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

eddyb
Copy link
Contributor

@eddyb eddyb commented Dec 12, 2022

Before

$ RUSTGPU_CODEGEN_ARGS="--dump-pre-link=$PWD/dumps/pre-link \
                        --dump-post-merge=$PWD/dumps/post-merge \
                        --dump-post-split=$PWD/dumps/post-split \
                        --dump-post-link=$PWD/dumps/post-link \
                        --spirt --dump-spirt-passes=$PWD/dumps/spirt-passes" \
  cargo run -p example-runner-wgpu

   Compiling sky-shader v0.0.0 (⋯/examples/shaders/sky-shader)

$ tree dumps
dumps
├── pre-link
│   ├── mod_0.spv
│   ├── mod_1.spv
│   ⋮
│   ├── mod_383.spv
│   └── mod_384.spv
├── post-merge
├── spirt-passes
├── spirt-passes.html
├── post-split
│   └── mod_0.spv
└── post-link
    └── module

After

$ RUSTGPU_CODEGEN_ARGS="--dump-pre-link=$PWD/dumps/pre-link \
                        --dump-post-merge=$PWD/dumps/post-merge \
                        --dump-post-split=$PWD/dumps/post-split \
                        --dump-post-link=$PWD/dumps/post-link \
                        --spirt --dump-spirt-passes=$PWD/dumps/spirt-passes" \
  cargo run -p example-runner-wgpu

   Compiling sky-shader v0.0.0 (⋯/examples/shaders/sky-shader)

$ tree dumps
dumps
├── pre-link
│   ├── bitflags-8e60e58c2f5bbf61.bitflags.066dfbae-cgu.0.rcgu.spv
│   ├── bytemuck-b3e7e930e0f4de73.bytemuck.2753b143-cgu.0.rcgu.spv
│   ⋮
│   ├── shared-6aad9625adbcf25a.3o3jyhwfr4jh2s1n.rcgu.spv
│   ├── sky_shader.19029ydyojn6ny4z.rcgu.spv
│   ├── spirv_std-ebcff9dfacf15505.3zchoimcc4ql6s81.rcgu.spv
│   ⋮
│   ├── spirv_std-ebcff9dfacf15505.gw065rptpzqehcz.rcgu.spv
│   └── spirv_std_types-2758271e2b6a2802.2k6ghdgur5korza1.rcgu.spv
├── post-merge
│   └── sky_shader.spv
├── spirt-passes
│   ├── sky_shader.spirt
│   └── sky_shader.spirt.html
├── post-split
│   └── sky_shader.spv
└── post-link
    └── sky_shader.spv
$ RUSTGPU_CODEGEN_ARGS="--dump-pre-link=$PWD/dumps/pre-link \
                        --dump-post-merge=$PWD/dumps/post-merge \
                        --dump-post-split=$PWD/dumps/post-split \
                        --dump-post-link=$PWD/dumps/post-link \
                        --spirt --dump-spirt-passes=$PWD/dumps/spirt-passes" \
  cargo run -p multibuilder

   Compiling sky-shader v0.0.0 (⋯/examples/shaders/sky-shader)

$ tree dumps
dumps
├── pre-link
│   ⋮
├── post-merge
│   └── sky_shader.spv
├── spirt-passes
│   ├── sky_shader.spirt
│   └── sky_shader.spirt.html
├── post-split
│   ├── sky_shader.main_fs.spv
│   └── sky_shader.main_vs.spv
└── post-link
    ├── sky_shader.main_fs.spv
    └── sky_shader.main_vs.spv

(dumps/pre-link omitted as it's identical between the single-module and multi-module modes)


This idea first came up in the context of --dump-spirt-passes (from #940) - which we want to be able to set once for shader builders that build several shaders (or potentially even the entire test suite, heh), but it turns out that pretty much all existing --dump-* also have the problem of not being able to tell anything apart.

Hopefully the above before/after comparison speaks for itself!

@eddyb eddyb marked this pull request as ready for review December 13, 2022 03:11
@eddyb eddyb enabled auto-merge (rebase) December 13, 2022 03:12
@eddyb eddyb merged commit 85e4df3 into EmbarkStudios:main Dec 13, 2022
@eddyb eddyb deleted the dump-crate-name branch December 13, 2022 08:50
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