Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
5cb2fa2a
Commit
5cb2fa2a
authored
May 03, 2019
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1759: Check for specialization constants when literals required.
parent
86c72c94
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
5 deletions
+93
-5
430.vert.out
Test/baseResults/430.vert.out
+2
-1
vulkan.vert.out
Test/baseResults/vulkan.vert.out
+20
-1
vulkan.vert
Test/vulkan.vert
+12
-0
revision.h
glslang/Include/revision.h
+1
-1
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+46
-0
attribute.cpp
glslang/MachineIndependent/attribute.cpp
+3
-0
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+9
-2
No files found.
Test/baseResults/430.vert.out
View file @
5cb2fa2a
...
@@ -17,6 +17,7 @@ ERROR: 0:47: 'gl_ClipDistance array size' : must be less than or equal to gl_Max
...
@@ -17,6 +17,7 @@ ERROR: 0:47: 'gl_ClipDistance array size' : must be less than or equal to gl_Max
ERROR: 0:51: 'start' : undeclared identifier
ERROR: 0:51: 'start' : undeclared identifier
ERROR: 0:51: '' : constant expression required
ERROR: 0:51: '' : constant expression required
ERROR: 0:51: 'layout-id value' : scalar integer expression required
ERROR: 0:51: 'layout-id value' : scalar integer expression required
ERROR: 0:51: 'location' : needs a literal integer
ERROR: 0:53: 'input block' : not supported in this stage: vertex
ERROR: 0:53: 'input block' : not supported in this stage: vertex
ERROR: 0:54: 'location on block member' : not supported for this version or the enabled extensions
ERROR: 0:54: 'location on block member' : not supported for this version or the enabled extensions
ERROR: 0:57: 'input block' : not supported in this stage: vertex
ERROR: 0:57: 'input block' : not supported in this stage: vertex
...
@@ -63,7 +64,7 @@ ERROR: 0:221: 'textureQueryLevels' : no matching overloaded function found
...
@@ -63,7 +64,7 @@ ERROR: 0:221: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:221: 'assign' : cannot convert from ' const float' to ' temp int'
ERROR: 0:221: 'assign' : cannot convert from ' const float' to ' temp int'
ERROR: 0:222: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:222: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:222: 'assign' : cannot convert from ' const float' to ' temp int'
ERROR: 0:222: 'assign' : cannot convert from ' const float' to ' temp int'
ERROR: 6
4
compilation errors. No code generated.
ERROR: 6
5
compilation errors. No code generated.
Shader version: 430
Shader version: 430
...
...
Test/baseResults/vulkan.vert.out
View file @
5cb2fa2a
...
@@ -34,7 +34,26 @@ ERROR: 0:54: '[]' : only outermost dimension of an array of arrays can be a spec
...
@@ -34,7 +34,26 @@ ERROR: 0:54: '[]' : only outermost dimension of an array of arrays can be a spec
ERROR: 0:54: 'location' : SPIR-V requires location for user input/output
ERROR: 0:54: 'location' : SPIR-V requires location for user input/output
ERROR: 0:58: 'location' : SPIR-V requires location for user input/output
ERROR: 0:58: 'location' : SPIR-V requires location for user input/output
ERROR: 0:65: 'location' : overlapping use of location 10
ERROR: 0:65: 'location' : overlapping use of location 10
ERROR: 35 compilation errors. No code generated.
ERROR: 0:68: 'location' : needs a literal integer
ERROR: 0:68: 'component' : needs a literal integer
ERROR: 0:69: 'binding' : needs a literal integer
ERROR: 0:69: 'set' : needs a literal integer
ERROR: 0:70: 'offset' : needs a literal integer
ERROR: 0:71: 'align' : must be a power of 2
ERROR: 0:71: 'align' : needs a literal integer
ERROR: 0:72: 'xfb_offset' : needs a literal integer
ERROR: 0:73: 'xfb_buffer' : needs a literal integer
ERROR: 0:74: 'xfb_stride' : needs a literal integer
ERROR: 0:73: 'xfb_buffer' : member cannot contradict block (or what block inherited from global)
ERROR: 0:72: 'xfb layout qualifier' : can only be used on an output
ERROR: 0:73: 'xfb layout qualifier' : can only be used on an output
ERROR: 0:74: 'xfb layout qualifier' : can only be used on an output
ERROR: 0:76: 'input_attachment_index' : needs a literal integer
ERROR: 0:76: 'input_attachment_index' : can only be used with a subpass
ERROR: 0:77: 'constant_id' : needs a literal integer
ERROR: 0:77: 'constant_id' : can only be applied to 'const'-qualified scalar
ERROR: 0:77: 'constant_id' : can only be applied to a scalar
ERROR: 54 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link
SPIR-V is not generated for failed compile or link
Test/vulkan.vert
View file @
5cb2fa2a
...
@@ -63,3 +63,15 @@ layout(binding = 3000) uniform sampler2D s3000;
...
@@ -63,3 +63,15 @@ layout(binding = 3000) uniform sampler2D s3000;
layout
(
binding
=
3001
)
uniform
b3001
{
int
a
;
};
layout
(
binding
=
3001
)
uniform
b3001
{
int
a
;
};
layout
(
location
=
10
)
in
vec4
in1
;
layout
(
location
=
10
)
in
vec4
in1
;
layout
(
location
=
10
)
in
vec4
in2
;
// ERROR, no location aliasing
layout
(
location
=
10
)
in
vec4
in2
;
// ERROR, no location aliasing
layout
(
constant_id
=
400
)
const
int
nonLit
=
1
;
layout
(
location
=
nonLit
,
component
=
nonLit
)
in
vec4
nonLit1
;
// ERROR, non literal
layout
(
binding
=
nonLit
,
set
=
nonLit
)
uniform
nonLitBN
{
// ERROR, non literal
layout
(
offset
=
nonLit
)
vec4
nonLit1
;
// ERROR, non literal
layout
(
align
=
nonLit
)
vec4
nonLit3
;
// ERROR, non literal
layout
(
xfb_offset
=
nonLit
)
vec4
nonLit4
;
// ERROR, non literal
layout
(
xfb_buffer
=
nonLit
)
vec4
nonLit5
;
// ERROR, non literal
layout
(
xfb_stride
=
nonLit
)
vec4
nonLit6
;
// ERROR, non literal
}
nonLitBI
;
layout
(
input_attachment_index
=
nonLit
)
vec4
nonLit3
;
// ERROR, non literal
layout
(
constant_id
=
nonLit
)
vec4
nonLit4
;
// ERROR, non literal
glslang/Include/revision.h
View file @
5cb2fa2a
// This header is generated by the make-revision script.
// This header is generated by the make-revision script.
#define GLSLANG_PATCH_LEVEL 320
4
#define GLSLANG_PATCH_LEVEL 320
5
glslang/MachineIndependent/ParseHelper.cpp
View file @
5cb2fa2a
This diff is collapsed.
Click to expand it.
glslang/MachineIndependent/attribute.cpp
View file @
5cb2fa2a
...
@@ -85,6 +85,9 @@ const TConstUnion* TAttributeArgs::getConstUnion(TBasicType basicType, int argNu
...
@@ -85,6 +85,9 @@ const TConstUnion* TAttributeArgs::getConstUnion(TBasicType basicType, int argNu
if
(
argNum
>=
(
int
)
args
->
getSequence
().
size
())
if
(
argNum
>=
(
int
)
args
->
getSequence
().
size
())
return
nullptr
;
return
nullptr
;
if
(
args
->
getSequence
()[
argNum
]
->
getAsConstantUnion
()
==
nullptr
)
return
nullptr
;
const
TConstUnion
*
constVal
=
&
args
->
getSequence
()[
argNum
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
];
const
TConstUnion
*
constVal
=
&
args
->
getSequence
()[
argNum
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
];
if
(
constVal
==
nullptr
||
constVal
->
getType
()
!=
basicType
)
if
(
constVal
==
nullptr
||
constVal
->
getType
()
!=
basicType
)
return
nullptr
;
return
nullptr
;
...
...
hlsl/hlslParseHelper.cpp
View file @
5cb2fa2a
...
@@ -1899,13 +1899,16 @@ void HlslParseContext::transferTypeAttributes(const TSourceLoc& loc, const TAttr
...
@@ -1899,13 +1899,16 @@ void HlslParseContext::transferTypeAttributes(const TSourceLoc& loc, const TAttr
// location
// location
if
(
it
->
getInt
(
value
))
if
(
it
->
getInt
(
value
))
type
.
getQualifier
().
layoutLocation
=
value
;
type
.
getQualifier
().
layoutLocation
=
value
;
else
error
(
loc
,
"needs a literal integer"
,
"location"
,
""
);
break
;
break
;
case
EatBinding
:
case
EatBinding
:
// binding
// binding
if
(
it
->
getInt
(
value
))
{
if
(
it
->
getInt
(
value
))
{
type
.
getQualifier
().
layoutBinding
=
value
;
type
.
getQualifier
().
layoutBinding
=
value
;
type
.
getQualifier
().
layoutSet
=
0
;
type
.
getQualifier
().
layoutSet
=
0
;
}
}
else
error
(
loc
,
"needs a literal integer"
,
"binding"
,
""
);
// set
// set
if
(
it
->
getInt
(
value
,
1
))
if
(
it
->
getInt
(
value
,
1
))
type
.
getQualifier
().
layoutSet
=
value
;
type
.
getQualifier
().
layoutSet
=
value
;
...
@@ -1914,7 +1917,9 @@ void HlslParseContext::transferTypeAttributes(const TSourceLoc& loc, const TAttr
...
@@ -1914,7 +1917,9 @@ void HlslParseContext::transferTypeAttributes(const TSourceLoc& loc, const TAttr
// global cbuffer binding
// global cbuffer binding
if
(
it
->
getInt
(
value
))
if
(
it
->
getInt
(
value
))
globalUniformBinding
=
value
;
globalUniformBinding
=
value
;
// global cbuffer binding
else
error
(
loc
,
"needs a literal integer"
,
"global binding"
,
""
);
// global cbuffer set
if
(
it
->
getInt
(
value
,
1
))
if
(
it
->
getInt
(
value
,
1
))
globalUniformSet
=
value
;
globalUniformSet
=
value
;
break
;
break
;
...
@@ -1922,6 +1927,8 @@ void HlslParseContext::transferTypeAttributes(const TSourceLoc& loc, const TAttr
...
@@ -1922,6 +1927,8 @@ void HlslParseContext::transferTypeAttributes(const TSourceLoc& loc, const TAttr
// input attachment
// input attachment
if
(
it
->
getInt
(
value
))
if
(
it
->
getInt
(
value
))
type
.
getQualifier
().
layoutAttachment
=
value
;
type
.
getQualifier
().
layoutAttachment
=
value
;
else
error
(
loc
,
"needs a literal integer"
,
"input attachment"
,
""
);
break
;
break
;
case
EatBuiltIn
:
case
EatBuiltIn
:
// PointSize built-in
// PointSize built-in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment