I begin with geometry shader and have a problem with the glCreateShader(GL_GEOMETRY_SHADER_EXT) that return a value of 0
GLEW say that geometry shaders are supported
glewInit();
if (glewIsSupported("GL_VERSION_2_1"))
printf("Ready for OpenGL 2.1
");
else {
printf("OpenGL 2.1 not supported
");
exit(1);
}
if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader && GL_EXT_geometry_shader4)
printf("Ready for GLSL - vertex, fragment, and geometry units
");
else {
printf("Not totally ready :(
");
exit(1);
}
Ready for OpenGL 2.1
Ready for GLSL - vertex, fragment, and geometry units
But the id returned by glCreateShader(GL_GEOMETRY_SHADER_EXT) is always 0
v = glCreateShader(GL_VERTEX_SHADER);
if( v == 0)
{
printf("can't create a GL_VERTEX_SHADER :(
");
exit(0);
}else{
printf("The vertex shader as the id %d
", v);
}
f = glCreateShader(GL_FRAGMENT_SHADER);
if( f == 0)
{
printf("can't create a GL_FRAGMENT_SHADER :(
");
exit(0);
}else{
printf("The fragment shader as the id %d
", v);
}
g = glCreateShader(GL_GEOMETRY_SHADER_EXT);
if( g == 0)
{
printf("can't create a GL_GEOMETRY_SHADER_EXT :(
");
exit(0);
}else{
printf("The vertex shader as the id %d
", v);
}
say this :
The vertex shader as the id 1
The fragment shader as the id 1
can't create a GL_GEOMETRY_SHADER_EXT :(
So, of course I have a core dump at each glProgramParameteriEXT(p,GL_GEOMETRY_âŚ) found after
=> what is the good way for to have a valid geometry shader id returned by the glCreateShader() func ?
PS : g = glCreateShaderObjectARB(GL_GEOMETRY_SHADER_EXT) return too the value 0
PS2 : the error returned by glGetError is 1282 (GL_INVALID_OPERATION)
if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader && GL_EXT_geometry_shader4)
Itâs been a while since I used GLEW, but shouldnât that last one be GLEW_EXT_geometry_shader4?
Also, if youâre using GL 2.1, you shouldnât be using the ARB vertex and fragment shader extensions. You should be using the core functionality. There are significant API differences between the two.
I use a GeForce 7100 GS
Only GeForce 8xxx cards or better support Geometry shaders.
And I use effectively the core fonctionnality of fragment and vertex shaders (cf. not the ARB version) since a long time.
Can the geometry shader stage to be âemuledâ or something like this ?
Or I have obligatory to have a GeForce 8xx for to can use geometry shaders ???
(I prefer to use a NVidia card because their cards work very fine on linux/opengl and are good maintened)
Have you a reference of a âgood quality/priceâ GeForce 8xx ?
(and with a reseonable consommation because I donât want to install a radiator into my computer )
Unlike D3D, OpenGL donât have HAL, so if something is not implemented in hardware/drivers, you cannot emulate it on CPU side (unless you are using CPU implementation, like Mesa3D, but Mesa3D is stuck at GL 2.1, so forget about software implementation of Geometry shaders).
Also, my advice is to forget about NV 8xxx cards. Soon youâll try to execute tessellation shaders, and youâll be at the same position where you are now. So, get some NV 4xx card.
You may have difficulty finding a Geforce 8 in these times. If you want a recent Geforce which doesnât have a high power requirement, you can look for a Geforce GT 440 or Geforce GT 430, where the 440 is a slightly faster version of the 430. Both cards can be found for between 50 and 90 USD.