/[packages]/cauldron/mesa/current/SOURCES/0059-spirv-Fix-matrix-parameters-in-function-calls.patch
ViewVC logotype

Contents of /cauldron/mesa/current/SOURCES/0059-spirv-Fix-matrix-parameters-in-function-calls.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1355920 - (show annotations) (download)
Sun Jan 13 14:22:00 2019 UTC (5 years, 3 months ago) by tmb
File size: 2226 byte(s)
add current fixes from upstream staging/18.3 branch
1 From 8d09bd10d2a7b5e2a9be3f42fc00ddd5572a18bd Mon Sep 17 00:00:00 2001
2 From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
3 Date: Sun, 6 Jan 2019 12:34:24 +0100
4 Subject: [PATCH 59/78] spirv: Fix matrix parameters in function calls.
5
6 They can be handled exactly the same as arrays, we just need to handle
7 the base type correctly in the switches.
8
9 Fixes: a45b6fb4524 "spirv: Pass SSA values through functions"
10 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109204
11 Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
12 Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
13 (cherry picked from commit 70ed049cc6a682fba084cf57e06728fa5934881b)
14 ---
15 src/compiler/spirv/vtn_cfg.c | 4 ++++
16 1 file changed, 4 insertions(+)
17
18 diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
19 index 726f717e8d..6406f4911d 100644
20 --- a/src/compiler/spirv/vtn_cfg.c
21 +++ b/src/compiler/spirv/vtn_cfg.c
22 @@ -47,6 +47,7 @@ vtn_type_count_function_params(struct vtn_type *type)
23 {
24 switch (type->base_type) {
25 case vtn_base_type_array:
26 + case vtn_base_type_matrix:
27 return type->length * vtn_type_count_function_params(type->array_element);
28
29 case vtn_base_type_struct: {
30 @@ -76,6 +77,7 @@ vtn_type_add_to_function_params(struct vtn_type *type,
31
32 switch (type->base_type) {
33 case vtn_base_type_array:
34 + case vtn_base_type_matrix:
35 for (unsigned i = 0; i < type->length; i++)
36 vtn_type_add_to_function_params(type->array_element, func, param_idx);
37 break;
38 @@ -123,6 +125,7 @@ vtn_ssa_value_add_to_call_params(struct vtn_builder *b,
39 {
40 switch (type->base_type) {
41 case vtn_base_type_array:
42 + case vtn_base_type_matrix:
43 for (unsigned i = 0; i < type->length; i++) {
44 vtn_ssa_value_add_to_call_params(b, value->elems[i],
45 type->array_element,
46 @@ -152,6 +155,7 @@ vtn_ssa_value_load_function_param(struct vtn_builder *b,
47 {
48 switch (type->base_type) {
49 case vtn_base_type_array:
50 + case vtn_base_type_matrix:
51 for (unsigned i = 0; i < type->length; i++) {
52 vtn_ssa_value_load_function_param(b, value->elems[i],
53 type->array_element, param_idx);
54 --
55 2.20.1
56

  ViewVC Help
Powered by ViewVC 1.1.30