GLSL float/vec3/vec4 array max size = GL_MAX_VERTEX_UNIFORM_VECTORS?

前端 未结 2 1510
谎友^
谎友^ 2020-12-16 05:07

I run

glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &maxVertUniformsVect);

and get 1024.

Than in GLSL I do

unif         


        
2条回答
  •  臣服心动
    2020-12-16 05:48

    The OpenGL Docs says it all.

    GL_MAX_VERTEX_UNIFORM_VECTORS

    data returns one value, the maximum number of 4-vectors that may be held in uniform variable storage for the vertex shader. The value of GL_MAX_VERTEX_UNIFORM_VECTORS is equal to the value of GL_MAX_VERTEX_UNIFORM_COMPONENTS and must be at least 256.

    Thereby that means that no matter the type, you can only hold an array of max GL_MAX_VERTEX_UNIFORM_VECTORS in length. Even though that vec4 == 4 floats

    The maximum value of course vary by the different hardward implementations and how old/new the individual graphics card may be of OpenGL.

提交回复
热议问题