Add support for pre and post HLSL qualifier validation

The change makes it possible to define a const variable after the marked
type. Example "float const"
This commit is contained in:
Dawid Lorenz 2023-07-04 12:44:44 +02:00 committed by arcady-lunarg
parent 4ae01c5f41
commit 44779f508a
3 changed files with 20 additions and 22 deletions

View File

@ -22,18 +22,17 @@ ERROR: node is still EOpNull!
0:? Sequence 0:? Sequence
0:8 Branch: Return with expression 0:8 Branch: Return with expression
0:8 Construct vec4 ( temp 4-component vector of float) 0:8 Construct vec4 ( temp 4-component vector of float)
0:8 Convert int to float ( temp float) 0:8 Comma ( temp float)
0:8 Comma ( temp int) 0:8 Comma ( temp float)
0:8 Comma ( temp int) 0:8 Comma ( temp float)
0:8 Comma ( temp int)
0:8 Constant:
0:8 1 (const int)
0:8 Constant:
0:8 2 (const int)
0:8 Constant: 0:8 Constant:
0:8 3 (const int) 0:8 1.000000
0:8 Constant:
0:8 2.000000
0:8 Constant: 0:8 Constant:
0:8 4 (const int) 0:8 3.000000
0:8 Constant:
0:8 4.000000
0:12 Function Definition: fun3(vf4; ( temp uint) 0:12 Function Definition: fun3(vf4; ( temp uint)
0:12 Function Parameters: 0:12 Function Parameters:
0:12 'col' ( const (read only) 4-component vector of float) 0:12 'col' ( const (read only) 4-component vector of float)
@ -99,18 +98,17 @@ ERROR: node is still EOpNull!
0:? Sequence 0:? Sequence
0:8 Branch: Return with expression 0:8 Branch: Return with expression
0:8 Construct vec4 ( temp 4-component vector of float) 0:8 Construct vec4 ( temp 4-component vector of float)
0:8 Convert int to float ( temp float) 0:8 Comma ( temp float)
0:8 Comma ( temp int) 0:8 Comma ( temp float)
0:8 Comma ( temp int) 0:8 Comma ( temp float)
0:8 Comma ( temp int)
0:8 Constant:
0:8 1 (const int)
0:8 Constant:
0:8 2 (const int)
0:8 Constant: 0:8 Constant:
0:8 3 (const int) 0:8 1.000000
0:8 Constant:
0:8 2.000000
0:8 Constant: 0:8 Constant:
0:8 4 (const int) 0:8 3.000000
0:8 Constant:
0:8 4.000000
0:12 Function Definition: fun3(vf4; ( temp uint) 0:12 Function Definition: fun3(vf4; ( temp uint)
0:12 Function Parameters: 0:12 Function Parameters:
0:12 'col' ( const (read only) 4-component vector of float) 0:12 'col' ( const (read only) 4-component vector of float)

View File

@ -5,7 +5,7 @@ float4 fun0()
float4 fun2(float4 const col) float4 fun2(float4 const col)
{ {
return (1, 2, 3, 4); return (1.0f, 2.0f, 3.0f, 4.0f);
} }
uint fun3(const float4 col) uint fun3(const float4 col)

View File

@ -1,7 +1,7 @@
// //
// Copyright (C) 2016-2018 Google, Inc. // Copyright (C) 2016-2018 Google, Inc.
// Copyright (C) 2016 LunarG, Inc. // Copyright (C) 2016 LunarG, Inc.
// Copyright (C) 2023 Mobica Limited // Copyright (C) 2023 Mobica Limited.
// //
// All rights reserved. // All rights reserved.
// //