Double Precision Texel Buffers

I am trying double precision compute, for that I create a VkBuffer and a VkBufferView with VK_FORMAT_R64_SFLOAT, that works. Next step is me being puzzled as there is no glsl r64f Format Specifier as of GLSL 4.5 for the corresponding glsl imageBuffer resource. So the question would be: How would I access this double precision buffer with imageLoad, imageStore from my compute shader?

I think you have to stick to SPIR-V image formats.
Or you could try using shaderStorageImageReadWithoutFormat and shaderStorageImageWriteWithoutFormat Vulkan feature and try to coax GLSL compiler to somehow make SPIR-V with equally named capabilities. Haven’t tried that. Perhaps by declaring EXT_shader_image_load_formatted GLSL extension and not using the format qualifiers.

You don’t.

Vulkan does not provide a mechanism for allowing double-precision formats for this purpose. While vkGetPhysicalDeviceFormatProperties does permit an implementation to allow you to create a buffer view with that format, it has no way of actually accessing it.

Really, the only point in the double-precision formats is to allow double-precision vertex attributes.

Indeed, according to the Vulkan driver database, the only drivers that claim to provide non-vertex format use of the 64-bit formats are the RADV drivers for AMD hardware (and a few ancient and likely broken drivers).

Thanks to both of you and your inputs.

@Alfonse, sad, but I guess this will change with OpenCL being merged in.
@krOoze, thanks … again :slight_smile: … your suggestion pointed me in the right direction!

For future reference, the solution to my issue is to the VK_FORMAT_R32G32_UINT with glsl rg32ui format specifier and using (un)packDouble2x32 functions in the compute shader.

[QUOTE=ParticlePeter;42428]Thanks to both of you and your inputs.

@Alfonse, sad, but I guess this will change with OpenCL being merged in.[/quote]

… huh? Since when was OpenCL being merged with Vulkan?

Hidden here:
Debunked here:
And cited here: :cool: