I have an float RGBA buffer that I want to pass to my compute shader as a Uniform Texel Buffer (for read-only access with no sampling). Can someone tell me how to do this in GLSL?
All examples I can find seem to be skipping that topic or have a at best weak nomenclature.
The descriptor type that Vulkan calls "uniform texel buffer" represents a concept that, in OpenGL parlance, is called a "buffer texture". While normally the GLSL type for this would be samplerBuffer, the Vulkan flavor of GLSL uses textureBuffer instead.
The corresponding descriptor for this type should of course use the VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER type. However, since Vulkan doesn't share OpenGL's notion that this is some kind of texture, the descriptor's data is a VkBufferView, not a VkImage or VkImageView. Specifically, VkWriteDescriptorSet::pTexelBufferView.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With