草庐IT

VertexID

全部标签

windows - gl_VertexID 中断渲染

我有以下GLSL着色器(被加载到OpenGL3.3前向上下文中,但我在2.1中得到了相同的行为):constGLchar*constglsl_vertex_timeseries={"#version330\n""#extensionGL_EXT_gpu_shader4:enable\n""""invec2in_Y;""""voidmain()""{"//"intdummy=gl_VertexID;""gl_Position=vec4(in_Y,0.0,1.0);""}"};为了定位问题,简化了很多。如图所示,它编译、链接并显示我的几何图形。如果注释行被激活,它会在没有警告的情况下进行编