-
Notifications
You must be signed in to change notification settings - Fork 247
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
Texel Buffers (Uniform + Storage) #569
Comments
Are formats like |
Both Uniform and Storage Texel Buffers are implemented in #359. With that PR you'd write the types from your example as follows: use spirv_std::Image;
type UniformBuffer = Image!(buffer, type=f32, sampled);
type StorageBuffer = Image!(buffer, format=r32f, sampled=false); |
Very cool! @XAMPPRocky SPIR-V doesn't care about the specific format for those cases. It's like a texture, conversion happens on load and the exact format is specified when binding the texture. And yeah I think that's just supported for the Uniform variant. |
these are now available in main. |
Vulkan Texel buffers are (potentially) large 1-D images that are not backed by image objects, instead they're backed by a VkBufferView specifying a range (and format, for free conversion) of a VkBuffer.
These can be either read-only (Uniform Texel Buffers) or read/write (Storage Texel Buffers).
The corresponding SPIR-V can be found at https://github.com/KhronosGroup/GLSL/blob/master/extensions/khr/GL_KHR_vulkan_glsl.txt#L370 .
Essentially, it's just texelFetch on an image with Dim = Buffer.
Historically, they are yet another historical artifact that predate storage buffers, they existed as a special kind of 1D textures in OpenGL to access large arbitrary data. Effectively it's using a texture unit on a linear buffer, so they still have advantages such as free format conversion from packed integer formats to float, and accessing unaligned formats like R32G32B32_FLOAT , which is good in raytracing shaders for grabbing vertex data through bindless arrays of these for doing stuff like normal or UV coordinate interpolation after a hit
#450 is related.
The text was updated successfully, but these errors were encountered: