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
c4f5ec87
Commit
c4f5ec87
authored
Mar 30, 2018
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nonuniform: expand test for all types that can be arrayed.
parent
d89e5afa
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
spv.nonuniform.frag.out
Test/baseResults/spv.nonuniform.frag.out
+0
-0
spv.nonuniform.frag
Test/spv.nonuniform.frag
+22
-2
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+4
-0
No files found.
Test/baseResults/spv.nonuniform.frag.out
View file @
c4f5ec87
This diff is collapsed.
Click to expand it.
Test/spv.nonuniform.frag
View file @
c4f5ec87
...
@@ -5,7 +5,17 @@
...
@@ -5,7 +5,17 @@
layout
(
location
=
0
)
nonuniformEXT
in
vec4
nu_inv4
;
layout
(
location
=
0
)
nonuniformEXT
in
vec4
nu_inv4
;
nonuniformEXT
float
nu_gf
;
nonuniformEXT
float
nu_gf
;
layout
(
location
=
1
)
in
nonuniformEXT
flat
int
nu_ii
;
layout
(
location
=
1
)
in
nonuniformEXT
flat
int
nu_ii
;
layout
(
binding
=
0
)
uniform
sampler2D
s2d
[];
layout
(
binding
=
0
,
input_attachment_index
=
0
)
uniform
subpassInput
inputAttachmentDyn
[];
layout
(
binding
=
1
)
uniform
samplerBuffer
uniformTexelBufferDyn
[];
layout
(
binding
=
2
,
r32f
)
uniform
imageBuffer
storageTexelBufferDyn
[];
layout
(
binding
=
3
)
uniform
uname
{
float
a
;
}
uniformBuffer
[];
layout
(
binding
=
4
)
buffer
bname
{
float
b
;
}
storageBuffer
[];
layout
(
binding
=
5
)
uniform
sampler2D
sampledImage
[];
layout
(
binding
=
6
,
r32f
)
uniform
image2D
storageImage
[];
layout
(
binding
=
7
,
input_attachment_index
=
1
)
uniform
subpassInput
inputAttachment
[];
layout
(
binding
=
8
)
uniform
samplerBuffer
uniformTexelBuffer
[];
layout
(
binding
=
9
,
r32f
)
uniform
imageBuffer
storageTexelBuffer
[];
nonuniformEXT
int
foo
(
nonuniformEXT
int
nupi
,
nonuniformEXT
out
int
f
)
nonuniformEXT
int
foo
(
nonuniformEXT
int
nupi
,
nonuniformEXT
out
int
f
)
{
{
...
@@ -15,11 +25,21 @@ nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f)
...
@@ -15,11 +25,21 @@ nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f)
void
main
()
void
main
()
{
{
nonuniformEXT
int
nu_li
;
nonuniformEXT
int
nu_li
;
int
dyn_i
;
int
a
=
foo
(
nu_li
,
nu_li
);
int
a
=
foo
(
nu_li
,
nu_li
);
nu_li
=
nonuniformEXT
(
a
)
+
nonuniformEXT
(
a
*
2
);
nu_li
=
nonuniformEXT
(
a
)
+
nonuniformEXT
(
a
*
2
);
float
b
;
float
b
;
b
=
nu_inv4
.
x
*
nu_gf
;
b
=
nu_inv4
.
x
*
nu_gf
;
texture
(
s2d
[
nu_ii
],
vec2
(
0
.
5
));
b
+=
subpassLoad
(
inputAttachmentDyn
[
dyn_i
]).
x
;
b
+=
texelFetch
(
uniformTexelBufferDyn
[
dyn_i
],
1
).
x
;
b
+=
imageLoad
(
storageTexelBufferDyn
[
dyn_i
],
1
).
x
;
b
+=
uniformBuffer
[
nu_ii
].
a
;
b
+=
storageBuffer
[
nu_ii
].
b
;
b
+
texture
(
sampledImage
[
nu_ii
],
vec2
(
0
.
5
)).
x
;
b
+=
imageLoad
(
storageImage
[
nu_ii
],
ivec2
(
1
)).
x
;
b
+=
subpassLoad
(
inputAttachment
[
nu_ii
]).
x
;
b
+=
texelFetch
(
uniformTexelBuffer
[
nu_ii
],
1
).
x
;
b
+=
imageLoad
(
storageTexelBuffer
[
nu_ii
],
1
).
x
;
}
}
glslang/MachineIndependent/ParseHelper.cpp
View file @
c4f5ec87
...
@@ -4679,6 +4679,9 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
...
@@ -4679,6 +4679,9 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
if
(
type
.
getBasicType
()
==
EbtSampler
)
{
if
(
type
.
getBasicType
()
==
EbtSampler
)
{
int
lastBinding
=
qualifier
.
layoutBinding
;
int
lastBinding
=
qualifier
.
layoutBinding
;
if
(
type
.
isArray
())
{
if
(
type
.
isArray
())
{
if
(
spvVersion
.
vulkan
>
0
)
lastBinding
+=
1
;
else
{
if
(
type
.
isSizedArray
())
if
(
type
.
isSizedArray
())
lastBinding
+=
type
.
getCumulativeArraySize
();
lastBinding
+=
type
.
getCumulativeArraySize
();
else
{
else
{
...
@@ -4686,6 +4689,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
...
@@ -4686,6 +4689,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
warn
(
loc
,
"assuming array size of one for compile-time checking of binding numbers for unsized array"
,
"[]"
,
""
);
warn
(
loc
,
"assuming array size of one for compile-time checking of binding numbers for unsized array"
,
"[]"
,
""
);
}
}
}
}
}
if
(
spvVersion
.
vulkan
==
0
&&
lastBinding
>=
resources
.
maxCombinedTextureImageUnits
)
if
(
spvVersion
.
vulkan
==
0
&&
lastBinding
>=
resources
.
maxCombinedTextureImageUnits
)
error
(
loc
,
"sampler binding not less than gl_MaxCombinedTextureImageUnits"
,
"binding"
,
type
.
isArray
()
?
"(using array)"
:
""
);
error
(
loc
,
"sampler binding not less than gl_MaxCombinedTextureImageUnits"
,
"binding"
,
type
.
isArray
()
?
"(using array)"
:
""
);
}
}
...
...
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