aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-graphics/mesa/mesa/0011-mesa-st-glsl_to_tgsi-add-array-life-range-evaluation.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-graphics/mesa/mesa/0011-mesa-st-glsl_to_tgsi-add-array-life-range-evaluation.patch')
-rw-r--r--common/recipes-graphics/mesa/mesa/0011-mesa-st-glsl_to_tgsi-add-array-life-range-evaluation.patch167
1 files changed, 0 insertions, 167 deletions
diff --git a/common/recipes-graphics/mesa/mesa/0011-mesa-st-glsl_to_tgsi-add-array-life-range-evaluation.patch b/common/recipes-graphics/mesa/mesa/0011-mesa-st-glsl_to_tgsi-add-array-life-range-evaluation.patch
deleted file mode 100644
index 1dee8300..00000000
--- a/common/recipes-graphics/mesa/mesa/0011-mesa-st-glsl_to_tgsi-add-array-life-range-evaluation.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 9a388d59aab6da2acee755cd304029c1e46a756e Mon Sep 17 00:00:00 2001
-From: Gert Wollny <gw.fossdev@gmail.com>
-Date: Fri, 9 Feb 2018 11:11:15 +0100
-Subject: [PATCH 11/13] mesa/st/glsl_to_tgsi: add array life range evaluation
- into tracking code
-
-This adds the array live range tracking harvesting the already implemented
-live range tracking for temporary registers. With this patch the array live
-range tracking is not yet exposed, and since some tests that track reladdr
-access arrays, some array live range tracker instances need to be available,
-so some are added as a placeholder in get_temp_registers_required_live_ranges.
-
-Signed-off-by: Gert Wollny <gw.fossdev@gmail.com>
----
- .../state_tracker/st_glsl_to_tgsi_temprename.cpp | 61 +++++++++++++++++-----
- 1 file changed, 49 insertions(+), 12 deletions(-)
-
-diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp
-index bdd52ac..e276471 100644
---- a/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp
-+++ b/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp
-@@ -995,28 +995,34 @@ public:
-
- class access_recorder {
- public:
-- access_recorder(int _ntemps);
-+ access_recorder(int _ntemps, int _narrays);
- ~access_recorder();
-
- void record_read(const st_src_reg& src, int line, prog_scope *scope);
-- void record_write(const st_dst_reg& src, int line, prog_scope *scope);
-+ void record_write(const st_dst_reg& src, int line, prog_scope *scope,
-+ bool no_reswizzle);
-
-- void get_required_live_ranges(register_live_range *register_live_ranges);
-+ void get_required_live_ranges(register_live_range *register_live_ranges,
-+ array_live_range *array_live_ranges);
- private:
-
- int ntemps;
-+ int narrays;
- temp_access *temp_acc;
--
-+ array_access *array_acc;
- };
-
--access_recorder::access_recorder(int _ntemps):
-- ntemps(_ntemps)
-+access_recorder::access_recorder(int _ntemps, int _narrays):
-+ ntemps(_ntemps),
-+ narrays(_narrays)
- {
- temp_acc = new temp_access[ntemps];
-+ array_acc = new array_access[narrays];
- }
-
- access_recorder::~access_recorder()
- {
-+ delete[] array_acc;
- delete[] temp_acc;
- }
-
-@@ -1032,6 +1038,11 @@ void access_recorder::record_read(const st_src_reg& src, int line,
- if (src.file == PROGRAM_TEMPORARY)
- temp_acc[src.index].record_read(line, scope, readmask);
-
-+ if (src.file == PROGRAM_ARRAY) {
-+ assert(src.array_id <= narrays);
-+ array_acc[src.array_id - 1].record_access(line, scope, readmask);
-+ }
-+
- if (src.reladdr)
- record_read(*src.reladdr, line, scope);
- if (src.reladdr2)
-@@ -1039,18 +1050,30 @@ void access_recorder::record_read(const st_src_reg& src, int line,
- }
-
- void access_recorder::record_write(const st_dst_reg& dst, int line,
-- prog_scope *scope)
-+ prog_scope *scope, bool can_reswizzle)
- {
- if (dst.file == PROGRAM_TEMPORARY)
- temp_acc[dst.index].record_write(line, scope, dst.writemask);
-
-+ if (dst.file == PROGRAM_ARRAY) {
-+ assert(dst.array_id <= narrays);
-+
-+ /* If the array is written as dst of a multi-dst operation, we must not
-+ * reswizzle the access, because we would have to reswizzle also the
-+ * other dst. For now just fill the mask to make interleaving impossible.
-+ */
-+ array_acc[dst.array_id - 1].record_access(line, scope,
-+ can_reswizzle ? dst.writemask: 0xF);
-+ }
-+
- if (dst.reladdr)
- record_read(*dst.reladdr, line, scope);
- if (dst.reladdr2)
- record_read(*dst.reladdr2, line, scope);
- }
-
--void access_recorder::get_required_live_ranges(struct register_live_range *register_live_ranges)
-+void access_recorder::get_required_live_ranges(struct register_live_range *register_live_ranges,
-+ struct array_live_range *array_live_ranges)
- {
- RENAME_DEBUG(debug_log << "== register live ranges ==========\n");
- for(int i = 0; i < ntemps; ++i) {
-@@ -1060,6 +1083,15 @@ void access_recorder::get_required_live_ranges(struct register_live_range *regis
- <<register_live_ranges[i].end << "]\n");
- }
- RENAME_DEBUG(debug_log << "==================================\n\n");
-+
-+ RENAME_DEBUG(debug_log << "== array live ranges ==========\n");
-+ for(int i = 0; i < narrays; ++i) {
-+ RENAME_DEBUG(debug_log<< setw(4) << i);
-+ array_acc[i].get_required_live_range(array_live_ranges[i]);
-+ RENAME_DEBUG(debug_log << ": [" <<array_live_ranges[i].begin() << ", "
-+ << array_live_ranges[i].end() << "]\n");
-+ }
-+ RENAME_DEBUG(debug_log << "==================================\n\n");
- }
-
- }
-@@ -1084,6 +1116,10 @@ get_temp_registers_required_live_ranges(void *mem_ctx, exec_list *instructions,
- bool is_at_end = false;
- int n_scopes = 1;
-
-+ /* Placeholder to make the reladdr tests pass, will be removed with the next patch. */
-+ int narrays = 2;
-+ struct array_live_range array_live_ranges[3];
-+
- /* Count scopes to allocate the needed space without the need for
- * re-allocation
- */
-@@ -1100,7 +1136,7 @@ get_temp_registers_required_live_ranges(void *mem_ctx, exec_list *instructions,
-
- prog_scope_storage scopes(mem_ctx, n_scopes);
-
-- access_recorder access(ntemps);
-+ access_recorder access(ntemps, narrays);
-
- prog_scope *cur_scope = scopes.create(nullptr, outer_scope, 0, 0, line);
-
-@@ -1226,8 +1262,9 @@ get_temp_registers_required_live_ranges(void *mem_ctx, exec_list *instructions,
- for (unsigned j = 0; j < inst->tex_offset_num_offset; j++) {
- access.record_read(inst->tex_offsets[j], line, cur_scope);
- }
-- for (unsigned j = 0; j < num_inst_dst_regs(inst); j++) {
-- access.record_write(inst->dst[j], line, cur_scope);
-+ unsigned ndst = num_inst_dst_regs(inst);
-+ for (unsigned j = 0; j < ndst; j++) {
-+ access.record_write(inst->dst[j], line, cur_scope, ndst == 1);
- }
- }
- }
-@@ -1242,7 +1279,7 @@ get_temp_registers_required_live_ranges(void *mem_ctx, exec_list *instructions,
- if (cur_scope->end() < 0)
- cur_scope->set_end(line - 1);
-
-- access.get_required_live_ranges(register_live_ranges);
-+ access.get_required_live_ranges(register_live_ranges, array_live_ranges);
- return true;
- }
-
---
-2.7.4
-