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

support wgpu vertex formats #22

Open
24 of 34 tasks
ScanMountGoat opened this issue Jul 31, 2022 · 2 comments
Open
24 of 34 tasks

support wgpu vertex formats #22

ScanMountGoat opened this issue Jul 31, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@ScanMountGoat
Copy link
Owner

ScanMountGoat commented Jul 31, 2022

These types should all be usable with vertex input structs for WGSL. The test cases in lib.rs for writing the vertex module should cover all of the supported types.
https://docs.rs/wgpu/latest/wgpu/enum.VertexFormat.html

  • wgpu_types::VertexFormat::Uint8x2
  • wgpu_types::VertexFormat::Uint8x4
  • wgpu_types::VertexFormat::Sint8x2
  • wgpu_types::VertexFormat::Sint8x4
  • wgpu_types::VertexFormat::Unorm8x2
  • wgpu_types::VertexFormat::Unorm8x4
  • wgpu_types::VertexFormat::Snorm8x2
  • wgpu_types::VertexFormat::Snorm8x4
  • wgpu_types::VertexFormat::Uint16x2
  • wgpu_types::VertexFormat::Uint16x4
  • wgpu_types::VertexFormat::Sint16x2
  • wgpu_types::VertexFormat::Sint16x4
  • wgpu_types::VertexFormat::Unorm16x2
  • wgpu_types::VertexFormat::Unorm16x4
  • wgpu_types::VertexFormat::Snorm16x2
  • wgpu_types::VertexFormat::Snorm16x4
  • wgpu_types::VertexFormat::Float16x2
  • wgpu_types::VertexFormat::Float16x4
  • wgpu_types::VertexFormat::Float32
  • wgpu_types::VertexFormat::Float32x2
  • wgpu_types::VertexFormat::Float32x3
  • wgpu_types::VertexFormat::Float32x4
  • wgpu_types::VertexFormat::Uint32
  • wgpu_types::VertexFormat::Uint32x2
  • wgpu_types::VertexFormat::Uint32x3
  • wgpu_types::VertexFormat::Uint32x4
  • wgpu_types::VertexFormat::Sint32
  • wgpu_types::VertexFormat::Sint32x2
  • wgpu_types::VertexFormat::Sint32x3
  • wgpu_types::VertexFormat::Sint32x4
  • wgpu_types::VertexFormat::Float64
  • wgpu_types::VertexFormat::Float64x2
  • wgpu_types::VertexFormat::Float64x3
  • wgpu_types::VertexFormat::Float64x4
@ScanMountGoat ScanMountGoat added the enhancement New feature or request label Jul 31, 2022
@ScanMountGoat
Copy link
Owner Author

ScanMountGoat commented Aug 3, 2022

Signed and unsigned normalized types use floating point in WGSL like vec2<f32>. This makes it impossible to detect if data should use unorm, snorm, or float purely based on WGSL. It should be documented that users should define their own attribute array using the WGPU macro in those cases.

@ScanMountGoat
Copy link
Owner Author

Half precision formats could be supported using u16 on the Rust side or optionally with the half crate.

JMLX42 added a commit to JMLX42/wgsl_to_wgpu that referenced this issue Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant