* So we need to override the Mesa default (which is based only on software
* limits).
*/
- ctx->Const.MaxTransformFeedbackSeparateAttribs = BRW_MAX_SOL_BUFFERS;
+ ctx->Const.MaxTransformFeedbackBuffers = BRW_MAX_SOL_BUFFERS;
/* On Gen6, in the worst case, we use up one binding table entry per
* transform feedback component (see comments above the definition of
if (ctx->TransformFeedback.CurrentBuffer == bufObj) {
_mesa_BindBufferARB( GL_TRANSFORM_FEEDBACK_BUFFER, 0 );
}
- for (j = 0; j < MAX_FEEDBACK_ATTRIBS; j++) {
+ for (j = 0; j < MAX_FEEDBACK_BUFFERS; j++) {
if (ctx->TransformFeedback.CurrentObject->Buffers[j] == bufObj) {
_mesa_BindBufferBase( GL_TRANSFORM_FEEDBACK_BUFFER, j, 0 );
}
#define SUPPORTED_ATI_BUMP_UNITS 0xff
/** For GL_EXT_transform_feedback */
+#define MAX_FEEDBACK_BUFFERS 4
#define MAX_FEEDBACK_ATTRIBS 32
/** For GL_ARB_geometry_shader4 */
ctx->Const.QuadsFollowProvokingVertexConvention = GL_TRUE;
/* GL_EXT_transform_feedback */
- ctx->Const.MaxTransformFeedbackSeparateAttribs = MAX_FEEDBACK_ATTRIBS;
+ ctx->Const.MaxTransformFeedbackBuffers = MAX_FEEDBACK_BUFFERS;
ctx->Const.MaxTransformFeedbackSeparateComponents = 4 * MAX_FEEDBACK_ATTRIBS;
ctx->Const.MaxTransformFeedbackInterleavedComponents = 4 * MAX_FEEDBACK_ATTRIBS;
CONTEXT_INT(Const.MaxTransformFeedbackInterleavedComponents),
extra_EXT_transform_feedback },
{ GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
- CONTEXT_INT(Const.MaxTransformFeedbackSeparateAttribs),
+ CONTEXT_INT(Const.MaxTransformFeedbackBuffers),
extra_EXT_transform_feedback },
{ GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,
CONTEXT_INT(Const.MaxTransformFeedbackSeparateComponents),
return TYPE_INT_4;
case GL_TRANSFORM_FEEDBACK_BUFFER_START:
- if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs)
+ if (index >= ctx->Const.MaxTransformFeedbackBuffers)
goto invalid_value;
if (!ctx->Extensions.EXT_transform_feedback)
goto invalid_enum;
return TYPE_INT64;
case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
- if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs)
+ if (index >= ctx->Const.MaxTransformFeedbackBuffers)
goto invalid_value;
if (!ctx->Extensions.EXT_transform_feedback)
goto invalid_enum;
return TYPE_INT64;
case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
- if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs)
+ if (index >= ctx->Const.MaxTransformFeedbackBuffers)
goto invalid_value;
if (!ctx->Extensions.EXT_transform_feedback)
goto invalid_enum;
* hardware back-ends to determine the correct stride when interleaving
* multiple transform feedback outputs in the same buffer.
*/
- unsigned BufferStride[MAX_FEEDBACK_ATTRIBS];
+ unsigned BufferStride[MAX_FEEDBACK_BUFFERS];
};
at least once? */
/** The feedback buffers */
- GLuint BufferNames[MAX_FEEDBACK_ATTRIBS];
- struct gl_buffer_object *Buffers[MAX_FEEDBACK_ATTRIBS];
+ GLuint BufferNames[MAX_FEEDBACK_BUFFERS];
+ struct gl_buffer_object *Buffers[MAX_FEEDBACK_BUFFERS];
/** Start of feedback data in dest buffer */
- GLintptr Offset[MAX_FEEDBACK_ATTRIBS];
+ GLintptr Offset[MAX_FEEDBACK_BUFFERS];
/** Max data to put into dest buffer (in bytes) */
- GLsizeiptr Size[MAX_FEEDBACK_ATTRIBS];
+ GLsizeiptr Size[MAX_FEEDBACK_BUFFERS];
};
GLbitfield ProfileMask; /**< Mask of CONTEXT_x_PROFILE_BIT */
/** GL_EXT_transform_feedback */
- GLuint MaxTransformFeedbackSeparateAttribs;
+ GLuint MaxTransformFeedbackBuffers;
GLuint MaxTransformFeedbackSeparateComponents;
GLuint MaxTransformFeedbackInterleavedComponents;
return;
}
- if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+ if (index >= ctx->Const.MaxTransformFeedbackBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(index=%d)", index);
return;
}
return;
}
- if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+ if (index >= ctx->Const.MaxTransformFeedbackBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferBase(index=%d)", index);
return;
}
return;
}
- if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+ if (index >= ctx->Const.MaxTransformFeedbackBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glBindBufferOffsetEXT(index=%d)", index);
return;
if (count < 0 ||
(bufferMode == GL_SEPARATE_ATTRIBS &&
- (GLuint) count > ctx->Const.MaxTransformFeedbackSeparateAttribs)) {
+ (GLuint) count > ctx->Const.MaxTransformFeedbackBuffers)) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glTransformFeedbackVaryings(count=%d)", count);
return;
c->UniformBooleanTrue = ~0;
- c->MaxTransformFeedbackSeparateAttribs =
+ c->MaxTransformFeedbackBuffers =
screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS);
+ c->MaxTransformFeedbackBuffers = MIN2(c->MaxTransformFeedbackBuffers, MAX_FEEDBACK_BUFFERS);
c->MaxTransformFeedbackSeparateComponents =
screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS);
c->MaxTransformFeedbackInterleavedComponents =