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

Author: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>
Date:   Sun Jan  6 12:34:24 2019 +0100

spirv: Fix matrix parameters in function calls.

They can be handled exactly the same as arrays, we just need to handle
the base type correctly in the switches.

Fixes: a45b6fb4524 "spirv: Pass SSA values through functions"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109204
Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>

---

 src/compiler/spirv/vtn_cfg.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index 726f717e8d..6406f4911d 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -47,6 +47,7 @@ vtn_type_count_function_params(struct vtn_type *type)
 {
    switch (type->base_type) {
    case vtn_base_type_array:
+   case vtn_base_type_matrix:
       return type->length * 
vtn_type_count_function_params(type->array_element);
 
    case vtn_base_type_struct: {
@@ -76,6 +77,7 @@ vtn_type_add_to_function_params(struct vtn_type *type,
 
    switch (type->base_type) {
    case vtn_base_type_array:
+   case vtn_base_type_matrix:
       for (unsigned i = 0; i < type->length; i++)
          vtn_type_add_to_function_params(type->array_element, func, param_idx);
       break;
@@ -123,6 +125,7 @@ vtn_ssa_value_add_to_call_params(struct vtn_builder *b,
 {
    switch (type->base_type) {
    case vtn_base_type_array:
+   case vtn_base_type_matrix:
       for (unsigned i = 0; i < type->length; i++) {
          vtn_ssa_value_add_to_call_params(b, value->elems[i],
                                           type->array_element,
@@ -152,6 +155,7 @@ vtn_ssa_value_load_function_param(struct vtn_builder *b,
 {
    switch (type->base_type) {
    case vtn_base_type_array:
+   case vtn_base_type_matrix:
       for (unsigned i = 0; i < type->length; i++) {
          vtn_ssa_value_load_function_param(b, value->elems[i],
                                            type->array_element, param_idx);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to