The per-stage limits are the constants GL_MAX_VERTEX_UNIFORM_COMPONENTS, GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, and GL_MAX_FRAGMENT_UNIFORM_COMPONENTS (also GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS and GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS if OpenGL 4.0 or ARB_tessellation_shader, and GL_MAX_COMPUTE_UNIFORM_COMPONENTS if OpenGL 4.3 or ARB_compute_shader). Each shader stage has a limit on the number of available uniforms. The number of active uniforms available is bound by a set of limits. Inactive uniforms cannot be used to do anything in a program. Therefore, a uniform that is exposed by a fully linked program is called an "active" uniform any other uniform specified by the original shaders is inactive. It is only available if that uniform is used by code that affects the stage output, and that the uniform itself can change the output of the stage. Because of this, a uniform defined in a shader file does not have to be made available in the linked program. Therefore, they do their best to eliminate code that does not affect the stage outputs. GLSL compilers and linkers try to be as efficient as possible. You may not use a uniform location outside of the range [0, GL_MAX_UNIFORM_LOCATIONS), nor may the sequential assignment of uniform locations due to array/struct aggregation go outside of this range. The maximum number of available locations within a single program is GL_MAX_UNIFORM_LOCATIONS, which will be at least 1024 locations. Even if some_vecs was a mat4, it would not be the same, since they don't have the same name or same array index. But it wouldn't have the same name, or same type, or other characteristics. Some_mats takes up 10 uniform locations, from. Layout ( location = 2 ) uniform mat4 some_mats layout ( location = 6 ) uniform vec4 some_vecs
0 Comments
Leave a Reply. |