[Mesa-dev] [RFC 3/6] nir/types: Advertise 1 vector component for sampler types

Jason Ekstrand jason at jlekstrand.net
Sat Feb 6 05:10:52 UTC 2016


Soon we are going to start doing loads of sampler variables.  When this
happens, we will define the semantics of such a load to be that it returns
the binding table index which is a 1-component integer.
---
 src/compiler/nir_types.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
index a87dcd8..b93ffa3 100644
--- a/src/compiler/nir_types.cpp
+++ b/src/compiler/nir_types.cpp
@@ -85,7 +85,10 @@ glsl_get_base_type(const struct glsl_type *type)
 unsigned
 glsl_get_vector_elements(const struct glsl_type *type)
 {
-   return type->vector_elements;
+   if (type->base_type == GLSL_TYPE_SAMPLER)
+      return 1;
+   else
+      return type->vector_elements;
 }
 
 unsigned
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list