Reputation: 3481
Apparently tessellation shaders is able to run under OSX 10.8.3:
Does anyone have a minimum example (C++, OpenGL and GLSL) which is able to compile and run?
Also what features are currently supported / unsupported?
I am aware of that OS/X does not yet officially support tessellation shaders. What I'm looking for is a recipe for the hack used in GPUTest 0.4.0, which apparently seem to support it on some hardware.
Upvotes: 1
Views: 2094
Reputation: 56
Ok been running the code through the OpenGL profiler, it seems that it is using a tessellation shader, but not using the OpenGL defines.
As far as I can tell you use
glCreateShader(0x00008e87); // tess eval
and
glCreateShader(0x00008e88); // tess control
I can confirm that the application does use tessellation shaders as I have inspected the shader source, I'm now going to try and integrate into my own codebase using the hex values above and will report back.
Edit if you use the following it should all work (see blog and video here)
So there is a lot of basic hacking of code to get this working, I have used the following defines and got a basic passthrough shader system working.
First I use the following
#ifdef DARWIN
#ifndef GL_TESS_CONTROL_SHADER
#define GL_TESS_CONTROL_SHADER 0x00008e88
#endif
#ifndef GL_TESS_EVALUATION_SHADER
#define GL_TESS_EVALUATION_SHADER 0x00008e87
#endif
#ifndef GL_PATCHES
#define GL_PATCHES 0x0000000e
#endif
#endif
You can then load the shaders as you would do normally but use EVAL / Control as valid shader types. When you get to drawing you must use patches to draw so use glDrawArrays(GL_PATCHES ...) as you would do normally.
I intent to do a full demo / write up soon, but as it's Friday afternoon and I've been staring at code all day I'm going to the pub!
Upvotes: 4
Reputation: 56
I saw the same, can't find anything in the headers and am searching now for other examples.
The program seems to work ok on my mac / hackintosh (nVidia GT640) and also my Mac Book Pro using the GT330M both are latest Mountain Lion.
So if it is truly tessellation shaders running there must be some private API / hack that I can't find.
Upvotes: 0