Detect SM 4.0 in the shader?

Is there a define for SM 4.0? I know you can enable the extension, but is there a simple way to detect whether SM 4.0 is supported?

Like this:

#ifdef SM_4_Supported
Do what you want
#else
Fall back to SM 3.0 rendering
#endif

Well, just look out for the geometry shader extension or that gpu_shader4 one. Won’t work for ATI ards though, but they are unlikely to implement features you seek in glsl anyway.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.