/[packages]/cauldron/mesa/current/SOURCES/0019-glsl-correctly-validate-component-layout-qualifier-f.patch
ViewVC logotype

Contents of /cauldron/mesa/current/SOURCES/0019-glsl-correctly-validate-component-layout-qualifier-f.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1379265 - (show annotations) (download)
Wed Mar 20 17:08:42 2019 UTC (2 months ago) by tmb
File size: 1886 byte(s)
more fixes from staging/19.0 branch
1 From 1b4712719e3ad3433576f84afacb36891aa1a88e Mon Sep 17 00:00:00 2001
2 From: Andres Gomez <agomez@igalia.com>
3 Date: Thu, 20 Dec 2018 03:09:57 +0200
4 Subject: [PATCH 19/24] glsl: correctly validate component layout qualifier for
5 dvec{3,4}
6
7 From page 62 (page 68 of the PDF) of the GLSL 4.50 v.7 spec:
8
9 " A dvec3 or dvec4 can only be declared without specifying a
10 component."
11
12 Therefore, using the "component" qualifier with a dvec3 or dvec4
13 should result in a compiling error.
14
15 v2: enhance the error message (Timothy).
16
17 Fixes: 94438578d21 ("glsl: validate and store component layout qualifier in GLSL IR")
18 Cc: Timothy Arceri <tarceri@itsqueeze.com>
19 Cc: Kenneth Graunke <kenneth@whitecape.org>
20 Signed-off-by: Andres Gomez <agomez@igalia.com>
21 Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
22 (cherry picked from commit a96093136bddfe17661f1de54228fe4b5618ba8a)
23 ---
24 src/compiler/glsl/ast_to_hir.cpp | 4 ++++
25 1 file changed, 4 insertions(+)
26
27 diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
28 index 620153e6a34..ebb460962ff 100644
29 --- a/src/compiler/glsl/ast_to_hir.cpp
30 +++ b/src/compiler/glsl/ast_to_hir.cpp
31 @@ -3698,6 +3698,10 @@ apply_layout_qualifier_to_variable(const struct ast_type_qualifier *qual,
32 "cannot be applied to a matrix, a structure, "
33 "a block, or an array containing any of "
34 "these.");
35 + } else if (components > 4 && type->is_64bit()) {
36 + _mesa_glsl_error(loc, state, "component layout qualifier "
37 + "cannot be applied to dvec%u.",
38 + components / 2);
39 } else if (qual_component != 0 &&
40 (qual_component + components - 1) > 3) {
41 _mesa_glsl_error(loc, state, "component overflow (%u > 3)",
42 --
43 2.21.0
44

  ViewVC Help
Powered by ViewVC 1.1.26