draw: s/unsigned/enum pipe_prim_type/
Signed-off-by: Brian Paul <brianp@vmware.com> Acked-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17064>
This commit is contained in:
@@ -359,7 +359,7 @@ void draw_collect_primitives_generated(struct draw_context *draw,
|
||||
*/
|
||||
boolean draw_need_pipeline(const struct draw_context *draw,
|
||||
const struct pipe_rasterizer_state *rasterizer,
|
||||
unsigned prim );
|
||||
enum pipe_prim_type prim );
|
||||
|
||||
int
|
||||
draw_get_shader_param(enum pipe_shader_type shader, enum pipe_shader_cap param);
|
||||
|
||||
@@ -203,7 +203,7 @@ static void do_triangle( struct draw_context *draw,
|
||||
#define FUNC pipe_run_elts
|
||||
#define FUNC_VARS \
|
||||
struct draw_context *draw, \
|
||||
unsigned prim, \
|
||||
enum pipe_prim_type prim, \
|
||||
unsigned prim_flags, \
|
||||
struct vertex_header *vertices, \
|
||||
unsigned stride, \
|
||||
@@ -302,7 +302,7 @@ void draw_pipeline_run( struct draw_context *draw,
|
||||
#define FUNC pipe_run_linear
|
||||
#define FUNC_VARS \
|
||||
struct draw_context *draw, \
|
||||
unsigned prim, \
|
||||
enum pipe_prim_type prim, \
|
||||
unsigned prim_flags, \
|
||||
struct vertex_header *vertices, \
|
||||
unsigned stride, \
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
boolean
|
||||
draw_need_pipeline(const struct draw_context *draw,
|
||||
const struct pipe_rasterizer_state *rasterizer,
|
||||
unsigned int prim )
|
||||
enum pipe_prim_type prim )
|
||||
{
|
||||
unsigned reduced_prim = u_reduced_prim(prim);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#define FUNC_ENTER \
|
||||
/* declare more local vars */ \
|
||||
const unsigned prim = input_prims->prim; \
|
||||
const enum pipe_prim_type prim = input_prims->prim; \
|
||||
const unsigned prim_flags = input_prims->flags; \
|
||||
const boolean last_vertex_last = !asmblr->draw->rasterizer->flatshade_first; \
|
||||
switch (prim) { \
|
||||
|
||||
@@ -186,7 +186,7 @@ struct draw_context
|
||||
struct {
|
||||
/* Current active frontend */
|
||||
struct draw_pt_front_end *frontend;
|
||||
unsigned prim;
|
||||
enum pipe_prim_type prim;
|
||||
unsigned opt; /**< bitmask of PT_x flags */
|
||||
unsigned eltSize; /* saved eltSize for flushing */
|
||||
ubyte vertices_per_patch;
|
||||
@@ -463,7 +463,7 @@ struct draw_prim_info {
|
||||
const ushort *elts;
|
||||
unsigned count;
|
||||
|
||||
unsigned prim;
|
||||
enum pipe_prim_type prim;
|
||||
unsigned flags;
|
||||
unsigned *primitive_lengths;
|
||||
unsigned primitive_count;
|
||||
|
||||
@@ -55,7 +55,7 @@ DEBUG_GET_ONCE_BOOL_OPTION(draw_no_fse, "DRAW_NO_FSE", FALSE)
|
||||
*/
|
||||
static boolean
|
||||
draw_pt_arrays(struct draw_context *draw,
|
||||
unsigned prim,
|
||||
enum pipe_prim_type prim,
|
||||
bool index_bias_varies,
|
||||
const struct pipe_draw_start_count_bias *draw_info,
|
||||
unsigned num_draws)
|
||||
@@ -63,8 +63,7 @@ draw_pt_arrays(struct draw_context *draw,
|
||||
struct draw_pt_front_end *frontend = NULL;
|
||||
struct draw_pt_middle_end *middle = NULL;
|
||||
unsigned opt = PT_SHADE;
|
||||
|
||||
unsigned out_prim = prim;
|
||||
enum pipe_prim_type out_prim = prim;
|
||||
|
||||
if (draw->gs.geometry_shader)
|
||||
out_prim = draw->gs.geometry_shader->output_primitive;
|
||||
@@ -234,7 +233,8 @@ void draw_pt_destroy( struct draw_context *draw )
|
||||
* Debug- print the first 'count' vertices.
|
||||
*/
|
||||
static void
|
||||
draw_print_arrays(struct draw_context *draw, uint prim, int start, uint count, int index_bias)
|
||||
draw_print_arrays(struct draw_context *draw, enum pipe_prim_type prim,
|
||||
int start, uint count, int index_bias)
|
||||
{
|
||||
uint i;
|
||||
|
||||
@@ -404,7 +404,7 @@ draw_pt_arrays_restart(struct draw_context *draw,
|
||||
const struct pipe_draw_start_count_bias *draw_info,
|
||||
unsigned num_draws)
|
||||
{
|
||||
const unsigned prim = info->mode;
|
||||
const enum pipe_prim_type prim = info->mode;
|
||||
|
||||
assert(info->primitive_restart);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ struct draw_vertex_info;
|
||||
*/
|
||||
struct draw_pt_front_end {
|
||||
void (*prepare)( struct draw_pt_front_end *,
|
||||
unsigned prim,
|
||||
enum pipe_prim_type prim,
|
||||
struct draw_pt_middle_end *,
|
||||
unsigned opt );
|
||||
|
||||
@@ -89,7 +89,7 @@ struct draw_pt_front_end {
|
||||
*/
|
||||
struct draw_pt_middle_end {
|
||||
void (*prepare)( struct draw_pt_middle_end *,
|
||||
unsigned prim,
|
||||
enum pipe_prim_type prim,
|
||||
unsigned opt,
|
||||
unsigned *max_vertices );
|
||||
|
||||
@@ -160,7 +160,7 @@ struct draw_pt_middle_end *draw_pt_fetch_pipeline_or_emit_llvm(struct draw_conte
|
||||
struct pt_emit;
|
||||
|
||||
void draw_pt_emit_prepare( struct pt_emit *emit,
|
||||
unsigned prim,
|
||||
enum pipe_prim_type prim,
|
||||
unsigned *max_vertices );
|
||||
|
||||
void draw_pt_emit( struct pt_emit *emit,
|
||||
@@ -241,7 +241,7 @@ void draw_pt_post_vs_destroy( struct pt_post_vs *pvs );
|
||||
/*******************************************************************************
|
||||
* Utils:
|
||||
*/
|
||||
void draw_pt_split_prim(unsigned prim, unsigned *first, unsigned *incr);
|
||||
void draw_pt_split_prim(enum pipe_prim_type prim, unsigned *first, unsigned *incr);
|
||||
unsigned draw_pt_trim_count(unsigned count, unsigned first, unsigned incr);
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ struct pt_emit {
|
||||
|
||||
void
|
||||
draw_pt_emit_prepare(struct pt_emit *emit,
|
||||
unsigned prim,
|
||||
enum pipe_prim_type prim,
|
||||
unsigned *max_vertices)
|
||||
{
|
||||
struct draw_context *draw = emit->draw;
|
||||
|
||||
@@ -67,7 +67,7 @@ struct fetch_shade_emit {
|
||||
|
||||
static void
|
||||
fse_prepare(struct draw_pt_middle_end *middle,
|
||||
unsigned prim,
|
||||
enum pipe_prim_type prim,
|
||||
unsigned opt,
|
||||
unsigned *max_vertices)
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ fetch_pipeline_middle_end(struct draw_pt_middle_end *middle)
|
||||
*/
|
||||
static void
|
||||
fetch_pipeline_prepare(struct draw_pt_middle_end *middle,
|
||||
unsigned prim,
|
||||
enum pipe_prim_type prim,
|
||||
unsigned opt,
|
||||
unsigned *max_vertices)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ struct llvm_middle_end {
|
||||
|
||||
unsigned vertex_data_offset;
|
||||
unsigned vertex_size;
|
||||
unsigned input_prim;
|
||||
enum pipe_prim_type input_prim;
|
||||
unsigned opt;
|
||||
|
||||
struct draw_llvm *llvm;
|
||||
@@ -279,7 +279,7 @@ llvm_middle_end_prepare_tes(struct llvm_middle_end *fpme)
|
||||
*/
|
||||
static void
|
||||
llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
|
||||
unsigned in_prim,
|
||||
enum pipe_prim_type in_prim,
|
||||
unsigned opt,
|
||||
unsigned *max_vertices )
|
||||
{
|
||||
@@ -290,7 +290,8 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
|
||||
struct draw_geometry_shader *gs = draw->gs.geometry_shader;
|
||||
struct draw_tess_ctrl_shader *tcs = draw->tcs.tess_ctrl_shader;
|
||||
struct draw_tess_eval_shader *tes = draw->tes.tess_eval_shader;
|
||||
const unsigned out_prim = gs ? gs->output_primitive : tes ? get_tes_output_prim(tes) :
|
||||
const enum pipe_prim_type out_prim =
|
||||
gs ? gs->output_primitive : tes ? get_tes_output_prim(tes) :
|
||||
u_assembled_prim(in_prim);
|
||||
unsigned point_clip = draw->rasterizer->fill_front == PIPE_POLYGON_MODE_POINT ||
|
||||
out_prim == PIPE_PRIM_POINTS;
|
||||
@@ -779,8 +780,8 @@ out:
|
||||
}
|
||||
|
||||
|
||||
static inline unsigned
|
||||
prim_type(unsigned prim, unsigned flags)
|
||||
static inline enum pipe_prim_type
|
||||
prim_type(enum pipe_prim_type prim, unsigned flags)
|
||||
{
|
||||
if (flags & DRAW_LINE_LOOP_AS_STRIP)
|
||||
return PIPE_PRIM_LINE_STRIP;
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
#include "draw/draw_pt.h"
|
||||
#include "util/u_debug.h"
|
||||
|
||||
void draw_pt_split_prim(unsigned prim, unsigned *first, unsigned *incr)
|
||||
void
|
||||
draw_pt_split_prim(enum pipe_prim_type prim, unsigned *first, unsigned *incr)
|
||||
{
|
||||
switch (prim) {
|
||||
case PIPE_PRIM_POINTS:
|
||||
|
||||
@@ -40,7 +40,7 @@ struct vsplit_frontend {
|
||||
struct draw_pt_front_end base;
|
||||
struct draw_context *draw;
|
||||
|
||||
unsigned prim;
|
||||
enum pipe_prim_type prim;
|
||||
|
||||
struct draw_pt_middle_end *middle;
|
||||
|
||||
@@ -198,7 +198,7 @@ vsplit_add_cache_uint(struct vsplit_frontend *vsplit, const uint *elts,
|
||||
|
||||
|
||||
static void vsplit_prepare(struct draw_pt_front_end *frontend,
|
||||
unsigned in_prim,
|
||||
enum pipe_prim_type in_prim,
|
||||
struct draw_pt_middle_end *middle,
|
||||
unsigned opt)
|
||||
{
|
||||
|
||||
@@ -208,7 +208,7 @@ CONCAT(vsplit_segment_fan_, ELT_TYPE)(struct vsplit_frontend *vsplit,
|
||||
|
||||
#define LOCAL_VARS \
|
||||
struct vsplit_frontend *vsplit = (struct vsplit_frontend *) frontend; \
|
||||
const unsigned prim = vsplit->prim; \
|
||||
const enum pipe_prim_type prim = vsplit->prim; \
|
||||
const unsigned max_count_simple = vsplit->segment_size; \
|
||||
const unsigned max_count_loop = vsplit->segment_size - 1; \
|
||||
const unsigned max_count_fan = vsplit->segment_size;
|
||||
@@ -276,7 +276,7 @@ vsplit_segment_fan_linear(struct vsplit_frontend *vsplit, unsigned flags,
|
||||
|
||||
#define LOCAL_VARS \
|
||||
struct vsplit_frontend *vsplit = (struct vsplit_frontend *) frontend; \
|
||||
const unsigned prim = vsplit->prim; \
|
||||
const enum pipe_prim_type prim = vsplit->prim; \
|
||||
const unsigned max_count_simple = vsplit->max_vertices; \
|
||||
const unsigned max_count_loop = vsplit->segment_size - 1; \
|
||||
const unsigned max_count_fan = vsplit->segment_size;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#define FUNC_ENTER \
|
||||
/* declare more local vars */ \
|
||||
const unsigned prim = input_prims->prim; \
|
||||
const enum pipe_prim_type prim = input_prims->prim; \
|
||||
const unsigned prim_flags = input_prims->flags; \
|
||||
const boolean quads_flatshade_last = FALSE; \
|
||||
const boolean last_vertex_last = !so->draw->rasterizer->flatshade_first; \
|
||||
|
||||
@@ -77,7 +77,7 @@ struct draw_tess_eval_shader {
|
||||
struct pipe_shader_state state;
|
||||
struct tgsi_shader_info info;
|
||||
|
||||
unsigned prim_mode;
|
||||
enum pipe_prim_type prim_mode;
|
||||
unsigned spacing;
|
||||
unsigned vertex_order_cw;
|
||||
unsigned point_mode;
|
||||
|
||||
Reference in New Issue
Block a user