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
e68a7698
Commit
e68a7698
authored
Mar 07, 2018
by
Rex Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more error checks for swizzleInvocations{Masked}AMD()
parent
b2ae1d05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+33
-0
No files found.
glslang/MachineIndependent/ParseHelper.cpp
View file @
e68a7698
...
@@ -1493,6 +1493,39 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
...
@@ -1493,6 +1493,39 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
requireExtensions
(
loc
,
1
,
&
E_GL_ARB_sparse_texture2
,
fnCandidate
.
getName
().
c_str
());
requireExtensions
(
loc
,
1
,
&
E_GL_ARB_sparse_texture2
,
fnCandidate
.
getName
().
c_str
());
break
;
break
;
}
}
case
EOpSwizzleInvocations
:
{
if
(
!
(
*
argp
)[
1
]
->
getAsConstantUnion
())
error
(
loc
,
"argument must be compile-time constant"
,
"offset"
,
""
);
else
{
unsigned
offset
[
4
]
=
{};
offset
[
0
]
=
(
*
argp
)[
1
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getUConst
();
offset
[
1
]
=
(
*
argp
)[
1
]
->
getAsConstantUnion
()
->
getConstArray
()[
1
].
getUConst
();
offset
[
2
]
=
(
*
argp
)[
1
]
->
getAsConstantUnion
()
->
getConstArray
()[
2
].
getUConst
();
offset
[
3
]
=
(
*
argp
)[
1
]
->
getAsConstantUnion
()
->
getConstArray
()[
3
].
getUConst
();
if
(
offset
[
0
]
>
3
||
offset
[
1
]
>
3
||
offset
[
2
]
>
3
||
offset
[
3
]
>
3
)
error
(
loc
,
"components must be in the range [0, 3]"
,
"offset"
,
""
);
}
break
;
}
case
EOpSwizzleInvocationsMasked
:
{
if
(
!
(
*
argp
)[
1
]
->
getAsConstantUnion
())
error
(
loc
,
"argument must be compile-time constant"
,
"mask"
,
""
);
else
{
unsigned
mask
[
3
]
=
{};
mask
[
0
]
=
(
*
argp
)[
1
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getUConst
();
mask
[
1
]
=
(
*
argp
)[
1
]
->
getAsConstantUnion
()
->
getConstArray
()[
1
].
getUConst
();
mask
[
2
]
=
(
*
argp
)[
1
]
->
getAsConstantUnion
()
->
getConstArray
()[
2
].
getUConst
();
if
(
mask
[
0
]
>
31
||
mask
[
1
]
>
31
||
mask
[
2
]
>
31
)
error
(
loc
,
"components must be in the range [0, 31]"
,
"mask"
,
""
);
}
break
;
}
#endif
#endif
case
EOpTextureOffset
:
case
EOpTextureOffset
:
...
...
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