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

vello should import vello_shaders #467

Closed
PoignardAzur opened this issue Feb 26, 2024 · 1 comment · Fixed by #563
Closed

vello should import vello_shaders #467

PoignardAzur opened this issue Feb 26, 2024 · 1 comment · Fixed by #563
Labels
architecture Changes to the way it's put together

Comments

@PoignardAzur
Copy link
Collaborator

PoignardAzur commented Feb 26, 2024

The same preprocessor code is written twice:

  • In crates/shaders/src/compile/preprocess.rs
  • In src/shaders/preprocess.rs

According to Raph, this is because the vello_shaders crate was meant for Skia integration, and currently isn't used by Vello.

We should fix that and remove the duplication.

@armansito
Copy link
Collaborator

We always intended for the main Vello crate to use vello_shaders but never got around to it. The crate supports generating native shaders (such as MSL) from the WGSL which allows external engines to target Metal, Vulkan, etc directly. This code path isn't exercised in the Vello repository but we have wanted to have native runners (i.e. alternative engines alongside wgpu) eventually but decided to put that in the backburner due to other priorities.

I think this issue can be repurposed as "Move to shader management via crates/shaders".

@PoignardAzur PoignardAzur changed the title The preprocess code is duplicated Vello should import vello_shaders Feb 29, 2024
@PoignardAzur PoignardAzur changed the title Vello should import vello_shaders vello should import vello_shaders Feb 29, 2024
@simbleau simbleau added the architecture Changes to the way it's put together label Mar 4, 2024
github-merge-queue bot pushed a commit that referenced this issue May 3, 2024
This replaces the shader preprocessing code in the vello crate with
invocations to the vello_shaders crate, which supports both reading from
a directory at runtime (for hot_reload) and bundlng pre-compiled shader
code into the binary (which is suitable for wasm).

This also moves the CPU shader code over to the vello_shaders crate
behind the "cpu" feature.

Resolves #467
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Changes to the way it's put together
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants