From f18b2ac0db4fe3cd3a49d04c70869e81040291ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Thu, 16 Nov 2017 12:14:51 +0100 Subject: [PATCH] radeonsi: add si_init_draw_functions and make some functions static MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- src/gallium/drivers/radeonsi/si_pipe.c | 4 +-- src/gallium/drivers/radeonsi/si_state.c | 2 -- src/gallium/drivers/radeonsi/si_state.h | 10 +------ src/gallium/drivers/radeonsi/si_state_draw.c | 28 +++++++++++++------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 8f24194ab5a..7123e7d46d5 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -501,7 +501,6 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, si_init_state_functions(sctx); si_init_shader_functions(sctx); si_init_viewport_functions(sctx); - si_init_ia_multi_vgt_param_table(sctx); if (sctx->chip_class >= CIK) cik_init_sdma_functions(sctx); @@ -522,9 +521,10 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, sctx->blitter = util_blitter_create(&sctx->b); if (sctx->blitter == NULL) goto fail; - sctx->blitter->draw_rectangle = si_draw_rectangle; sctx->blitter->skip_viewport_restore = true; + si_init_draw_functions(sctx); + sctx->sample_mask = 0xffff; if (sctx->chip_class >= GFX9) { diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 41aa4ef3336..d1c0e0371dc 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -4825,8 +4825,6 @@ void si_init_state_functions(struct si_context *sctx) sctx->b.set_active_query_state = si_set_active_query_state; - sctx->b.draw_vbo = si_draw_vbo; - si_init_config(sctx); } diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index 83589e6918c..bb186f530f0 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -541,17 +541,9 @@ void si_get_active_slot_masks(const struct tgsi_shader_info *info, uint64_t *samplers_and_images); /* si_state_draw.c */ -void si_init_ia_multi_vgt_param_table(struct si_context *sctx); void si_emit_cache_flush(struct si_context *sctx); -void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo); -void si_draw_rectangle(struct blitter_context *blitter, - void *vertex_elements_cso, - blitter_get_vs_func get_vs, - int x1, int y1, int x2, int y2, - float depth, unsigned num_instances, - enum blitter_attrib_type type, - const union blitter_attrib *attrib); void si_trace_emit(struct si_context *sctx); +void si_init_draw_functions(struct si_context *sctx); /* si_state_msaa.c */ void si_init_msaa_functions(struct si_context *sctx); diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index 612ca910cb9..254f9edeb75 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -455,7 +455,7 @@ si_get_init_multi_vgt_param(struct si_screen *sscreen, S_030960_EN_INST_OPT_ADV(sscreen->info.chip_class >= GFX9); } -void si_init_ia_multi_vgt_param_table(struct si_context *sctx) +static void si_init_ia_multi_vgt_param_table(struct si_context *sctx) { for (int prim = 0; prim <= SI_PRIM_RECTANGLE_LIST; prim++) for (int uses_instancing = 0; uses_instancing < 2; uses_instancing++) @@ -1248,7 +1248,7 @@ static void si_emit_all_states(struct si_context *sctx, const struct pipe_draw_i si_emit_draw_registers(sctx, info, num_patches); } -void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info) +static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info) { struct si_context *sctx = (struct si_context *)ctx; struct si_state_rasterizer *rs = sctx->queued.named.rasterizer; @@ -1528,13 +1528,14 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info) pipe_resource_reference(&indexbuf, NULL); } -void si_draw_rectangle(struct blitter_context *blitter, - void *vertex_elements_cso, - blitter_get_vs_func get_vs, - int x1, int y1, int x2, int y2, - float depth, unsigned num_instances, - enum blitter_attrib_type type, - const union blitter_attrib *attrib) +static void +si_draw_rectangle(struct blitter_context *blitter, + void *vertex_elements_cso, + blitter_get_vs_func get_vs, + int x1, int y1, int x2, int y2, + float depth, unsigned num_instances, + enum blitter_attrib_type type, + const union blitter_attrib *attrib) { struct pipe_context *pipe = util_blitter_get_pipe(blitter); struct si_context *sctx = (struct si_context*)pipe; @@ -1592,3 +1593,12 @@ void si_trace_emit(struct si_context *sctx) if (sctx->log) u_log_flush(sctx->log); } + +void si_init_draw_functions(struct si_context *sctx) +{ + sctx->b.draw_vbo = si_draw_vbo; + + sctx->blitter->draw_rectangle = si_draw_rectangle; + + si_init_ia_multi_vgt_param_table(sctx); +} -- 2.30.2