intel/blorp: Stop depending on prog_data binding tables

Instead, set BLORP_TEXTURE_BT_INDEX on the texture instructions
directly.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14056>
This commit is contained in:
Jason Ekstrand 2021-12-03 22:20:36 -06:00 committed by Marge Bot
parent 4fa58d27a5
commit e49f65dfe0
3 changed files with 4 additions and 15 deletions

View file

@ -226,12 +226,6 @@ blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx,
wm_prog_data->base.nr_params = 0;
wm_prog_data->base.param = NULL;
/* BLORP always uses the first two binding table entries:
* - Surface 0 is the render target (which always start from 0)
* - Surface 1 is the source texture
*/
wm_prog_data->base.binding_table.texture_start = BLORP_TEXTURE_BT_INDEX;
brw_preprocess_nir(compiler, nir, NULL);
nir_remove_dead_variables(nir, nir_var_shader_in, NULL);
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
@ -303,12 +297,6 @@ blorp_compile_cs(struct blorp_context *blorp, void *mem_ctx,
memset(cs_prog_data, 0, sizeof(*cs_prog_data));
/* BLORP always uses the first two binding table entries:
* - Surface 0 is the destination image (which always start from 0)
* - Surface 1 is the source texture
*/
cs_prog_data->base.binding_table.texture_start = BLORP_TEXTURE_BT_INDEX;
brw_preprocess_nir(compiler, nir, NULL);
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));

View file

@ -144,9 +144,8 @@ blorp_create_nir_tex_instr(nir_builder *b, struct brw_blorp_blit_vars *v,
tex->is_array = false;
tex->is_shadow = false;
/* Blorp only has one texture and it's bound at unit 0 */
tex->texture_index = 0;
tex->sampler_index = 0;
tex->texture_index = BLORP_TEXTURE_BT_INDEX;
tex->sampler_index = BLORP_SAMPLER_INDEX;
/* To properly handle 3-D and 2-D array textures, we pull the Z component
* from an input. TODO: This is a bit magic; we should probably make this

View file

@ -45,6 +45,8 @@ enum {
BLORP_NUM_BT_ENTRIES
};
#define BLORP_SAMPLER_INDEX 0
struct brw_blorp_surface_info
{
bool enabled;