r600g/radeonsi: use the correct types (taken from pipe_draw_info)
authorConstantine Kharlamov <Hi-Angel@yandex.ru>
Sun, 2 Apr 2017 17:33:04 +0000 (20:33 +0300)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 4 Apr 2017 20:15:47 +0000 (22:15 +0200)
Note: si_shader.h has also "type" variable that should be changed to
"enum pipe_prim_type", however it triggers a bunch of warnings about
unhandled switches, so due not knowing the correct way to handle them, I
decided to leave it as is.

Signed-off-by: Constantine Kharlamov <Hi-Angel@yandex.ru>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state_draw.c

index a7b7276732c2cf440e11449a786c5699166f065f..a05d543f0d15aac2490fab6d02514a22f47a3b92 100644 (file)
@@ -29,6 +29,7 @@
 #include "radeon/r600_pipe_common.h"
 #include "radeon/r600_cs.h"
 #include "r600_public.h"
+#include "pipe/p_defines.h"
 
 #include "util/u_suballoc.h"
 #include "util/list.h"
@@ -318,8 +319,7 @@ struct r600_pipe_shader_selector {
 
        unsigned        num_shaders;
 
-       /* PIPE_SHADER_[VERTEX|FRAGMENT|...] */
-       unsigned        type;
+       enum pipe_shader_type   type;
 
        /* geometry shader properties */
        unsigned        gs_output_prim;
@@ -511,8 +511,8 @@ struct r600_context {
        struct pipe_index_buffer        index_buffer;
 
        /* Last draw state (-1 = unset). */
-       int                             last_primitive_type; /* Last primitive type used in draw_vbo. */
-       int                             last_start_instance;
+       enum pipe_prim_type             last_primitive_type; /* Last primitive type used in draw_vbo. */
+       unsigned                        last_start_instance;
 
        void                            *sb_context;
        struct r600_isa         *isa;
index 922589904720b60b9d415180e28ead4490eee8f0..daf29325f76e1514fc71172858e14f3f03ac024c 100644 (file)
@@ -348,7 +348,7 @@ struct si_context {
        int                     last_multi_vgt_param;
        int                     last_rast_prim;
        unsigned                last_sc_line_stipple;
-       int                     current_rast_prim; /* primitive type after TES, GS */
+       enum pipe_prim_type     current_rast_prim; /* primitive type after TES, GS */
        bool                    gs_tri_strip_adj_fix;
 
        /* Scratch buffer */
index 1f219f8ae66480d31b4c0f0d5a4dab7ce0355c74..2c4e3715e4596cf5886be537966c4fb42d1c2744 100644 (file)
@@ -468,7 +468,7 @@ static unsigned si_get_ia_multi_vgt_param(struct si_context *sctx,
 static void si_emit_rasterizer_prim_state(struct si_context *sctx)
 {
        struct radeon_winsys_cs *cs = sctx->b.gfx.cs;
-       unsigned rast_prim = sctx->current_rast_prim;
+       enum pipe_prim_type rast_prim = sctx->current_rast_prim;
        struct si_state_rasterizer *rs = sctx->emitted.named.rasterizer;
 
        /* Skip this if not rendering lines. */
@@ -1091,7 +1091,8 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
        struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
        const struct pipe_index_buffer *ib = &sctx->index_buffer;
        struct pipe_index_buffer ib_tmp; /* for index buffer uploads only */
-       unsigned mask, dirty_tex_counter, rast_prim;
+       unsigned mask, dirty_tex_counter;
+       enum pipe_prim_type rast_prim;
 
        if (likely(!info->indirect)) {
                /* SI-CI treat instance_count==0 as instance_count==1. There is