? GL_CONTEXT_CORE_PROFILE_BIT
: GL_CONTEXT_COMPATIBILITY_PROFILE_BIT;
+ /* GL 4.4 */
+ consts->MaxVertexAttribStride = 2048;
+
/** GL_EXT_gpu_shader4 */
consts->MinProgramTexelOffset = -8;
consts->MaxProgramTexelOffset = 7;
[ "MAX_GEOMETRY_INPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents), extra_version_32" ],
[ "MAX_GEOMETRY_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents), extra_version_32" ],
+# GL 4.4
+ [ "MAX_VERTEX_ATTRIB_STRIDE", "CONTEXT_ENUM(Const.MaxVertexAttribStride), NO_EXTRA" ],
+
# GL_ARB_robustness
[ "RESET_NOTIFICATION_STRATEGY_ARB", "CONTEXT_ENUM(Const.ResetStrategy), NO_EXTRA" ],
/** OpenGL version 3.2 */
GLbitfield ProfileMask; /**< Mask of CONTEXT_x_PROFILE_BIT */
+ /** OpenGL version 4.4 */
+ GLuint MaxVertexAttribStride;
+
/** GL_EXT_transform_feedback */
GLuint MaxTransformFeedbackBuffers;
GLuint MaxTransformFeedbackSeparateComponents;
return;
}
+ if (ctx->API == API_OPENGL_CORE && ctx->Version >= 44 &&
+ stride > ctx->Const.MaxVertexAttribStride) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(stride=%d > "
+ "GL_MAX_VERTEX_ATTRIB_STRIDE)", func, stride);
+ return;
+ }
+
/* Page 29 (page 44 of the PDF) of the OpenGL 3.3 spec says:
*
* "An INVALID_OPERATION error is generated under any of the following
return;
}
+ if (ctx->API == API_OPENGL_CORE && ctx->Version >= 44 &&
+ stride > ctx->Const.MaxVertexAttribStride) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glBindVertexBuffer(stride=%d > "
+ "GL_MAX_VERTEX_ATTRIB_STRIDE)", stride);
+ return;
+ }
+
if (buffer == vao->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj->Name) {
vbo = vao->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj;
} else if (buffer != 0) {
continue;
}
+ if (ctx->API == API_OPENGL_CORE && ctx->Version >= 44 &&
+ strides[i] > ctx->Const.MaxVertexAttribStride) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glBindVertexBuffers(strides[%u]=%d > "
+ "GL_MAX_VERTEX_ATTRIB_STRIDE)", i, strides[i]);
+ continue;
+ }
+
if (buffers[i]) {
struct gl_vertex_buffer_binding *binding =
&vao->VertexBinding[VERT_ATTRIB_GENERIC(first + i)];