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

Timothy Arceri timothy.arceri at collabora.com
Fri Apr 29 13:33:06 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 5807305..d5f7f55 100644
--- a/src/mesa/drivers/dri/i965/brw_compiler.h
+++ b/src/mesa/drivers/dri/i965/brw_compiler.h
@@ -413,6 +413,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];
+
+   GLuint program_size;
 };
 
 struct brw_cs_prog_data {
@@ -613,6 +615,8 @@ struct brw_vs_prog_data {
    bool uses_basevertex;
    bool uses_baseinstance;
    bool uses_drawid;
+
+   GLuint 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 fc33b75..d16d825 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -218,6 +218,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 8ac0a05..daebb48 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -175,6 +175,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.5.5



More information about the mesa-dev mailing list