PDA

View Full Version : NV minibug: using gl_MaxPatchVertices or similar needs GL_NV_gpu_shader5



oscarbg
03-12-2013, 02:46 AM
Hi defining a tess control shader gl_PerVertex using explicit sizing with gl_MaxPatchVertices fails compilation saying it requires:
#extension GL_NV_gpu_shader5 : enable

as this is a GLSL standard feature this is a bug..


out gl_PerVertex {
vec4 gl_Position;
vec3 pos2;
vec3 pos3;
vec3 nor1;
vec3 nor2;
vec3 tex;

float gl_PointSize;
} mygl_out[gl_MaxPatchVertices];

Alfonse Reinheart
03-12-2013, 03:38 AM
You probably confused the compiler when you redeclare gl_PerVertex by adding a bunch of variables to it. That's not allowed. The spec is very clear; you can only redeclare them with their current set of members.

If you have user-defined values, you need a user-defined interface block to stick them in.

oscarbg
03-12-2013, 03:53 AM
Ok Alfonse,
you make me reason harder but I still have some reason..
let's see..
1. note I say that adding GL_NV_gpu_shader5 shader works so seems i'm not violating OGL too much..
2. Sorry for gl_PerVertex def but even with an standard one it fails also..


out gl_PerVertex {
vec4 gl_Position;
float gl_PointSize;
float gl_ClipDistance[];
} gl_out[gl_MaxPatchVertices];

3. I redefine whole data buffer names to avoid naming bugs and also fails:


out myglperv{
vec4 pos1;
//vec4 gl_Position;
vec3 pos2;
vec3 pos3;
vec3 nor1;
vec3 nor2;
vec3 tex;
} mygl_out[gl_MaxPatchVertices];