iris: fix SSBO indexing

st/nir offsets SSBO indexes by MaxABOs.  This is not what we want,
as it bloats the binding tables.  We'll need to adjust it to use
info->num_abos as the offset and buffer base instead.  For now,
just use the inefficient format to get us rolling.  We can add a
PIPE_CAP later.
This commit is contained in:
Kenneth Graunke 2018-07-24 17:44:09 -07:00
parent 376c7253f8
commit b7b061c4e2
3 changed files with 14 additions and 3 deletions

View file

@ -43,6 +43,9 @@ struct blorp_params;
#define IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE (PIPE_RESOURCE_FLAG_DRV_PRIV << 2)
#define IRIS_MAX_TEXTURE_SAMPLERS 32
/* IRIS_MAX_ABOS and IRIS_MAX_SSBOS must be the same. */
#define IRIS_MAX_ABOS 16
#define IRIS_MAX_SSBOS 16
#define IRIS_MAX_VIEWPORTS 16
#define IRIS_DIRTY_COLOR_CALC_STATE (1ull << 0)

View file

@ -384,8 +384,9 @@ iris_get_shader_param(struct pipe_screen *pscreen,
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
return IRIS_MAX_TEXTURE_SAMPLERS;
case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
return IRIS_MAX_ABOS + IRIS_MAX_SSBOS;
case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
return 0;

View file

@ -2680,8 +2680,15 @@ iris_populate_binding_table(struct iris_context *ice,
bt_map[s++] = use_const_buffer(batch, cbuf);
}
for (int i = 0; i < info->num_abos + info->num_ssbos; i++) {
bt_map[s++] = use_ssbo(batch, ice, shs, i);
/* XXX: st is wasting 16 binding table slots for ABOs. Should add a cap
* for changing nir_lower_atomics_to_ssbos setting and buffer_base offset
* in st_atom_storagebuf.c so it'll compact them into one range, with
* SSBOs starting at info->num_abos. Ideally it'd reset num_abos to 0 too
*/
if (info->num_abos + info->num_ssbos > 0) {
for (int i = 0; i < IRIS_MAX_ABOS + info->num_ssbos; i++) {
bt_map[s++] = use_ssbo(batch, ice, shs, i);
}
}
#if 0