[Mesa-dev] [RFC PATCH 26/26] glsl: fix up an assertion in glsl_type::sampler_index()

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Apr 11 16:48:37 UTC 2017


Used by glsl_to_tgsi.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/compiler/glsl_types.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index cf0fe71d1a..6854169646 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -315,7 +315,8 @@ glsl_type::sampler_index() const
 {
    const glsl_type *const t = (this->is_array()) ? this->fields.array : this;
 
-   assert(t->is_sampler() || t->is_image());
+   assert(t->base_type >= GLSL_TYPE_BINDLESS_SAMPLER &&
+          t->base_type <= GLSL_TYPE_IMAGE);
 
    switch (t->sampler_dimensionality) {
    case GLSL_SAMPLER_DIM_1D:
-- 
2.12.2



More information about the mesa-dev mailing list