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
051fbbb6
Commit
051fbbb6
authored
Feb 26, 2021
by
Greg Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix off-by-1 bug in gl_MaxCombinedTextureImageUnits check
The problem was only with arrays of samplers. Fixed #2552
parent
3839066e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
420.vert
Test/420.vert
+1
-0
420.vert.out
Test/baseResults/420.vert.out
+2
-0
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+2
-6
No files found.
Test/420.vert
View file @
051fbbb6
...
...
@@ -159,3 +159,4 @@ void qlod()
}
layout
(
binding
=
0
)
writeonly
uniform
image1D
badArray
[];
layout
(
binding
=
74
)
uniform
sampler2D
u_sampler0
[
6
];
Test/baseResults/420.vert.out
View file @
051fbbb6
...
...
@@ -306,6 +306,7 @@ ERROR: node is still EOpNull!
0:? 'samp1D' ( uniform sampler1D)
0:? 'samp1Ds' ( uniform sampler1DShadow)
0:? 'badArray' (layout( binding=0) writeonly uniform unsized 1-element array of image1D)
0:? 'u_sampler0' (layout( binding=74) uniform 6-element array of sampler2D)
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
...
...
@@ -388,6 +389,7 @@ ERROR: node is still EOpNull!
0:? 'samp1D' ( uniform sampler1D)
0:? 'samp1Ds' ( uniform sampler1DShadow)
0:? 'badArray' (layout( binding=0) writeonly uniform 1-element array of image1D)
0:? 'u_sampler0' (layout( binding=74) uniform 6-element array of sampler2D)
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
glslang/MachineIndependent/ParseHelper.cpp
View file @
051fbbb6
...
...
@@ -5913,15 +5913,11 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
if
(
type
.
getBasicType
()
==
EbtSampler
)
{
int
lastBinding
=
qualifier
.
layoutBinding
;
if
(
type
.
isArray
())
{
if
(
spvVersion
.
vulkan
>
0
)
lastBinding
+=
1
;
else
{
if
(
spvVersion
.
vulkan
==
0
)
{
if
(
type
.
isSizedArray
())
lastBinding
+=
type
.
getCumulativeArraySize
(
);
lastBinding
+=
(
type
.
getCumulativeArraySize
()
-
1
);
else
{
lastBinding
+=
1
;
#ifndef GLSLANG_WEB
if
(
spvVersion
.
vulkan
==
0
)
warn
(
loc
,
"assuming binding count of one for compile-time checking of binding numbers for unsized array"
,
"[]"
,
""
);
#endif
}
...
...
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