Well, sorry to bump this one again, but i’ve got stuck in a further issue. To clarify a bit, i’m trying to implement a radix sort on the GPU using opengl and a good bunch of extensions, and it’s the reason why i need so much these unsigned integer texture formats.
I know there might not be much benefit to do so, but i’d like get the sorted data directly on the GPU (sorting particles and transparent triangles).
I’ve got now a compiling shader using EXT_texture_image_load_store, EXT_gpu_shader4, and a couple of R32UI images bound, one as read only, and the other as write only to store statistics on the first one. The first texture image (read only) is actually a texture_buffer storing in a VBO the keys so sort out.
I tried the approach to use a FBO to render in the unsigned luminance integer texture first, but the result was always a texture filled with zeros. This is why i now try to use only texture_image_load_store, as there seems to be conflicts when used with FBOs.
I may first report this bug which i stumbled upon, when glMemoryBarrierEXT is used before any draw calls is issued, it causes the application process to exit without any explicit error message. When it’s used after there is no problems, i assume it works properly.
When it comes to using uint in GLSL code, i was surprised how restricted it is with constants: it’s forcing to typecast explicitelly every integer constant to uint because “implicit” conversions from integers are forbidden, as a result you end up with code like this:
uint test = uint(0);
uint somecalculation = (i<<uint(2))+j;
Also, when it comes to EXT_texture_image_load_store, i noticed that the keywords from the specification such as const, restrict and coherent are unsupported when declaring images. This seems to be the only declaration that works out in my case:
layout(size1x32) volatile uniform uimage2D statistics;
I’m bumping into some really odd side effects because i’d need some cache coherency, but
layout(size1x32) coherent uniform uimage2D statistics;
triggers an error:
0(7) : error C0000: syntax error, unexpected identifier, expecting “::” at token “coherent”
I hope my feedback (and mistakes) can help out others to learn from this…