radeonsi: reorder slots for internal buffers, reuse a slot for GS_QUERY_BUF

GFX10_GS_QUERY_BUF is also renamed.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14266>
This commit is contained in:
Marek Olšák 2021-12-18 08:41:37 -05:00 committed by Marge Bot
parent 0246580106
commit 18fadc8e6a
4 changed files with 18 additions and 15 deletions

View file

@ -128,7 +128,7 @@ success:;
sbuf.buffer = &qbuf->buf->b.b;
sbuf.buffer_offset = qbuf->head;
sbuf.buffer_size = sizeof(struct gfx10_sh_query_buffer_mem);
si_set_internal_shader_buffer(sctx, GFX10_GS_QUERY_BUF, &sbuf);
si_set_internal_shader_buffer(sctx, SI_GS_QUERY_BUF, &sbuf);
sctx->current_vs_state |= S_VS_STATE_STREAMOUT_QUERY_ENABLED(1);
si_mark_atom_dirty(sctx, &sctx->atoms.s.shader_query);
@ -184,7 +184,7 @@ static bool gfx10_sh_query_end(struct si_context *sctx, struct si_query *rquery)
sctx->num_active_shader_queries--;
if (sctx->num_active_shader_queries <= 0 || !si_is_atom_dirty(sctx, &sctx->atoms.s.shader_query)) {
si_set_internal_shader_buffer(sctx, GFX10_GS_QUERY_BUF, NULL);
si_set_internal_shader_buffer(sctx, SI_GS_QUERY_BUF, NULL);
sctx->current_vs_state &= C_VS_STATE_STREAMOUT_QUERY_ENABLED;
/* If a query_begin is followed by a query_end without a draw

View file

@ -67,7 +67,7 @@ static LLVMValueRef ngg_get_query_buf(struct si_shader_context *ctx)
LLVMValueRef buf_ptr = ac_get_arg(&ctx->ac, ctx->internal_bindings);
return ac_build_load_to_sgpr(&ctx->ac, buf_ptr,
LLVMConstInt(ctx->ac.i32, GFX10_GS_QUERY_BUF, false));
LLVMConstInt(ctx->ac.i32, SI_GS_QUERY_BUF, false));
}
/**

View file

@ -69,6 +69,8 @@ static LLVMValueRef si_nir_emit_fbfetch(struct ac_shader_abi *abi)
/* Load the image descriptor. */
STATIC_ASSERT(SI_PS_IMAGE_COLORBUF0 % 2 == 0);
STATIC_ASSERT(SI_PS_IMAGE_COLORBUF0_FMASK % 2 == 0);
ptr = ac_get_arg(&ctx->ac, ctx->internal_bindings);
ptr =
LLVMBuildPointerCast(ctx->ac.builder, ptr, ac_array_in_const32_addr_space(ctx->ac.v8i32), "");

View file

@ -354,31 +354,32 @@ struct si_tracked_regs {
/* Private read-write buffer slots. */
enum
{
SI_ES_RING_ESGS,
SI_GS_RING_ESGS,
SI_RING_GSVS,
SI_VS_STREAMOUT_BUF0,
SI_VS_STREAMOUT_BUF1,
SI_VS_STREAMOUT_BUF2,
SI_VS_STREAMOUT_BUF3,
SI_HS_CONST_DEFAULT_TESS_LEVELS,
SI_VS_CONST_INSTANCE_DIVISORS,
SI_VS_CONST_CLIP_PLANES,
SI_PS_CONST_POLY_STIPPLE,
SI_PS_CONST_SAMPLE_POSITIONS,
/* Image descriptor of color buffer 0 for KHR_blend_equation_advanced. */
SI_PS_IMAGE_COLORBUF0,
SI_PS_IMAGE_COLORBUF0_HI,
SI_PS_IMAGE_COLORBUF0_FMASK,
SI_PS_IMAGE_COLORBUF0_FMASK_HI,
GFX10_GS_QUERY_BUF,
/* Internal constant buffers. */
SI_HS_CONST_DEFAULT_TESS_LEVELS,
SI_VS_CONST_INSTANCE_DIVISORS,
SI_VS_CONST_CLIP_PLANES,
SI_PS_CONST_POLY_STIPPLE,
SI_PS_CONST_SAMPLE_POSITIONS,
SI_ES_RING_ESGS, /* gfx6-8 */
SI_GS_RING_ESGS, /* gfx6-8 */
SI_RING_GSVS,
SI_NUM_INTERNAL_BINDINGS,
/* Aliases to reuse slots that are unused on other generations. */
SI_GS_QUERY_BUF = SI_ES_RING_ESGS, /* gfx10+ */
};
/* Indices into sctx->descriptors, laid out so that gfx and compute pipelines