Dear guys
I am trying to do a simple compute shader program … and there is an error on compiling time.
This is my simple shader…basically computing a histogram from a 16 bits grayscale imput image. Very basic, and easy task…but I am stuck with the image2D
types
It is supposed that my machine supports opengl 4.5 … I updated the drivers, and I download GLAD with OpenGL 4.3 support… the host program compiles and run, but the compute shader program does not compiles due to a weird error (r32ui
and r16ui
) I would want to use integer types… I do not want to convert types into floating point because it will add latency in the program… what can I do? Why r16ui
and r32ui
is not supported??
#version 430 core
layout (binding=0, r16ui) readonly uniform image2D input_image;
layout (binding=1, r32ui) coherent uniform image1D histogram;
layout (local_size_x = 16, local_size_y = 16) in;
void main()
{
int gray = imageLoad(input_image, gl_GlobalInvocationID.xy).r;
imageAtomicAdd(histogram, gray, 1);
}
COMPILING ERROR:
ERROR: 0:2: '' : image layout format qualifier does not match image type
ERROR: 0:2: '' : image layout format qualifier does not match image type
...
it is fixed when I change r16ui
and r32ui
to r32f
… but I dont want that
let me know if I am doing somethig wroing…
thank you
freelancerLatino1 at gmail dot com