OpenGL: glVertexAttribPointer() fails with “Invalid value” for stride bigger than 2048 o
Did anyone else recognize that it is not possible any more to call glVertexAttribPointer() with a stride bigger then 2048 with new NVIDIA drivers (from 331.58 WHQL and above)? The call creates the OpenGL error Invalid value (1281). For example the following minimal GLUT example will generate the OpenGL error 1281 after testStride(2049); is called when using driver 331.58 WHQL: [code] #include <iostream> #include <GL/glut.h> #include <windows.h> using namespace std; PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer = 0; void testStride(const GLsizei stride) { glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, stride, 0); GLenum code = glGetError(); if (code != GL_NO_ERROR) std::cerr << "glVertexAttribPointer() with a stride of " << stride << " failed with code " << code << std::endl; else std::cout << "glVertexAttribPointer() with a stride of " << stride << " succeeded" << std::endl; } void render(void) { testStride(2048); // Works well with driver version 311.06 and 331.58 testStride(2049); // Does not work with driver version 331.58 but works well with driver version 311.06 } int main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA); glutCreateWindow("Window"); glutDisplayFunc(render); glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) wglGetProcAddress("glVertexAttribPointer"); glutMainLoop(); return 0; }[/code]
Did anyone else recognize that it is not possible any more to call glVertexAttribPointer() with a stride bigger then 2048 with new NVIDIA drivers (from 331.58 WHQL and above)? The call creates the OpenGL error Invalid value (1281).

For example the following minimal GLUT example will generate the OpenGL error 1281 after testStride(2049); is called when using driver 331.58 WHQL:

#include <iostream>
#include <GL/glut.h>
#include <windows.h>

using namespace std;

PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer = 0;

void testStride(const GLsizei stride)
{
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, stride, 0);
GLenum code = glGetError();
if (code != GL_NO_ERROR)
std::cerr << "glVertexAttribPointer() with a stride of " << stride << " failed with code " << code << std::endl;
else std::cout << "glVertexAttribPointer() with a stride of " << stride << " succeeded" << std::endl;
}

void render(void)
{
testStride(2048); // Works well with driver version 311.06 and 331.58
testStride(2049); // Does not work with driver version 331.58 but works well with driver version 311.06
}

int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutCreateWindow("Window");
glutDisplayFunc(render);

glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) wglGetProcAddress("glVertexAttribPointer");

glutMainLoop();
return 0;
}

#1
Posted 12/13/2013 01:22 PM   
Scroll To Top