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

Timothy Arceri timothy.arceri at collabora.com
Mon Oct 3 06:04:24 UTC 2016


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>
---
 src/mesa/drivers/dri/i965/brw_compiler.h | 4 ++++
 src/mesa/drivers/dri/i965/brw_vs.c       | 2 ++
 src/mesa/drivers/dri/i965/brw_wm.c       | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_compiler.h b/src/mesa/drivers/dri/i965/brw_compiler.h
index 445c166..9a78c72 100644
--- a/src/mesa/drivers/dri/i965/brw_compiler.h
+++ b/src/mesa/drivers/dri/i965/brw_compiler.h
@@ -428,6 +428,8 @@ struct brw_wm_prog_data {
     * For varying slots that are not used by the FS, the value is -1.
     */
    int urb_setup[VARYING_SLOT_MAX];
+
+   unsigned program_size;
 };
 
 struct brw_push_const_block {
@@ -644,6 +646,8 @@ struct brw_vs_prog_data {
    bool uses_basevertex;
    bool uses_baseinstance;
    bool uses_drawid;
+
+   unsigned program_size;
 };
 
 struct brw_tcs_prog_data
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index a2f82d3..64818ae 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -231,6 +231,8 @@ brw_codegen_vs_prog(struct brw_context *brw,
 		    &prog_data, sizeof(prog_data),
 		    &brw->vs.base.prog_offset, &brw->vs.prog_data, vp);
 
+   brw->vs.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 488106e..f8bdf29 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -184,6 +184,8 @@ brw_codegen_wm_prog(struct brw_context *brw,
 		    &prog_data, sizeof(prog_data),
 		    &brw->wm.base.prog_offset, &brw->wm.prog_data, fp);
 
+   brw->wm.prog_data->program_size = program_size;
+
    ralloc_free(mem_ctx);
 
    return true;
-- 
2.7.4



More information about the mesa-dev mailing list