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
3c81ceda
Commit
3c81ceda
authored
Dec 30, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'clustered-rules' into 'master'
SPV: Add cluster-size rule checking. See merge request !31
parents
1d1910e7
5eb6fbb1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
0 deletions
+71
-0
spv.subgroupClusteredNeg.comp.out
Test/baseResults/spv.subgroupClusteredNeg.comp.out
+13
-0
spv.subgroupClusteredNeg.comp
Test/spv.subgroupClusteredNeg.comp
+39
-0
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+18
-0
Spv.FromFile.cpp
gtests/Spv.FromFile.cpp
+1
-0
No files found.
Test/baseResults/spv.subgroupClusteredNeg.comp.out
0 → 100755
View file @
3c81ceda
spv.subgroupClusteredNeg.comp
ERROR: 0:22: 'cluster size' : argument must be at least 1
ERROR: 0:24: 'cluster size' : argument must be a power of 2
ERROR: 0:27: 'cluster size' : argument must be a power of 2
ERROR: 0:29: 'cluster size' : argument must be at least 1
ERROR: 0:31: 'cluster size' : argument must be at least 1
ERROR: 0:33: 'cluster size' : argument must be compile-time constant
ERROR: 0:36: 'cluster size' : argument must be compile-time constant
ERROR: 0:37: 'cluster size' : argument must be compile-time constant
ERROR: 8 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link
Test/spv.subgroupClusteredNeg.comp
0 → 100644
View file @
3c81ceda
#version 450
#extension GL_KHR_shader_subgroup_clustered: enable
layout (local_size_x = 8) in;
layout(binding = 0) buffer Buffers
{
vec4 f4;
ivec4 i4;
uvec4 u4;
dvec4 d4;
} data[4];
void main()
{
int a = 1;
const int aConst = 1;
uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4;
data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 0); // ERROR, less than 1
data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 3); // ERROR, not a power of 2
data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 8);
data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6); // ERROR, not a power of 2
data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, -1); // ERROR, less than 1
data[invocation].i4 = subgroupClusteredAnd(data[3].i4, -3); // ERROR, less than 1
data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, a); // ERROR, not constant
data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, aConst);
data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1 + a); // ERROR, not constant
data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, aConst + a); // ERROR, not constant
data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1 + aConst);
}
glslang/MachineIndependent/ParseHelper.cpp
View file @
3c81ceda
...
...
@@ -1598,6 +1598,24 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
intermediate
.
setMultiStream
();
break
;
case
EOpSubgroupClusteredAdd
:
case
EOpSubgroupClusteredMul
:
case
EOpSubgroupClusteredMin
:
case
EOpSubgroupClusteredMax
:
case
EOpSubgroupClusteredAnd
:
case
EOpSubgroupClusteredOr
:
case
EOpSubgroupClusteredXor
:
if
((
*
argp
)[
1
]
->
getAsConstantUnion
()
==
nullptr
)
error
(
loc
,
"argument must be compile-time constant"
,
"cluster size"
,
""
);
else
{
int
size
=
(
*
argp
)[
1
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
if
(
size
<
1
)
error
(
loc
,
"argument must be at least 1"
,
"cluster size"
,
""
);
else
if
(
!
IsPow2
(
size
))
error
(
loc
,
"argument must be a power of 2"
,
"cluster size"
,
""
);
}
break
;
default
:
break
;
}
...
...
gtests/Spv.FromFile.cpp
View file @
3c81ceda
...
...
@@ -342,6 +342,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.subgroupShuffleRelative.comp"
,
"spv.subgroupArithmetic.comp"
,
"spv.subgroupClustered.comp"
,
"spv.subgroupClusteredNeg.comp"
,
"spv.subgroupQuad.comp"
,
"spv.int8.frag"
,
"spv.int16.frag"
,
...
...
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