diff options
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 20 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.h | 15 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_shaders.c | 8 |
3 files changed, 25 insertions, 18 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index bc91e6f5148..7debbc1f3d4 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -4411,21 +4411,13 @@ static void si_delete_sampler_state(struct pipe_context *ctx, void *state) * Vertex elements & buffers */ -struct util_fast_udiv_info32 { - unsigned multiplier; /* the "magic number" multiplier */ - unsigned pre_shift; /* shift for the dividend before multiplying */ - unsigned post_shift; /* shift for the dividend after multiplying */ - int increment; /* 0 or 1; if set then increment the numerator, using one of - the two strategies */ -}; - -static struct util_fast_udiv_info32 -util_compute_fast_udiv_info32(uint32_t D, unsigned num_bits) +struct si_fast_udiv_info32 +si_compute_fast_udiv_info32(uint32_t D, unsigned num_bits) { struct util_fast_udiv_info info = util_compute_fast_udiv_info(D, num_bits, 32); - struct util_fast_udiv_info32 result = { + struct si_fast_udiv_info32 result = { info.multiplier, info.pre_shift, info.post_shift, @@ -4441,8 +4433,8 @@ static void *si_create_vertex_elements(struct pipe_context *ctx, struct si_screen *sscreen = (struct si_screen*)ctx->screen; struct si_vertex_elements *v = CALLOC_STRUCT(si_vertex_elements); bool used[SI_NUM_VERTEX_BUFFERS] = {}; - struct util_fast_udiv_info32 divisor_factors[SI_MAX_ATTRIBS] = {}; - STATIC_ASSERT(sizeof(struct util_fast_udiv_info32) == 16); + struct si_fast_udiv_info32 divisor_factors[SI_MAX_ATTRIBS] = {}; + STATIC_ASSERT(sizeof(struct si_fast_udiv_info32) == 16); STATIC_ASSERT(sizeof(divisor_factors[0].multiplier) == 4); STATIC_ASSERT(sizeof(divisor_factors[0].pre_shift) == 4); STATIC_ASSERT(sizeof(divisor_factors[0].post_shift) == 4); @@ -4476,7 +4468,7 @@ static void *si_create_vertex_elements(struct pipe_context *ctx, } else { v->instance_divisor_is_fetched |= 1u << i; divisor_factors[i] = - util_compute_fast_udiv_info32(instance_divisor, 32); + si_compute_fast_udiv_info32(instance_divisor, 32); } } diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index 15c4ef6d9a1..613aa32a312 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -556,6 +556,17 @@ void si_save_qbo_state(struct si_context *sctx, struct si_qbo_state *st); void si_set_occlusion_query_state(struct si_context *sctx, bool old_perfect_enable); +struct si_fast_udiv_info32 { + unsigned multiplier; /* the "magic number" multiplier */ + unsigned pre_shift; /* shift for the dividend before multiplying */ + unsigned post_shift; /* shift for the dividend after multiplying */ + int increment; /* 0 or 1; if set then increment the numerator, using one of + the two strategies */ +}; + +struct si_fast_udiv_info32 +si_compute_fast_udiv_info32(uint32_t D, unsigned num_bits); + /* si_state_binning.c */ void si_emit_dpbb_state(struct si_context *sctx); @@ -583,6 +594,10 @@ int si_shader_select_with_key(struct si_screen *sscreen, struct si_shader_key *key, int thread_index, bool optimized_or_none); +void si_shader_selector_key_vs(struct si_context *sctx, + struct si_shader_selector *vs, + struct si_shader_key *key, + struct si_vs_prolog_bits *prolog_key); /* si_state_draw.c */ void si_emit_cache_flush(struct si_context *sctx); diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 8ae77fda3f3..28360aae965 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -1370,10 +1370,10 @@ static unsigned si_get_alpha_test_func(struct si_context *sctx) return PIPE_FUNC_ALWAYS; } -static void si_shader_selector_key_vs(struct si_context *sctx, - struct si_shader_selector *vs, - struct si_shader_key *key, - struct si_vs_prolog_bits *prolog_key) +void si_shader_selector_key_vs(struct si_context *sctx, + struct si_shader_selector *vs, + struct si_shader_key *key, + struct si_vs_prolog_bits *prolog_key) { if (!sctx->vertex_elements || vs->info.properties[TGSI_PROPERTY_VS_BLIT_SGPRS]) |