From: Marek Olšák Date: Tue, 23 Aug 2022 22:53:40 +0000 (-0400) Subject: radeonsi: move set_patch_vertices into si_state_shaders.cpp X-Git-Tag: upstream/22.3.5~4049 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b8c861b86438f6d38d8dda792de9ac5f7e4bb13b;p=platform%2Fupstream%2Fmesa.git radeonsi: move set_patch_vertices into si_state_shaders.cpp it's a better place for it Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 42184c1..fbee2b6 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -5310,16 +5310,6 @@ static void si_set_tess_state(struct pipe_context *ctx, const float default_oute si_set_internal_const_buffer(sctx, SI_HS_CONST_DEFAULT_TESS_LEVELS, &cb); } -static void si_set_patch_vertices(struct pipe_context *ctx, uint8_t patch_vertices) -{ - struct si_context *sctx = (struct si_context *)ctx; - - if (sctx->patch_vertices != patch_vertices) { - sctx->patch_vertices = patch_vertices; - si_update_tess_in_out_patch_vertices(sctx); - } -} - static void si_texture_barrier(struct pipe_context *ctx, unsigned flags) { struct si_context *sctx = (struct si_context *)ctx; @@ -5456,7 +5446,6 @@ void si_init_state_functions(struct si_context *sctx) sctx->b.texture_barrier = si_texture_barrier; sctx->b.set_min_samples = si_set_min_samples; sctx->b.set_tess_state = si_set_tess_state; - sctx->b.set_patch_vertices = si_set_patch_vertices; sctx->b.set_active_query_state = si_set_active_query_state; } diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index f9d1a81..fa60be4 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -598,7 +598,6 @@ bool si_update_gs_ring_buffers(struct si_context *sctx); bool si_update_spi_tmpring_size(struct si_context *sctx, unsigned bytes); unsigned si_get_shader_prefetch_size(struct si_shader *shader); bool si_set_tcs_to_fixed_func_shader(struct si_context *sctx); -void si_update_tess_in_out_patch_vertices(struct si_context *sctx); /* si_state_draw.cpp */ void si_cp_dma_prefetch(struct si_context *sctx, struct pipe_resource *buf, diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.cpp b/src/gallium/drivers/radeonsi/si_state_shaders.cpp index 7a72edb..f14a1d6 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.cpp +++ b/src/gallium/drivers/radeonsi/si_state_shaders.cpp @@ -37,6 +37,8 @@ #include "util/u_prim.h" #include "tgsi/tgsi_from_mesa.h" +static void si_update_tess_in_out_patch_vertices(struct si_context *sctx); + unsigned si_determine_wave_size(struct si_screen *sscreen, struct si_shader *shader) { /* There are a few uses that pass shader=NULL here, expecting the default compute wave size. */ @@ -4285,7 +4287,7 @@ bool si_set_tcs_to_fixed_func_shader(struct si_context *sctx) return true; } -void si_update_tess_in_out_patch_vertices(struct si_context *sctx) +static void si_update_tess_in_out_patch_vertices(struct si_context *sctx) { if (sctx->is_user_tcs) { struct si_shader_selector *tcs = sctx->shader.tcs.cso; @@ -4328,6 +4330,16 @@ void si_update_tess_in_out_patch_vertices(struct si_context *sctx) } } +static void si_set_patch_vertices(struct pipe_context *ctx, uint8_t patch_vertices) +{ + struct si_context *sctx = (struct si_context *)ctx; + + if (sctx->patch_vertices != patch_vertices) { + sctx->patch_vertices = patch_vertices; + si_update_tess_in_out_patch_vertices(sctx); + } +} + void si_init_screen_live_shader_cache(struct si_screen *sscreen) { util_live_shader_cache_init(&sscreen->live_shader_cache, si_create_shader_selector, @@ -4355,4 +4367,6 @@ void si_init_shader_functions(struct si_context *sctx) sctx->b.delete_tes_state = si_delete_shader_selector; sctx->b.delete_gs_state = si_delete_shader_selector; sctx->b.delete_fs_state = si_delete_shader_selector; + + sctx->b.set_patch_vertices = si_set_patch_vertices; }