Skip to content

Conversation

nnethercote
Copy link
Contributor

Just expanding the examples a little.

print_backtrace: true,
})
// HACK(eddyb) needed because of `debugPrintf` instrumentation limitations
// (see https://github.com/KhronosGroup/SPIRV-Tools/issues/4892).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KhronosGroup/SPIRV-Tools#4892 appears to be closed, this might be fixed in our version of spirv-tools now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, forgot about the ash runner in:

(that PR's only change to any code is pretty much just removing this kind of special-case, but only from the wgpu runner)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing this in the ash runner is more complicated than in the WGPU runner. Elsewhere the ash runner uses unwrap_multi. If this .multimodule(true) is removed then that unwrap_multi must be changed to unwrap_single, which has a bunch of knock-on effects. It might be possible, but I would like to look into it as a follow-up because it's beyond the scope of this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do the ash part if you want to (since I'm familiar with vulkan)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine to keep using multimodule for now, can just leave an extra comment (or replace the existing one), clarifying the combination of:

  1. it's no longer needed
  2. refactoring it from multi back to single is non-trivial and hasn't been done yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into the multimodule removal, but I couldn't get it to work. The sticking point was here -- the vertex shader and fragment shader need to be separate (as far as I can tell), and I can't see how to do that without multimodule.

While I was trying to eliminate the multimodule I found a bunch of other simplifications that can be made to the ash runner. (It has unnecessary support for multiple pipelines.) Once this PR merges I will file a PR for those simplifications, so @Firestar99 I suggest waiting until after that before looking at multimodule. Thanks!

@eddyb: I will update the comment.

}

// The form with underscores, e.g. `sky_shader`.
fn crate_ident(&self) -> &'static str {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can probably just be self.crate_name().replace("-", "_") (it's only used w/ format! AFAICT, so there's already an inherent string allocation cost anyway).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, but it has to return a String, which would make it different to crate_name, and I have a follow-up that will eliminate this anyway. So I'll leave it as is.

print_backtrace: true,
})
// HACK(eddyb) needed because of `debugPrintf` instrumentation limitations
// (see https://github.com/KhronosGroup/SPIRV-Tools/issues/4892).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine to keep using multimodule for now, can just leave an extra comment (or replace the existing one), clarifying the combination of:

  1. it's no longer needed
  2. refactoring it from multi back to single is non-trivial and hasn't been done yet

The background should be green, not blue, to match the wgpu runner.
mouse-shader doesn't work fully. But it's an example, so partial
function is still reasonable.
@nnethercote nnethercote force-pushed the more-shader-runner-combos branch from 5ddf33d to 3c08300 Compare September 24, 2025 22:11
@nnethercote nnethercote requested a review from eddyb September 24, 2025 22:11
@nnethercote
Copy link
Contributor Author

Ok, I have added a new commit that updates the comment on the multimodule call.

@nnethercote
Copy link
Contributor Author

@eddyb has approved the changes. Any other review comments?

Copy link
Collaborator

@LegNeato LegNeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 🚀

@nnethercote
Copy link
Contributor Author

This PR now has approval from @eddyb and @LegNeato.

@Firestar99, @schell: any comments? Or if someone wants to merge it, that would be great. I don't have permission to do that.

@eddyb eddyb added this pull request to the merge queue Sep 29, 2025
Merged via the queue into Rust-GPU:main with commit ad2a34a Sep 29, 2025
13 checks passed
@nnethercote nnethercote deleted the more-shader-runner-combos branch September 29, 2025 22:07
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.

4 participants