Giter Site home page Giter Site logo

swoorup / wgsl-bindgen Goto Github PK

View Code? Open in Web Editor NEW
32.0 2.0 5.0 585 KB

Generate typesafe Rust bindings for wgsl shaders in wgpu

Home Page: https://crates.io/crates/wgsl_bindgen

License: MIT License

Rust 83.70% WGSL 16.30%
rust wgpu wgsl wgsl-shader bevy

wgsl-bindgen's Introduction

Hi there ๐Ÿ‘‹

My name is Swoorup Joshi. I'm a passionate about distributed & concurrent systems, and making high traffic application scale.

While I look at the platform/runtime as a tool to achieve the goal, my personal weapons of choice include: Rust or F#.

println!("${firstName}[email protected]")

wgsl-bindgen's People

Contributors

alanlzhang avatar andrewbrownk avatar arthurbrussee avatar badicsalex avatar bconnorwhite avatar daxpedda avatar hackaugusto avatar scanmountgoat avatar slackers123 avatar swoorup avatar syth-trader avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wgsl-bindgen's Issues

Tidy up the output

When looking at the output, it appears as if a bit all over and messy right now.

Perhaps we could move assertions, impls to their own module and re-exported by root (is it even required)? Somehow use rustfmt instead of prettyparse?

Moving the assertions, impls around, we will need to ensure the struct usages as fully qualified.

Add constant counting number of buffers

I got bitten by setting low Limits values by hand. It would be nice if code emitted by wgsl-bindgen included counters for the number of bind groups, uniforms, storage buffers and so on, to set the appropriate values in the Limits struct.

Provide `min_binding_size` when generating the Bind Group Layout Descriptor.

We should probably provide a min_binding_size for uniform buffer when generating the Bind Group Layout Descriptor.

wgpu::BindGroupLayoutEntry {
  binding: 0,
  visibility: wgpu::ShaderStages::VERTEX | wgpu::ShaderStages::FRAGMENT,
  ty: wgpu::BindingType::Buffer {
    ty: wgpu::BufferBindingType::Uniform,
    has_dynamic_offset: false,
    min_binding_size: NonZeroU64::new(std::mem::size_of::<gpu_data::BatchUniformBuffer>() as _),
  },
   count: None,
}

Expose SHADER_STRING in bindings

Thanks for the great crate! Maybe a niche issue, but I'm using this to handle all the naga_oil preprocessing, generate some structs that have the correct layout, but otherwise I need to fit this in with an existin WGPU codebase (https://github.com/tracel-ai/burn). For that I need access to the final generated SHADER_STRING, which atm ends up as private.

Just have locally modified this for now, happy to create a PR if that sounds good!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.