Module: Mesa
Branch: master
Commit: 9f1cf0e4915262c68e5fb8bd8e87fbd0af30dbe2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f1cf0e4915262c68e5fb8bd8e87fbd0af30dbe2

Author: Danylo Piliaiev <[email protected]>
Date:   Fri May 29 13:51:32 2020 +0300

glsl: inline functions with unsupported return type before converting to nir

glsl_to_nir doesn't expect non-vector/scalar return types in functions.

Fixes: 7e60d5a501f311fa5e7bca5335adc6013dc1aeb9
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3058
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3060
Signed-off-by: Danylo Piliaiev <[email protected]>
Tested-by: Witold Baryluk <[email protected]>
Reviewed-by: Witold Baryluk <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5333>

---

 src/compiler/glsl/glsl_to_nir.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/compiler/glsl/glsl_to_nir.cpp 
b/src/compiler/glsl/glsl_to_nir.cpp
index a6b9f44277f..a67e11be2cb 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -165,6 +165,12 @@ public:
          }
       }
 
+      if (!glsl_type_is_vector_or_scalar(ir->return_type) &&
+          !ir->return_type->is_void()) {
+         unsupported = true;
+         return visit_stop;
+      }
+
       return visit_continue;
    }
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to