ctx->Const.MaxTransformFeedbackBuffers = MAX_FEEDBACK_BUFFERS;
ctx->Const.MaxTransformFeedbackSeparateComponents = 4 * MAX_FEEDBACK_ATTRIBS;
ctx->Const.MaxTransformFeedbackInterleavedComponents = 4 * MAX_FEEDBACK_ATTRIBS;
+ ctx->Const.MaxVertexStreams = 1;
/** GL_ARB_uniform_buffer_object */
ctx->Const.MaxCombinedUniformBlocks = 36;
EXTRA_EXT(ARB_vertex_shader);
EXTRA_EXT(EXT_transform_feedback);
EXTRA_EXT(ARB_transform_feedback2);
+EXTRA_EXT(ARB_transform_feedback3);
EXTRA_EXT(EXT_pixel_buffer_object);
EXTRA_EXT(ARB_vertex_program);
EXTRA_EXT2(NV_point_sprite, ARB_point_sprite);
{ GL_TRANSFORM_FEEDBACK_BINDING, LOC_CUSTOM, TYPE_INT, 0,
extra_ARB_transform_feedback2 },
+ /* GL_ARB_transform_feedback3 */
+ { GL_MAX_TRANSFORM_FEEDBACK_BUFFERS,
+ CONTEXT_INT(Const.MaxTransformFeedbackBuffers),
+ extra_ARB_transform_feedback3 },
+ { GL_MAX_VERTEX_STREAMS,
+ CONTEXT_INT(Const.MaxVertexStreams),
+ extra_ARB_transform_feedback3 },
+
/* GL_ARB_geometry_shader4 */
{ GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB,
CONTEXT_INT(Const.MaxGeometryTextureImageUnits),
GLuint MaxTransformFeedbackBuffers;
GLuint MaxTransformFeedbackSeparateComponents;
GLuint MaxTransformFeedbackInterleavedComponents;
+ GLuint MaxVertexStreams;
/** GL_EXT_gpu_shader4 */
GLint MinProgramTexelOffset, MaxProgramTexelOffset;
return;
}
+ if (ctx->Extensions.ARB_transform_feedback3) {
+ if (bufferMode == GL_INTERLEAVED_ATTRIBS) {
+ unsigned buffers = 1;
+
+ for (i = 0; i < count; i++) {
+ if (strcmp(varyings[i], "gl_NextBuffer") == 0)
+ buffers++;
+ }
+
+ if (buffers > ctx->Const.MaxTransformFeedbackBuffers) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTransformFeedbackVaryings(too many gl_NextBuffer "
+ "occurences)");
+ return;
+ }
+ } else {
+ for (i = 0; i < count; i++) {
+ if (strcmp(varyings[i], "gl_NextBuffer") == 0 ||
+ strcmp(varyings[i], "gl_SkipComponents1") == 0 ||
+ strcmp(varyings[i], "gl_SkipComponents2") == 0 ||
+ strcmp(varyings[i], "gl_SkipComponents3") == 0 ||
+ strcmp(varyings[i], "gl_SkipComponents4") == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTransformFeedbackVaryings(SEPARATE_ATTRIBS,"
+ "varying=%s)",
+ varyings[i]);
+ return;
+ }
+ }
+ }
+ }
+
/* free existing varyings, if any */
for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) {
free(shProg->TransformFeedback.VaryingNames[i]);