[Mesa-dev] [PATCH 2/9] i965: Drop mark_surface_used from gen8 generators.

Kenneth Graunke kenneth at whitecape.org
Fri Apr 18 10:38:16 PDT 2014


Francisco made brw_mark_surface_used a freestanding function in
commit a32817f3c248125fb537c3a915566445e5600d45.  We should use it.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_fs.h                |  2 --
 src/mesa/drivers/dri/i965/brw_vec4.h              |  2 --
 src/mesa/drivers/dri/i965/gen8_fs_generator.cpp   | 17 ++++-------------
 src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp | 13 ++-----------
 4 files changed, 6 insertions(+), 28 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 2a1a81d..3c87db7 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -754,8 +754,6 @@ private:
 
    void patch_discard_jumps_to_fb_writes();
 
-   void mark_surface_used(unsigned surf_index);
-
    struct brw_wm_compile *c;
    const struct gl_fragment_program *fp;
 
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
index b3549a5..b00266e 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -784,8 +784,6 @@ private:
                                     struct brw_reg index,
                                     struct brw_reg offset);
 
-   void mark_surface_used(unsigned surf_index);
-
    struct brw_vec4_prog_data *prog_data;
 
    const bool debug_flag;
diff --git a/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp b/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
index ca86294..856a23e 100644
--- a/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
@@ -50,15 +50,6 @@ gen8_fs_generator::~gen8_fs_generator()
 }
 
 void
-gen8_fs_generator::mark_surface_used(unsigned surf_index)
-{
-   assert(surf_index < BRW_MAX_SURFACES);
-
-   c->prog_data.base.binding_table.size_bytes =
-      MAX2(c->prog_data.base.binding_table.size_bytes, (surf_index + 1) * 4);
-}
-
-void
 gen8_fs_generator::generate_fb_write(fs_inst *ir)
 {
    /* Disable the discard condition while setting up the header. */
@@ -140,7 +131,7 @@ gen8_fs_generator::generate_fb_write(fs_inst *ir)
                        ir->header_present,
                        ir->eot);
 
-   mark_surface_used(surf_index);
+   brw_mark_surface_used(&c->prog_data.base, surf_index);
 }
 
 void
@@ -301,7 +292,7 @@ gen8_fs_generator::generate_tex(fs_inst *ir,
                             ir->header_present,
                             simd_mode);
 
-   mark_surface_used(surf_index);
+   brw_mark_surface_used(&c->prog_data.base, surf_index);
 }
 
 
@@ -573,7 +564,7 @@ gen8_fs_generator::generate_uniform_pull_constant_load(fs_inst *inst,
                             false, /* no header */
                             BRW_SAMPLER_SIMD_MODE_SIMD4X2);
 
-   mark_surface_used(surf_index);
+   brw_mark_surface_used(&c->prog_data.base, surf_index);
 }
 
 void
@@ -615,7 +606,7 @@ gen8_fs_generator::generate_varying_pull_constant_load(fs_inst *ir,
                             false, /* no header */
                             simd_mode);
 
-   mark_surface_used(surf_index);
+   brw_mark_surface_used(&c->prog_data.base, surf_index);
 }
 
 /**
diff --git a/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp b/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp
index b854db5..dd3035c 100644
--- a/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp
@@ -49,15 +49,6 @@ gen8_vec4_generator::~gen8_vec4_generator()
 }
 
 void
-gen8_vec4_generator::mark_surface_used(unsigned surf_index)
-{
-   assert(surf_index < BRW_MAX_SURFACES);
-
-   prog_data->base.binding_table.size_bytes =
-      MAX2(prog_data->base.binding_table.size_bytes, (surf_index + 1) * 4);
-}
-
-void
 gen8_vec4_generator::generate_tex(vec4_instruction *ir, struct brw_reg dst)
 {
    int msg_type = 0;
@@ -157,7 +148,7 @@ gen8_vec4_generator::generate_tex(vec4_instruction *ir, struct brw_reg dst)
                             ir->header_present,
                             BRW_SAMPLER_SIMD_MODE_SIMD4X2);
 
-   mark_surface_used(surf_index);
+   brw_mark_surface_used(&prog_data->base, surf_index);
 }
 
 void
@@ -461,7 +452,7 @@ gen8_vec4_generator::generate_pull_constant_load(vec4_instruction *inst,
                        false,  /* no header */
                        false); /* EOT */
 
-   mark_surface_used(surf_index);
+   brw_mark_surface_used(&prog_data->base, surf_index);
 }
 
 void
-- 
1.9.1



More information about the mesa-dev mailing list