GithubHelp home page GithubHelp logo

Comments (6)

tangent-vector-personal avatar tangent-vector-personal commented on June 22, 2024

Can you confirm what the desired GLSL equivalent is?

I'm guessing HLSL Buffer maps to GLSL textureBuffer or imageBuffer, but it isn't clear which.

Also: can an HLSL Buffer<T> use an arbitrary type T (like a struct) or is that limited to StructuredBuffer?

from slang.

nbentyNV avatar nbentyNV commented on June 22, 2024

Buffer<T> == textureBuffer
RWBuffer<T> == imageBuffer.
Our internal shaders only use Buffer. The ShaderBuffers sample uses both, but I'll its shaders convert it to GLSL.
T can't be a struct, it's a subset of DXGI_FORMAT.

from slang.

tangent-vector-personal avatar tangent-vector-personal commented on June 22, 2024

Thanks.
I assume that it follows that the right mapping for RWTexture2D is image2D. I've got some work to do in order to cover all this.

from slang.

nbentyNV avatar nbentyNV commented on June 22, 2024

ParticleSimulate.cs.slang uses AppendStructuredBuffer, RWStructuredBuffer and RWByteAddressBuffer.

Unfortunately, AppendStructuredBuffer requires UAV-counters which are not supported in Vulkan. The solution would be to create a typed-buffer for the counter and use atomic operations for it.

Raw-buffers have no GLSL equivalent, but we can mimic them using imageBuffer with r8 layout

from slang.

tangent-vector-personal avatar tangent-vector-personal commented on June 22, 2024

Notes to self:

  • Lowering Buffer<T> to textureBuffer (and b[i] to texelFetch) should work, and just puts a bit more emphasis on making sure that the hackSamplerForTexelFetch thing works.

  • Mapping raw buffers to imageBuffer with r8 labor sounds reasonable (although "byte-address" buffers are actually more "uint32-address" buffers). The challenge is mapping all the intrinsic operations reasonably. Does GLSL support atomic son images?

  • creating an additional buffer just to store an atomic counter is annoying in a lot of ways. I suppose it can't be helped, but this seems like it will be lower on the priority order.

from slang.

nbentyNV avatar nbentyNV commented on June 22, 2024

I'll disable the particle system for Vulkan for now

from slang.

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.