st/mesa: constify the pipe_draw_info parameter and remove obsolete comments

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27525>
This commit is contained in:
Marek Olšák 2022-12-31 12:35:37 -05:00 committed by Marge Bot
parent bf30127941
commit 8618062b3c
5 changed files with 13 additions and 18 deletions

View file

@ -218,7 +218,7 @@ cso_draw_arrays(struct cso_context *cso, unsigned mode, unsigned start, unsigned
static ALWAYS_INLINE void
cso_draw_vbo(struct cso_context *cso,
struct pipe_draw_info *info,
const struct pipe_draw_info *info,
unsigned drawid_offset,
const struct pipe_draw_indirect_info *indirect,
const struct pipe_draw_start_count_bias *draws,

View file

@ -143,20 +143,13 @@ struct dd_function_table {
*/
/**
* Optimal Gallium version of Draw() that doesn't require translation
* of draw info in the state tracker.
* The basic draw function used to implement glDrawArrays, glDrawElements,
* multidraws, and instancing.
*
* The interface is identical to pipe_context::draw_vbo.
*
* "info" is not const and the following fields can be changed by
* the callee, so callers should be aware:
* - info->index_bounds_valid (if false)
* - info->min_index (if index_bounds_valid is false)
* - info->max_index (if index_bounds_valid is false)
* - info->drawid (if increment_draw_id is true)
*/
void (*DrawGallium)(struct gl_context *ctx,
struct pipe_draw_info *info,
const struct pipe_draw_info *info,
unsigned drawid_offset,
const struct pipe_draw_indirect_info *indirect,
const struct pipe_draw_start_count_bias *draws,

View file

@ -113,7 +113,7 @@ st_prepare_draw(struct gl_context *ctx, uint64_t state_mask)
void
st_draw_gallium(struct gl_context *ctx,
struct pipe_draw_info *info,
const struct pipe_draw_info *info,
unsigned drawid_offset,
const struct pipe_draw_indirect_info *indirect,
const struct pipe_draw_start_count_bias *draws,
@ -435,7 +435,7 @@ st_draw_quad(struct st_context *st,
static void
st_hw_select_draw_gallium(struct gl_context *ctx,
struct pipe_draw_info *info,
const struct pipe_draw_info *info,
unsigned drawid_offset,
const struct pipe_draw_indirect_info *indirect,
const struct pipe_draw_start_count_bias *draws,
@ -445,12 +445,14 @@ st_hw_select_draw_gallium(struct gl_context *ctx,
enum mesa_prim old_mode = info->mode;
if (st_draw_hw_select_prepare_common(ctx) &&
st_draw_hw_select_prepare_mode(ctx, info)) {
/* Removing "const" is fine because we restore the changed mode
* at the end. */
st_draw_hw_select_prepare_mode(ctx, ((struct pipe_draw_info*)info))) {
cso_draw_vbo(st->cso_context, info, drawid_offset, indirect, draws,
num_draws);
}
info->mode = old_mode;
((struct pipe_draw_info*)info)->mode = old_mode;
}
static void

View file

@ -48,7 +48,7 @@ struct draw_context *st_get_draw_context(struct st_context *st);
void
st_feedback_draw_vbo(struct gl_context *ctx,
struct pipe_draw_info *info,
const struct pipe_draw_info *info,
unsigned drawid_offset,
const struct pipe_draw_indirect_info *indirect,
const struct pipe_draw_start_count_bias *draws,
@ -79,7 +79,7 @@ st_prepare_draw(struct gl_context *ctx, uint64_t state_mask);
void
st_draw_gallium(struct gl_context *ctx,
struct pipe_draw_info *info,
const struct pipe_draw_info *info,
unsigned drawid_offset,
const struct pipe_draw_indirect_info *indirect,
const struct pipe_draw_start_count_bias *draws,

View file

@ -93,7 +93,7 @@ set_feedback_vertex_format(struct gl_context *ctx)
*/
void
st_feedback_draw_vbo(struct gl_context *ctx,
struct pipe_draw_info *info,
const struct pipe_draw_info *info,
unsigned drawid_offset,
const struct pipe_draw_indirect_info *indirect,
const struct pipe_draw_start_count_bias *draws,