unsigned ce_offset = 0;
STATIC_ASSERT(GFX9_SGPR_TCS_CONST_BUFFERS % 2 == 0);
+ STATIC_ASSERT(GFX9_SGPR_GS_CONST_BUFFERS % 2 == 0);
for (i = 0; i < SI_NUM_SHADERS; i++) {
bool gfx9_tcs = sctx->b.chip_class == GFX9 &&
i == PIPE_SHADER_TESS_CTRL;
+ bool gfx9_gs = sctx->b.chip_class == GFX9 &&
+ i == PIPE_SHADER_GEOMETRY;
/* GFX9 has only 4KB of CE, while previous chips had 32KB.
* Rarely used descriptors don't use CE RAM.
*/
si_const_buffer_descriptors(sctx, i),
SI_NUM_CONST_BUFFERS,
gfx9_tcs ? GFX9_SGPR_TCS_CONST_BUFFERS :
- SI_SGPR_CONST_BUFFERS,
+ gfx9_gs ? GFX9_SGPR_GS_CONST_BUFFERS :
+ SI_SGPR_CONST_BUFFERS,
RADEON_USAGE_READ, RADEON_PRIO_CONST_BUFFER,
&ce_offset);
si_init_buffer_resources(&sctx->shader_buffers[i],
si_shader_buffer_descriptors(sctx, i),
SI_NUM_SHADER_BUFFERS,
gfx9_tcs ? GFX9_SGPR_TCS_SHADER_BUFFERS :
- SI_SGPR_SHADER_BUFFERS,
+ gfx9_gs ? GFX9_SGPR_GS_SHADER_BUFFERS :
+ SI_SGPR_SHADER_BUFFERS,
RADEON_USAGE_READWRITE, RADEON_PRIO_SHADER_RW_BUFFER,
shaderbufs_use_ce ? &ce_offset : NULL);
si_init_descriptors(si_sampler_descriptors(sctx, i),
gfx9_tcs ? GFX9_SGPR_TCS_SAMPLERS :
- SI_SGPR_SAMPLERS,
+ gfx9_gs ? GFX9_SGPR_GS_SAMPLERS :
+ SI_SGPR_SAMPLERS,
16, SI_NUM_SAMPLERS,
null_texture_descriptor,
samplers_use_ce ? &ce_offset : NULL);
si_init_descriptors(si_image_descriptors(sctx, i),
gfx9_tcs ? GFX9_SGPR_TCS_IMAGES :
- SI_SGPR_IMAGES,
+ gfx9_gs ? GFX9_SGPR_GS_IMAGES :
+ SI_SGPR_IMAGES,
8, SI_NUM_IMAGES,
null_image_descriptor,
images_use_ce ? &ce_offset : NULL);
static void si_build_gs_prolog_function(struct si_shader_context *ctx,
union si_shader_part_key *key)
{
- const unsigned num_sgprs = SI_GS_NUM_USER_SGPR + 2;
+ const unsigned num_sgprs = GFX6_GS_NUM_USER_SGPR + 2;
const unsigned num_vgprs = 8;
struct gallivm_state *gallivm = &ctx->gallivm;
LLVMBuilderRef builder = gallivm->builder;
GFX9_SGPR_TCS_SHADER_BUFFERS_HI,
GFX9_TCS_NUM_USER_SGPR,
+ /* GFX9: Merged ES-GS (VS-GS or TES-GS). */
+ GFX9_SGPR_GS_CONST_BUFFERS = SI_VS_NUM_USER_SGPR,
+ GFX9_SGPR_GS_CONST_BUFFERS_HI,
+ GFX9_SGPR_GS_SAMPLERS,
+ GFX9_SGPR_GS_SAMPLERS_HI,
+ GFX9_SGPR_GS_IMAGES,
+ GFX9_SGPR_GS_IMAGES_HI,
+ GFX9_SGPR_GS_SHADER_BUFFERS,
+ GFX9_SGPR_GS_SHADER_BUFFERS_HI,
+ GFX9_GS_NUM_USER_SGPR,
+
/* GS limits */
- SI_GS_NUM_USER_SGPR = SI_NUM_RESOURCE_SGPRS,
+ GFX6_GS_NUM_USER_SGPR = SI_NUM_RESOURCE_SGPRS,
SI_GSCOPY_NUM_USER_SGPR = SI_SGPR_RW_BUFFERS_HI + 1,
/* PS only */