简体   繁体   中英

Uniform texel buffer for Vulkan GLSL

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM