PDA

View Full Version : open glsl support?



NeverSayImpossible
03-16-2011, 09:37 PM
When i try this, it say possible.


if (GL_ARB_vertex_shader) {
printf("Possible\n");
}


When i try this, it say "Driver does not support OpenGL Shading Language"


// Ensure we have the necessary OpenGL Shading Language extensions.

if (glewGetExtension("GL_ARB_fragment_shader") != GL_TRUE ||

glewGetExtension("GL_ARB_vertex_shader") != GL_TRUE ||

glewGetExtension("GL_ARB_shader_objects") != GL_TRUE ||

glewGetExtension("GL_ARB_shading_language_100") != GL_TRUE)

{
fprintf(stderr, "Driver does not support OpenGL Shading Language\n");

exit(1);

}

What is this talking about actually?Does my hardware support open glsl?

I get this info:


GL_VENDOR: Tungsten Graphics, Inc
GL_RENDERER: Mesa DRI Intel(R) 945GM GEM 20091221 2009Q4 x86/MMX/SSE2
GL_VERSION: 1.4 Mesa 7.7.1
GL_SHADING_LANGUAGE_VERSION: 1.20




I found that my pc does not support GL_ARB_fragment_shader only when I take out "glewGetExtension("GL_ARB_fragment_shader")!= GL_TRUE".
Why it support GL_ARB_vertex_shader but not GL_ARB_fragment_shader?Both should be together right?

Alfonse Reinheart
03-16-2011, 10:39 PM
Both should be together right?

There's a reason why it isn't called "GL_ARB_vertex_and_fragment_shader". Namely, so that implementations can choose to implement one or the other. The interface between the fixed-function pipeline and shaders is well specified, so it's not difficult to have a vertex shader work with texture environment stuff.

arekkusu
03-16-2011, 11:09 PM
The i945 has no hardware support for vertex processing at all. So ARB_vertex_shader will be completely software emulated.

Support for ARB_fragment_shader will depend on the driver. The Mac i945 driver does support this extension, looks like Mesa does not. The hardware is very limited (compared to modern ATI/NV hardware), so you should expect complex fragment shaders to fall back to software emulation even if the extension is supported.

NeverSayImpossible
03-16-2011, 11:10 PM
My question is does my hardware support glsl? Can I use glsl?

According to this info i get:

GL_VENDOR: Tungsten Graphics, Inc
GL_RENDERER: Mesa DRI Intel(R) 945GM GEM 20091221 2009Q4 x86/MMX/SSE2
GL_VERSION: 1.4 Mesa 7.7.1
GL_SHADING_LANGUAGE_VERSION: 1.20

It should be supported right?
However when i test this,

if (/*glewGetExtension("GL_ARB_fragment_shader") != GL_TRUE ||*/

glewGetExtension("GL_ARB_vertex_shader") != GL_TRUE ||

glewGetExtension("GL_ARB_shader_objects") != GL_TRUE ||

glewGetExtension("GL_ARB_shading_language_100") != GL_TRUE)

{
fprintf(stderr, "Driver does not support OpenGL Shading Language\n");

exit(1);

}
it seems like GL_ARB_fragment_shader is not supported here. When i comment take off this extension and run the test again, it does not print out statement "Driver does not support OpenGL Shading Language" anymore.

NeverSayImpossible
03-16-2011, 11:12 PM
The i945 has no hardware support for vertex processing at all. So ARB_vertex_shader will be completely software emulated.

Support for ARB_fragment_shader will depend on the driver. The Mac i945 driver does support this extension, looks like Mesa does not. The hardware is very limited (compared to modern ATI/NV hardware), so you should expect complex fragment shaders to fall back to software emulation even if the extension is supported.


Software emulated means it does not really utilize the gpu resources? Just like simulation? The performance will be the same?