[Mesa-dev] [PATCH 05/27] i965: add new field for storing program size

Jordan Justen jordan.l.justen at intel.com
Sat Aug 19 07:44:21 UTC 2017


From: Carl Worth <cworth at cworth.org>

This will be used by the on disk shader cache.

Signed-off-by: Timothy Arceri <timothy.arceri at collabora.com>
[jordan.l.justen at intel.com: Only add to brw_stage_prog_data]
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/intel/compiler/brw_compiler.h   | 2 ++
 src/mesa/drivers/dri/i965/brw_cs.c  | 2 ++
 src/mesa/drivers/dri/i965/brw_gs.c  | 2 ++
 src/mesa/drivers/dri/i965/brw_tcs.c | 2 ++
 src/mesa/drivers/dri/i965/brw_tes.c | 2 ++
 src/mesa/drivers/dri/i965/brw_vs.c  | 3 +++
 src/mesa/drivers/dri/i965/brw_wm.c  | 2 ++
 7 files changed, 15 insertions(+)

diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h
index 66d6a6f5ee..9d29172577 100644
--- a/src/intel/compiler/brw_compiler.h
+++ b/src/intel/compiler/brw_compiler.h
@@ -521,6 +521,8 @@ struct brw_stage_prog_data {
    unsigned total_scratch;
    unsigned total_shared;
 
+   unsigned program_size;
+
    /**
     * Register where the thread expects to find input data from the URB
     * (typically uniforms, followed by vertex or fragment attributes).
diff --git a/src/mesa/drivers/dri/i965/brw_cs.c b/src/mesa/drivers/dri/i965/brw_cs.c
index cc564a012b..f8aee239a8 100644
--- a/src/mesa/drivers/dri/i965/brw_cs.c
+++ b/src/mesa/drivers/dri/i965/brw_cs.c
@@ -168,6 +168,8 @@ brw_codegen_cs_prog(struct brw_context *brw,
                     &brw->cs.base.prog_offset, &brw->cs.base.prog_data);
    ralloc_free(mem_ctx);
 
+   brw->cs.base.prog_data->program_size = program_size;
+
    return true;
 }
 
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index bd8f993d11..a3c058fe9c 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -168,6 +168,8 @@ brw_codegen_gs_prog(struct brw_context *brw,
                     &stage_state->prog_offset, &brw->gs.base.prog_data);
    ralloc_free(mem_ctx);
 
+   brw->gs.base.prog_data->program_size = program_size;
+
    return true;
 }
 
diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c b/src/mesa/drivers/dri/i965/brw_tcs.c
index 1ed622eebb..cf613a261b 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs.c
@@ -287,6 +287,8 @@ brw_codegen_tcs_prog(struct brw_context *brw, struct brw_program *tcp,
                     &stage_state->prog_offset, &brw->tcs.base.prog_data);
    ralloc_free(mem_ctx);
 
+   brw->tcs.base.prog_data->program_size = program_size;
+
    return true;
 }
 
diff --git a/src/mesa/drivers/dri/i965/brw_tes.c b/src/mesa/drivers/dri/i965/brw_tes.c
index 20ce1f4c15..8b16a26408 100644
--- a/src/mesa/drivers/dri/i965/brw_tes.c
+++ b/src/mesa/drivers/dri/i965/brw_tes.c
@@ -158,6 +158,8 @@ brw_codegen_tes_prog(struct brw_context *brw,
                     &stage_state->prog_offset, &brw->tes.base.prog_data);
    ralloc_free(mem_ctx);
 
+   brw->tes.base.prog_data->program_size = program_size;
+
    return true;
 }
 
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index c0a0a13f23..055ea9d742 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -279,6 +279,9 @@ brw_codegen_vs_prog(struct brw_context *brw,
 		    program, program_size,
 		    &prog_data, sizeof(prog_data),
 		    &brw->vs.base.prog_offset, &brw->vs.base.prog_data);
+
+   brw->vs.base.prog_data->program_size = program_size;
+
    ralloc_free(mem_ctx);
 
    return true;
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 2ff1c1e877..40b23fc0e6 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -232,6 +232,8 @@ brw_codegen_wm_prog(struct brw_context *brw,
                     &prog_data, sizeof(prog_data),
                     &brw->wm.base.prog_offset, &brw->wm.base.prog_data);
 
+   brw->wm.base.prog_data->program_size = program_size;
+
    ralloc_free(mem_ctx);
 
    return true;
-- 
2.14.0



More information about the mesa-dev mailing list