mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
mesa: set correct XFB prim mode for draw validation after resuming XFB
Draws were validated against an XFB primitive type from the last glBeginTransformFeedback call, ignoring glResumeTransformFeedback that may have been after it that may have resumed for a different primitive type. The spec doesn't state this explicitly, but it's logical. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32685>
This commit is contained in:
parent
227f69716f
commit
b2ddf85591
2 changed files with 13 additions and 0 deletions
|
|
@ -1851,6 +1851,17 @@ struct gl_transform_feedback_object
|
|||
at least once? */
|
||||
GLboolean EverBound; /**< Has this object been bound? */
|
||||
|
||||
/**
|
||||
* Primitive mode from glBeginTransformFeedback.
|
||||
*
|
||||
* The spec doesn't list the primitive mode as part of transform feedback
|
||||
* objects, but it has to be because when transform feedback is resumed,
|
||||
* all draws must be validated against the primitive type that transform
|
||||
* feedback began with instead of whatever last transform feedback object
|
||||
* happened to be used.
|
||||
*/
|
||||
GLenum16 Mode;
|
||||
|
||||
/**
|
||||
* GLES: if Active is true, remaining number of primitives which can be
|
||||
* rendered without overflow. This is necessary to track because GLES
|
||||
|
|
|
|||
|
|
@ -399,6 +399,7 @@ begin_transform_feedback(struct gl_context *ctx, GLenum mode, bool no_error)
|
|||
FLUSH_VERTICES(ctx, 0, 0);
|
||||
|
||||
obj->Active = GL_TRUE;
|
||||
obj->Mode = mode;
|
||||
ctx->TransformFeedback.Mode = mode;
|
||||
|
||||
compute_transform_feedback_buffer_sizes(obj);
|
||||
|
|
@ -1291,6 +1292,7 @@ resume_transform_feedback(struct gl_context *ctx,
|
|||
{
|
||||
FLUSH_VERTICES(ctx, 0, 0);
|
||||
|
||||
ctx->TransformFeedback.Mode = obj->Mode;
|
||||
obj->Paused = GL_FALSE;
|
||||
|
||||
unsigned offsets[PIPE_MAX_SO_BUFFERS];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue