Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uniform texel buffer for Vulkan GLSL

Tags:

glsl

vulkan

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.

like image 967
abergmeier Avatar asked Nov 30 '25 16:11

abergmeier


1 Answers

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.

like image 78
Nicol Bolas Avatar answered Dec 02 '25 06:12

Nicol Bolas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!