Skip to content

Conversation

nnethercote
Copy link
Contributor

@nnethercote nnethercote commented Sep 29, 2025

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, VertexShaderEntryPoint, FragmentShaderEntryPoint.
  • Less iteration and collecting in general.

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.
@nnethercote
Copy link
Contributor Author

This PR came out of me attempting to remove the use of multimodule. I originally thought that the multimodule use was due to the multiple pipeline functionality. But even with the multiple pipeline support removed, multimodule is still needed because the current code needs the vertex shader and the fragment shader to be in separate shader modules. Maybe there's a way around this that I don't know about.

@Firestar99
Copy link
Member

Allow me to do another simplification pass on this

Copy link
Member

@Firestar99 Firestar99 left a comment

Choose a reason for hiding this comment

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

Merging this for now, moving my changes to a separate PR.

Running the ash example with validation layers spits out a bunch of errors, which means it's actually doing something quite illegal. I started investigating and I think an (almost) full rewrite is in order. And while I'm at it, I can update it to modern Vulkan which uses the dynamic_rendering extension (since Vulkan 1.3 required).

@Firestar99 Firestar99 added this pull request to the merge queue Sep 30, 2025
Merged via the queue into Rust-GPU:main with commit 29ba02d Sep 30, 2025
13 checks passed
@nnethercote nnethercote deleted the simplify-ash-runner branch October 3, 2025 04:25
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