I want to read and write from an image that stores unsigned integers. How can I read and write? The standard way to read and write to an image is using imageLoad/imageStore, but when using the format qualifier r32ui, the compiler errors with no matching overloaded function found
.
This fails to compile:
#version 450
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(set = 0, binding = 0, r32ui) uniform writeonly uimage3D img;
void main() {
imageStore(img, ivec3(1,2,3), uint(4));
}
This compiles fine:
#version 450
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(set = 0, binding = 0, rgba8ui) uniform writeonly uimage3D img;
void main() {
imageStore(img, ivec3(1,2,3), uvec4(4,5,6,7));
}
I have tried using uvec3 for coordinates instead of ivec3, and uvec4 for the data to write in case I am misunderstanding what the format is storing. Using 2 dimensional images also made no difference.