Mesa (main): intel/blorp: Stop depending on prog_data binding tables

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 10 21:36:56 UTC 2021


Module: Mesa
Branch: main
Commit: e49f65dfe05ef6cc218f780df5bcbb85b4b6a303
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e49f65dfe05ef6cc218f780df5bcbb85b4b6a303

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Fri Dec  3 22:20:36 2021 -0600

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 at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14056>

---

 src/intel/blorp/blorp.c      | 12 ------------
 src/intel/blorp/blorp_blit.c |  5 ++---
 src/intel/blorp/blorp_priv.h |  2 ++
 3 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c
index 37b8251c916..9307c3d163f 100644
--- a/src/intel/blorp/blorp.c
+++ b/src/intel/blorp/blorp.c
@@ -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));
 
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index 6d1d7fc5e51..ff6cad759b8 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -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
diff --git a/src/intel/blorp/blorp_priv.h b/src/intel/blorp/blorp_priv.h
index b4c2bbcdead..a5e8347f6dc 100644
--- a/src/intel/blorp/blorp_priv.h
+++ b/src/intel/blorp/blorp_priv.h
@@ -45,6 +45,8 @@ enum {
    BLORP_NUM_BT_ENTRIES
 };
 
+#define BLORP_SAMPLER_INDEX 0
+
 struct brw_blorp_surface_info
 {
    bool enabled;



More information about the mesa-commit mailing list