[Mesa-dev] [PATCH 04/56] i965: add new field for storing program size
Timothy Arceri
timothy.arceri at collabora.com
Tue Nov 29 03:58:03 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 | 8 ++++++++
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 ++
6 files changed, 19 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_compiler.h b/src/mesa/drivers/dri/i965/brw_compiler.h
index 682ad9b..6e234bf 100644
--- a/src/mesa/drivers/dri/i965/brw_compiler.h
+++ b/src/mesa/drivers/dri/i965/brw_compiler.h
@@ -350,6 +350,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).
@@ -660,6 +662,8 @@ struct brw_tcs_prog_data
/** Number vertices in output patch */
int instances;
+
+ unsigned program_size;
};
@@ -670,6 +674,8 @@ struct brw_tes_prog_data
enum brw_tess_partitioning partitioning;
enum brw_tess_output_topology output_topology;
enum brw_tess_domain domain;
+
+ unsigned program_size;
};
struct brw_gs_prog_data
@@ -732,6 +738,8 @@ struct brw_gs_prog_data
* binding table entry.
*/
unsigned char transform_feedback_swizzles[64 /* BRW_MAX_SOL_BINDINGS */];
+
+ unsigned program_size;
};
#define DEFINE_PROG_DATA_DOWNCAST(stage) \
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index b120a7d..84a3cff 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -180,6 +180,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 823fedb..83b57cb 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs.c
@@ -298,6 +298,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 0cc2a31..94e873b 100644
--- a/src/mesa/drivers/dri/i965/brw_tes.c
+++ b/src/mesa/drivers/dri/i965/brw_tes.c
@@ -212,6 +212,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 82dcdb3..906cb8b 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -275,6 +275,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 6e2b6a1..28e0e58 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -241,6 +241,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.7.4
More information about the mesa-dev
mailing list