diff --git a/src/gallium/drivers/radeonsi/gfx10_query.c b/src/gallium/drivers/radeonsi/gfx10_query.c index 1a430090161..7a39f520e22 100644 --- a/src/gallium/drivers/radeonsi/gfx10_query.c +++ b/src/gallium/drivers/radeonsi/gfx10_query.c @@ -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 diff --git a/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c b/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c index 4005642ae12..0dcb62da8d5 100644 --- a/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c +++ b/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c @@ -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)); } /** diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c b/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c index 128fe396c2d..f46faa365c8 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c @@ -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), ""); diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index bc98d06662a..d5db56784d3 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -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