PDA

View Full Version : GL_ARB_shading_language_packing, GLSL 3.3



AlexeyAR5
08-11-2011, 07:22 AM
Hi, everybody.

I have recently installed 280.26 drivers on my nVidia GeForce GTX 295. As http://developer.nvidia.com/content/nvidia-opengl-42-drivers-windows-and-linux-now-available states, ARB_shading_language_packing should be supported on my GL 3.3 class hardware despite it is a 4.2 feature. But after I try to compile a simple GLSL fragment shader like this:


#version 420 compatibility

void main()
{
vec2 v;
packHalf2x16(v.xy);

gl_FragColor = vec4(1, 1, 1, 1);
}

I receive a warning that I was supposed to receive (so it's ok):

warning C7568: #version 420 not fully supported on current GPU target profile
and an error:

error C1008: undefined variable "packHalf2x16"

I tried to enable GL_ARB_shading_language_packing extension:

#extension GL_ARB_shading_language_packing : enable

but after I receive a warning: "extension non supported".

So, is there any way I can use 2half packing & unpacking using GLSL on a 3.3 OpenGL generation graphics card?

Thanks in advance,
Alexey

Alfonse Reinheart
08-11-2011, 10:03 AM
This


#version 420 compatibility

Is not true. Your GLSL version is 3.30, not 4.20. By all rights, the compiler should have stopped with just that line.

Ludde
08-11-2011, 12:08 PM
Its the 280.28 driver that your link refers to, not 280.26 that you use.

AlexeyAR5
08-12-2011, 02:40 AM
The compiler is not stopping after that line (280.26 drivers), he just generates a warning. (btw, on older drivers the compiler generates an error). So, I can use some features of GLSL 4.20 on GLSL 3.30 hardware. For example: scalar swizzle operations (4.20 feature) are available after I define my shader version to be 4.20 (even if glGetString return shader version 3.30)

AlexeyAR5
08-12-2011, 05:48 AM
Thanks for the point, that fixed the problem. 280.28 driver allow pack/unpack operations on 3.30 generation hardware.

Alfonse Reinheart
08-12-2011, 10:22 AM
The compiler is not stopping after that line (280.26 drivers), he just generates a warning. (btw, on older drivers the compiler generates an error).

Then your driver needs to be fixed. The specification is quite clear on this: if you provide a GLSL version that is higher than what the driver supports (and an OpenGL 3.3 implementation cannot support 4.20), then this is an error.

The proper way to use something like shading_language_packing with 3.30 is to use it as an extension. You use version 3.30, and then enable the shading_language_packing extension.