iris: Handle binding table in the driver

Stop using brw_compiler to lower the final binding table indices for
surface access.  This is done by simply not setting the
'prog_data->binding_table.*_start' fields.  Then make the driver
perform this lowering.

This is a better place to perfom the binding table assignments, since
the driver has more information and will also later consume those
assignments to upload resources.

This also prepares us for two changes: use ibc without having to
implement binding table logic there; and remove unused entries from
the binding table.

Since the `block` field in brw_ubo_range now refers to the final
binding table index, we need to adjust it before using to index
shs->constbuf.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Caio Marcelo de Oliveira Filho
2019-05-22 22:17:27 -07:00
parent 518f83236b
commit 1c8ea8b300
6 changed files with 232 additions and 121 deletions

View File

@@ -281,6 +281,15 @@ struct iris_uncompiled_shader {
struct iris_state_ref const_data_state;
};
struct iris_binding_table {
uint32_t size_bytes;
uint32_t texture_start;
uint32_t ubo_start;
uint32_t ssbo_start;
uint32_t image_start;
};
/**
* A compiled shader variant, containing a pointer to the GPU assembly,
* as well as program data and other packets needed by state upload.
@@ -311,6 +320,8 @@ struct iris_compiled_shader {
*/
uint32_t *streamout;
struct iris_binding_table bt;
/**
* Shader packets and other data derived from prog_data. These must be
* completely determined from prog_data.
@@ -827,7 +838,8 @@ struct iris_compiled_shader *iris_upload_shader(struct iris_context *ice,
uint32_t *streamout,
enum brw_param_builtin *sysv,
unsigned num_system_values,
unsigned num_cbufs);
unsigned num_cbufs,
const struct iris_binding_table *bt);
const void *iris_find_previous_compile(const struct iris_context *ice,
enum iris_program_cache_id cache_id,
unsigned program_string_id);