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
7225a1cb
Commit
7225a1cb
authored
Feb 13, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support align/offset for all versions GLSL/ESSL targeting SPIR-V.
parent
e4e8f7b7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
6 deletions
+12
-6
spv.140.frag.out
Test/baseResults/spv.140.frag.out
+1
-1
spv.300layout.vert.out
Test/baseResults/spv.300layout.vert.out
+1
-1
spv.140.frag
Test/spv.140.frag
+1
-1
spv.300layout.vert
Test/spv.300layout.vert
+1
-1
revision.h
glslang/Include/revision.h
+2
-2
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+6
-0
No files found.
Test/baseResults/spv.140.frag.out
View file @
7225a1cb
...
@@ -54,7 +54,7 @@ spv.140.frag
...
@@ -54,7 +54,7 @@ spv.140.frag
MemberDecorate 87(bn) 3 Offset 576
MemberDecorate 87(bn) 3 Offset 576
MemberDecorate 87(bn) 3 MatrixStride 16
MemberDecorate 87(bn) 3 MatrixStride 16
MemberDecorate 87(bn) 4 RowMajor
MemberDecorate 87(bn) 4 RowMajor
MemberDecorate 87(bn) 4 Offset
640
MemberDecorate 87(bn) 4 Offset
1024
MemberDecorate 87(bn) 4 MatrixStride 16
MemberDecorate 87(bn) 4 MatrixStride 16
Decorate 87(bn) Block
Decorate 87(bn) Block
Decorate 89 DescriptorSet 0
Decorate 89 DescriptorSet 0
...
...
Test/baseResults/spv.300layout.vert.out
View file @
7225a1cb
...
@@ -61,7 +61,7 @@ Warning, version 310 is not yet complete; most version-specific features are pre
...
@@ -61,7 +61,7 @@ Warning, version 310 is not yet complete; most version-specific features are pre
MemberDecorate 45(T3) 2 ColMajor
MemberDecorate 45(T3) 2 ColMajor
MemberDecorate 45(T3) 2 Offset 128
MemberDecorate 45(T3) 2 Offset 128
MemberDecorate 45(T3) 2 MatrixStride 16
MemberDecorate 45(T3) 2 MatrixStride 16
MemberDecorate 45(T3) 3 Offset
160
MemberDecorate 45(T3) 3 Offset
2048
Decorate 45(T3) Block
Decorate 45(T3) Block
Decorate 47 DescriptorSet 0
Decorate 47 DescriptorSet 0
MemberDecorate 78(T2) 0 Offset 0
MemberDecorate 78(T2) 0 Offset 0
...
...
Test/spv.140.frag
View file @
7225a1cb
...
@@ -14,7 +14,7 @@ layout(std140) uniform bn {
...
@@ -14,7 +14,7 @@ layout(std140) uniform bn {
layout
(
column_major
)
mat4
matca
[
4
];
layout
(
column_major
)
mat4
matca
[
4
];
layout
(
row_major
)
mat4
matr
;
layout
(
row_major
)
mat4
matr
;
layout
(
column_major
)
mat4
matc
;
layout
(
column_major
)
mat4
matc
;
mat4
matrdef
;
layout
(
align
=
512
,
offset
=
1024
)
mat4
matrdef
;
};
};
uniform
sampler2DRect
sampR
;
uniform
sampler2DRect
sampR
;
...
...
Test/spv.300layout.vert
View file @
7225a1cb
...
@@ -25,7 +25,7 @@ layout(column_major) uniform T3 { // shared and column_major
...
@@ -25,7 +25,7 @@ layout(column_major) uniform T3 { // shared and column_major
mat4
M3
;
// column_major
mat4
M3
;
// column_major
layout
(
row_major
)
mat4
M4
;
// row major
layout
(
row_major
)
mat4
M4
;
// row major
mat2x3
N2
;
// column_major
mat2x3
N2
;
// column_major
uvec3
uv3a
[
4
];
layout
(
align
=
16
,
offset
=
2048
)
uvec3
uv3a
[
4
];
};
};
in
uint
uiuin
;
in
uint
uiuin
;
...
...
glslang/Include/revision.h
View file @
7225a1cb
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.182
5
"
#define GLSLANG_REVISION "Overload400-PrecQual.182
8
"
#define GLSLANG_DATE "1
0
-Feb-2017"
#define GLSLANG_DATE "1
3
-Feb-2017"
glslang/MachineIndependent/ParseHelper.cpp
View file @
7225a1cb
...
@@ -4008,16 +4008,20 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
...
@@ -4008,16 +4008,20 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
// - uniform offsets
// - uniform offsets
// - atomic_uint offsets
// - atomic_uint offsets
const
char
*
feature
=
"offset"
;
const
char
*
feature
=
"offset"
;
if
(
spvVersion
.
spv
==
0
)
{
requireProfile
(
loc
,
EEsProfile
|
ECoreProfile
|
ECompatibilityProfile
,
feature
);
requireProfile
(
loc
,
EEsProfile
|
ECoreProfile
|
ECompatibilityProfile
,
feature
);
const
char
*
exts
[
2
]
=
{
E_GL_ARB_enhanced_layouts
,
E_GL_ARB_shader_atomic_counters
};
const
char
*
exts
[
2
]
=
{
E_GL_ARB_enhanced_layouts
,
E_GL_ARB_shader_atomic_counters
};
profileRequires
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
420
,
2
,
exts
,
feature
);
profileRequires
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
420
,
2
,
exts
,
feature
);
profileRequires
(
loc
,
EEsProfile
,
310
,
nullptr
,
feature
);
profileRequires
(
loc
,
EEsProfile
,
310
,
nullptr
,
feature
);
}
publicType
.
qualifier
.
layoutOffset
=
value
;
publicType
.
qualifier
.
layoutOffset
=
value
;
return
;
return
;
}
else
if
(
id
==
"align"
)
{
}
else
if
(
id
==
"align"
)
{
const
char
*
feature
=
"uniform buffer-member align"
;
const
char
*
feature
=
"uniform buffer-member align"
;
if
(
spvVersion
.
spv
==
0
)
{
requireProfile
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
feature
);
requireProfile
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
feature
);
profileRequires
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
440
,
E_GL_ARB_enhanced_layouts
,
feature
);
profileRequires
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
440
,
E_GL_ARB_enhanced_layouts
,
feature
);
}
// "The specified alignment must be a power of 2, or a compile-time error results."
// "The specified alignment must be a power of 2, or a compile-time error results."
if
(
!
IsPow2
(
value
))
if
(
!
IsPow2
(
value
))
error
(
loc
,
"must be a power of 2"
,
"align"
,
""
);
error
(
loc
,
"must be a power of 2"
,
"align"
,
""
);
...
@@ -5546,9 +5550,11 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
...
@@ -5546,9 +5550,11 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
if
(
memberType
.
isArray
())
if
(
memberType
.
isArray
())
arrayUnsizedCheck
(
memberLoc
,
currentBlockQualifier
,
&
memberType
.
getArraySizes
(),
false
,
member
==
typeList
.
size
()
-
1
);
arrayUnsizedCheck
(
memberLoc
,
currentBlockQualifier
,
&
memberType
.
getArraySizes
(),
false
,
member
==
typeList
.
size
()
-
1
);
if
(
memberQualifier
.
hasOffset
())
{
if
(
memberQualifier
.
hasOffset
())
{
if
(
spvVersion
.
spv
==
0
)
{
requireProfile
(
memberLoc
,
~
EEsProfile
,
"offset on block member"
);
requireProfile
(
memberLoc
,
~
EEsProfile
,
"offset on block member"
);
profileRequires
(
memberLoc
,
~
EEsProfile
,
440
,
E_GL_ARB_enhanced_layouts
,
"offset on block member"
);
profileRequires
(
memberLoc
,
~
EEsProfile
,
440
,
E_GL_ARB_enhanced_layouts
,
"offset on block member"
);
}
}
}
if
(
memberType
.
containsOpaque
())
if
(
memberType
.
containsOpaque
())
error
(
memberLoc
,
"member of block cannot be or contain a sampler, image, or atomic_uint type"
,
typeList
[
member
].
type
->
getFieldName
().
c_str
(),
""
);
error
(
memberLoc
,
"member of block cannot be or contain a sampler, image, or atomic_uint type"
,
typeList
[
member
].
type
->
getFieldName
().
c_str
(),
""
);
...
...
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