PDA

View Full Version : Problem with coherent keyword on NVIDIA GTX 480



jkl
11-14-2010, 10:46 AM
Hi!
When I add a variable declaration:
layout(size4x32) coherent uniform image2D img2;
(which is btw taken directly from GL_EXT_shader_image_load_store spec.),
I keep getting something like this in the shader compilation log:
0(40) : error C0000: syntax error, unexpected identifier at token "coherent"
0(40) : error C0501: type name expected at token "coherent"
0(40) : error C1315: can't apply layout(size4x32) to non-image
0(40) : error C7537: OpenGL does not allow 'uniform' after a type specifier

Am I doing something wrong? Is there any magic involved in using GL_EXT_shader_image_load_store besides starting the shader with:
#version 410
#extension GL_EXT_shader_image_load_store : enable
?
I think that I really need the variables to be declared as coherent, because without it I keep getting unpredicted results.
Thanks all!

BTW this occurs on:
FW260.99
FW262.99
FW259.31

Edit:
Just started poring to NV_shader_buffer_store by first adding #extension GL_NV_gpu_shader5 : enable and it seemed to help. But adding
layout(size4x32) const uniform image2D imageVariable;
still produces:
0(22) : error C7522: OpenGL requires constants to be initialized .
Nevertheless I keep getting strange results so the bug must be somewhere on my side or a port to NV_shader_buffer_store is still in question.
I still consider adding #extension GL_NV_gpu_shader5 : enable should not be required.

blbec
11-18-2010, 06:25 AM
The following thread suggests that you have to use
coherent uniform layout(size4x32) image2D
and not
layout(size4x32) coherent uniform image2D

http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=285258#Post2852 71

aqnuep
11-18-2010, 06:31 AM
Yes, but as I written it just after that post
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=285273#Post2852 73
that according to the GL_EXT_shader_image_load_store spec the following are valid:
layout(size1x32) coherent uniform image2D imageVariable;
layout(size1x32) uniform image2D coherent imageVariable;
and the following is not:
coherent uniform layout(size4x32) image2D imageVariable;
So actually it seems that the NVIDIA driver is not compliant with the spec.