-1
我想在Mac上鑲嵌着色但它返回的錯誤列表:Opengl的鑲嵌錯誤的MAC
ERROR: 0:2: Invalid use of layout 'vertices'
ERROR: 0:12: Use of undeclared identifier 'gl_InvocationID'
ERROR: 0:12: Use of undeclared identifier 'gl_InvocationID'
ERROR: 0:13: Use of undeclared identifier 'gl_InvocationID'
ERROR: 0:14: Use of undeclared identifier 'gl_TessLevelInner'
ERROR: 0:15: Use of undeclared identifier 'gl_TessLevelOuter'
ERROR: 0:16: Use of undeclared identifier 'gl_TessLevelOuter'
ERROR: 0:17: Use of undeclared identifier 'gl_TessLevelOuter'
這似乎有些不妥鑲嵌控制着色器。
#version 410
layout(vertices = 3) out;
in vec3 vPosition[];
out vec3 tcPosition[];
uniform float TessLevelInner;
uniform float TessLevelOuter;
#define ID gl_InvocationID
void main()
{
tcPosition[ID] = vPosition[ID];
if (ID == 0) {
gl_TessLevelInner[0] = TessLevelInner;
gl_TessLevelOuter[0] = TessLevelOuter;
gl_TessLevelOuter[1] = TessLevelOuter;
gl_TessLevelOuter[2] = TessLevelOuter;
}
}
我的OpenGL項目工作正常,在我2010的Windows PC ... 我想知道如果這是一個MacOSX的問題?我的Mac上的GPU是Intel Iris。 任何人都得到了這個線索......
的main.cpp中的代碼共享here
static GLuint LoadProgram(const char* vert, const char* tcs, const char* tes,const char* geom, const char* frag)
{
GLuint prog = glCreateProgram();
if(vert) AttachShader(prog, GL_VERTEX_SHADER, vert);
if(tcs) AttachShader(prog, GL_VERTEX_SHADER, tcs);
if(tes) AttachShader(prog, GL_VERTEX_SHADER, tes);
if(geom) AttachShader(prog, GL_GEOMETRY_SHADER, geom);
if(frag) AttachShader(prog, GL_FRAGMENT_SHADER, frag);
glLinkProgram(prog);
CheckStatus(prog);
return prog;
}
在初始化過程中是否要求* Core * OpenGL上下文? –
我在glfw初始化中初始化了GLFW_OPENGL_CORE_PROFILE:glfwWindowHint(GLFW_OPENGL_PROFILE,GLFW_OPENGL_CORE_PROFILE); –
請檢查我上面共享的main.cpp –