diff options
Diffstat (limited to 'common/recipes-graphics/mesa/mesa/0005-mesa-st-glsl_to_tgsi-Add-class-to-hold-array-informa.patch')
-rw-r--r-- | common/recipes-graphics/mesa/mesa/0005-mesa-st-glsl_to_tgsi-Add-class-to-hold-array-informa.patch | 156 |
1 files changed, 0 insertions, 156 deletions
diff --git a/common/recipes-graphics/mesa/mesa/0005-mesa-st-glsl_to_tgsi-Add-class-to-hold-array-informa.patch b/common/recipes-graphics/mesa/mesa/0005-mesa-st-glsl_to_tgsi-Add-class-to-hold-array-informa.patch deleted file mode 100644 index d139f8a9..00000000 --- a/common/recipes-graphics/mesa/mesa/0005-mesa-st-glsl_to_tgsi-Add-class-to-hold-array-informa.patch +++ /dev/null @@ -1,156 +0,0 @@ -From a454110bd60608df5e562ac5cdc43f994bb8d33f Mon Sep 17 00:00:00 2001 -From: Gert Wollny <gw.fossdev@gmail.com> -Date: Fri, 9 Feb 2018 11:11:09 +0100 -Subject: [PATCH 05/13] mesa/st/glsl_to_tgsi: Add class to hold array - information - -Implememt a class that holds the information required by the array merging -and interleave algorithm, namely array ID, live range, access mask, -accessed components, and the number of accessed components. - -Signed-off-by: Gert Wollny <gw.fossdev@gmail.com> ---- - .../state_tracker/st_glsl_to_tgsi_array_merge.cpp | 69 ++++++++++++++++++++++ - .../state_tracker/st_glsl_to_tgsi_array_merge.h | 46 +++++++++++++++ - 2 files changed, 115 insertions(+) - -diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp -index f432d93..1a455ce 100644 ---- a/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp -+++ b/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp -@@ -37,6 +37,75 @@ using std::unique_ptr; - using std::make_unique; - #endif - -+ -+array_live_range::array_live_range(): -+ id(0), -+ length(0), -+ first_access(0), -+ last_access(0), -+ component_access_mask(0), -+ used_component_count(0) -+{ -+} -+ -+array_live_range::array_live_range(unsigned aid, unsigned alength): -+ id(aid), -+ length(alength), -+ first_access(0), -+ last_access(0), -+ component_access_mask(0), -+ used_component_count(0) -+{ -+} -+ -+array_live_range::array_live_range(unsigned aid, unsigned alength, int begin, -+ int end, int sw): -+ id(aid), -+ length(alength), -+ first_access(begin), -+ last_access(end), -+ component_access_mask(sw), -+ used_component_count(util_bitcount(sw)) -+{ -+} -+ -+void array_live_range::set_live_range(int _begin, int _end) -+{ -+ set_begin(_begin); -+ set_end(_end); -+} -+ -+void array_live_range::set_access_mask(int mask) -+{ -+ component_access_mask = mask; -+ used_component_count = util_bitcount(mask); -+} -+ -+void array_live_range::merge_live_range(const array_live_range &other) -+{ -+ if (other.begin() < first_access) -+ first_access = other.begin(); -+ if (other.end() > last_access) -+ last_access = other.end(); -+} -+ -+void array_live_range::print(std::ostream& os) const -+{ -+ os << "[id:" << id -+ << ", length:" << length -+ << ", (b:" << first_access -+ << ", e:" << last_access -+ << "), sw:" << component_access_mask -+ << ", nc:" << used_component_count -+ << "]"; -+} -+ -+bool array_live_range::time_doesnt_overlap(const array_live_range& other) const -+{ -+ return (other.last_access < first_access || -+ last_access < other.first_access); -+} -+ - namespace tgsi_array_merge { - - array_remapping::array_remapping(): -diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.h b/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.h -index c74c854..b9fb498 100644 ---- a/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.h -+++ b/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.h -@@ -27,6 +27,52 @@ - #include "st_glsl_to_tgsi_private.h" - #include <iosfwd> - -+/* Helper class to evaluate the required live range of an array. -+ * -+ * For arrays not only the live range must be tracked, but also the arrays -+ * length and since we want to interleave arrays, we also track an access mask. -+ * Consequently, one array can be merged into another or interleaved with -+ * another only if the target array is longer. -+ */ -+class array_live_range { -+public: -+ array_live_range(); -+ array_live_range(unsigned aid, unsigned alength); -+ array_live_range(unsigned aid, unsigned alength, int first_access, -+ int last_access, int mask); -+ -+ void set_live_range(int first_access, int last_access); -+ void set_begin(int _begin){first_access = _begin;} -+ void set_end(int _end){last_access = _end;} -+ void set_access_mask(int s); -+ void merge_live_range(const array_live_range& other); -+ -+ unsigned array_id() const {return id;} -+ int array_length() const { return length;} -+ int begin() const { return first_access;} -+ int end() const { return last_access;} -+ int access_mask() const { return component_access_mask;} -+ int used_components() const {return used_component_count;} -+ -+ bool time_doesnt_overlap(const array_live_range& other) const; -+ -+ void print(std::ostream& os) const; -+ -+private: -+ unsigned id; -+ unsigned length; -+ int first_access; -+ int last_access; -+ int component_access_mask; -+ int used_component_count; -+}; -+ -+inline -+std::ostream& operator << (std::ostream& os, const array_live_range& lt) { -+ lt.print(os); -+ return os; -+} -+ - namespace tgsi_array_merge { - - /* Helper class to merge and interleave arrays. --- -2.7.4 - |