mesa: inline st_draw_transform_feedback
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
This commit is contained in:
+16
-4
@@ -46,6 +46,7 @@
|
||||
|
||||
#include "state_tracker/st_context.h"
|
||||
#include "state_tracker/st_draw.h"
|
||||
#include "util/u_draw.h"
|
||||
#include "util/u_threaded_context.h"
|
||||
|
||||
typedef struct {
|
||||
@@ -2193,11 +2194,22 @@ _mesa_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name,
|
||||
primcount))
|
||||
return;
|
||||
|
||||
/* Maybe we should do some primitive splitting for primitive restart
|
||||
* (like in DrawArrays), but we have no way to know how many vertices
|
||||
* will be rendered. */
|
||||
st_prepare_draw(ctx, ST_PIPELINE_RENDER_STATE_MASK);
|
||||
|
||||
st_draw_transform_feedback(ctx, mode, primcount, stream, obj);
|
||||
struct pipe_draw_indirect_info indirect;
|
||||
memset(&indirect, 0, sizeof(indirect));
|
||||
indirect.count_from_stream_output = obj->draw_count[stream];
|
||||
if (indirect.count_from_stream_output == NULL)
|
||||
return;
|
||||
|
||||
struct pipe_draw_start_count_bias draw = {0};
|
||||
struct pipe_draw_info info;
|
||||
util_draw_init_info(&info);
|
||||
info.max_index = ~0u; /* so that u_vbuf can tell that it's unknown */
|
||||
info.mode = mode;
|
||||
info.instance_count = primcount;
|
||||
|
||||
cso_draw_vbo(st_context(ctx)->cso_context, &info, 0, &indirect, &draw, 1);
|
||||
|
||||
if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) {
|
||||
_mesa_flush(ctx);
|
||||
|
||||
@@ -299,33 +299,6 @@ st_indirect_draw_vbo(struct gl_context *ctx,
|
||||
_mesa_flush(ctx);
|
||||
}
|
||||
|
||||
void
|
||||
st_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
|
||||
unsigned num_instances, unsigned stream,
|
||||
struct gl_transform_feedback_object *tfb_vertcount)
|
||||
{
|
||||
struct st_context *st = st_context(ctx);
|
||||
struct pipe_draw_info info;
|
||||
struct pipe_draw_indirect_info indirect;
|
||||
struct pipe_draw_start_count_bias draw = {0};
|
||||
|
||||
st_prepare_draw(ctx, ST_PIPELINE_RENDER_STATE_MASK);
|
||||
|
||||
memset(&indirect, 0, sizeof(indirect));
|
||||
util_draw_init_info(&info);
|
||||
info.max_index = ~0u; /* so that u_vbuf can tell that it's unknown */
|
||||
info.mode = mode;
|
||||
info.instance_count = num_instances;
|
||||
|
||||
/* Transform feedback drawing is always non-indexed. */
|
||||
/* Set info.count_from_stream_output. */
|
||||
indirect.count_from_stream_output = tfb_vertcount->draw_count[stream];
|
||||
if (indirect.count_from_stream_output == NULL)
|
||||
return;
|
||||
|
||||
cso_draw_vbo(st->cso_context, &info, 0, &indirect, &draw, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
st_draw_gallium_vertex_state(struct gl_context *ctx,
|
||||
struct pipe_vertex_state *state,
|
||||
|
||||
@@ -88,11 +88,6 @@ st_draw_quad(struct st_context *st,
|
||||
const float *color,
|
||||
unsigned num_instances);
|
||||
|
||||
void
|
||||
st_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
|
||||
unsigned num_instances, unsigned stream,
|
||||
struct gl_transform_feedback_object *tfb_vertcount);
|
||||
|
||||
void
|
||||
st_indirect_draw_vbo(struct gl_context *ctx,
|
||||
GLenum mode, GLenum index_type,
|
||||
|
||||
Reference in New Issue
Block a user