Mesa (master): r600/sfn: Add methods to valuepool to get a vector of values
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Apr 28 08:17:40 UTC 2020
Module: Mesa
Branch: master
Commit: 93f5f9e584b3d39fc120d91b1e6276bc18e917d3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=93f5f9e584b3d39fc120d91b1e6276bc18e917d3
Author: Gert Wollny <gert.wollny at collabora.com>
Date: Sun Apr 12 17:05:48 2020 +0200
r600/sfn: Add methods to valuepool to get a vector of values
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
---
src/gallium/drivers/r600/sfn/sfn_valuepool.cpp | 19 +++++++++++++++++++
src/gallium/drivers/r600/sfn/sfn_valuepool.h | 3 +++
2 files changed, 22 insertions(+)
diff --git a/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp b/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp
index 79c83d82859..8ce378b43b3 100644
--- a/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp
@@ -53,9 +53,28 @@ GPRVector ValuePool::vec_from_nir(const nir_dest& dst, int num_components)
for (int i = 0; i < 4; ++i)
result[i] = from_nir(dst, i < num_components ? i : 7);
return GPRVector(result);
+}
+
+std::vector<PValue> ValuePool::varvec_from_nir(const nir_dest& dst, int num_components)
+{
+ std::vector<PValue> result(num_components);
+ for (int i = 0; i < num_components; ++i)
+ result[i] = from_nir(dst, i);
+ return result;
+}
+
+std::vector<PValue> ValuePool::varvec_from_nir(const nir_src& src, int num_components)
+{
+ std::vector<PValue> result(num_components);
+ int i;
+ for (i = 0; i < num_components; ++i)
+ result[i] = from_nir(src, i);
+
+ return result;
}
+
PValue ValuePool::from_nir(const nir_src& v, unsigned component, unsigned swizzled)
{
sfn_log << SfnLog::reg << "Search " << (v.is_ssa ? "ssa_reg " : "reg ")
diff --git a/src/gallium/drivers/r600/sfn/sfn_valuepool.h b/src/gallium/drivers/r600/sfn/sfn_valuepool.h
index 4dcdc2c78d4..acb04545974 100644
--- a/src/gallium/drivers/r600/sfn/sfn_valuepool.h
+++ b/src/gallium/drivers/r600/sfn/sfn_valuepool.h
@@ -89,6 +89,9 @@ public:
GPRVector vec_from_nir(const nir_dest& dst, int num_components);
+ std::vector<PValue> varvec_from_nir(const nir_dest& src, int num_components);
+ std::vector<PValue> varvec_from_nir(const nir_src& src, int num_components);
+
PValue from_nir(const nir_src& v, unsigned component, unsigned swizzled);
PValue from_nir(const nir_src& v, unsigned component);
More information about the mesa-commit
mailing list