radeonsi: move set_patch_vertices into si_state_shaders.cpp

it's a better place for it

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
This commit is contained in:
Marek Olšák 2022-08-23 18:53:40 -04:00 committed by Marge Bot
parent 01d351a491
commit b8c861b864
3 changed files with 15 additions and 13 deletions

View file

@ -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;
}

View file

@ -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,

View file

@ -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;
}