mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-19 14:58:32 +02:00
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:a45b6fb452"spirv: Pass SSA values through functions" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109204 Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (cherry picked from commit70ed049cc6)
This commit is contained in:
parent
7f29d45f91
commit
8d09bd10d2
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue