Git Product home page Git Product logo

Comments (6)

teoxoy avatar teoxoy commented on June 8, 2024

Could you point me at some code that would use this? Is this for the sparse copy compute shader you are using (where you write the new data in a new buffer and then copying it in the proper spots in the destination buffer)?

from encase.

cwfitzgerald avatar cwfitzgerald commented on June 8, 2024

Yeah that's the intended use case - using sparse copies to update a buffer that is laid out like https://github.com/BVE-Reborn/rend3/blob/trunk/rend3-routine/shaders/src/structures.wgsl#L48-L51. The above struct is what I ideally would be the equivalent encase declaration.

from encase.

fayalalebrun avatar fayalalebrun commented on June 8, 2024

I am writing a particle physics simulator and this would also be very useful for me. I have several very large arrays of structs on GPU memory, and I need to write to a few elements at a time, sometimes even just a single field of a struct. It is also desirable to get the value that was stored there previously, though that would probably happen on the next frame.

from encase.

teoxoy avatar teoxoy commented on June 8, 2024

Actually, a variation of this feature should already be available. The ShaderType trait has an associated constant METADATA with offsets/stride.

Polishing this API would be a next step but I'd like to see how people use it first.

Let me know if you come up with something (using METADATA) that could provide a direction for the polished API.

cc @cwfitzgerald

from encase.

james7132 avatar james7132 commented on June 8, 2024

The actual Metadata structs I think aren't documented in any form. The latest version on doc.rs doesn't even show the METADATA constant on the trait.

I'm also interested in this as we're looking into preallocating buffer space for parallelizing buffer writes in Bevy (see bevyengine/bevy#12489)

from encase.

teoxoy avatar teoxoy commented on June 8, 2024

The metadata was meant to be internal to encase but it seems people are interested in exposing it somehow.

The main question is how would the API look like? I can see it looking quite differently depending on how it will be used.

It might be worth experimenting with an API outside encase (which would use the metadata) at first.

from encase.

Related Issues (20)

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.