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
19bdf90e
Commit
19bdf90e
authored
Oct 07, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Distinguish between SPV and non-SPV rules for member overlap.
parent
087a454a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
96 additions
and
16 deletions
+96
-16
spv.offsets.frag.out
Test/baseResults/spv.offsets.frag.out
+59
-0
spv.offsets.frag
Test/spv.offsets.frag
+18
-0
revision.h
glslang/Include/revision.h
+2
-2
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+16
-9
Spv.FromFile.cpp
gtests/Spv.FromFile.cpp
+1
-0
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+0
-5
No files found.
Test/baseResults/spv.offsets.frag.out
0 → 100755
View file @
19bdf90e
spv.offsets.frag
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
Linked fragment stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 15
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
Name 4 "main"
Name 7 "n1"
MemberName 7(n1) 0 "a"
MemberName 7(n1) 1 "b"
MemberName 7(n1) 2 "c"
MemberName 7(n1) 3 "d"
Name 9 "i1"
Name 12 "n2"
MemberName 12(n2) 0 "e"
MemberName 12(n2) 1 "f"
MemberName 12(n2) 2 "g"
MemberName 12(n2) 3 "h"
Name 14 "i2"
MemberDecorate 7(n1) 0 Offset 8
MemberDecorate 7(n1) 1 Offset 4
MemberDecorate 7(n1) 2 Offset 0
MemberDecorate 7(n1) 3 Offset 12
Decorate 7(n1) Block
Decorate 9(i1) DescriptorSet 0
Decorate 9(i1) Binding 0
MemberDecorate 12(n2) 0 Offset 32
MemberDecorate 12(n2) 1 Offset 48
MemberDecorate 12(n2) 2 Offset 16
MemberDecorate 12(n2) 3 Offset 0
Decorate 12(n2) BufferBlock
Decorate 14(i2) DescriptorSet 0
Decorate 14(i2) Binding 1
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7(n1): TypeStruct 6(int) 6(int) 6(int) 6(int)
8: TypePointer Uniform 7(n1)
9(i1): 8(ptr) Variable Uniform
10: TypeFloat 32
11: TypeVector 10(float) 3
12(n2): TypeStruct 11(fvec3) 11(fvec3) 11(fvec3) 11(fvec3)
13: TypePointer Uniform 12(n2)
14(i2): 13(ptr) Variable Uniform
4(main): 2 Function None 3
5: Label
Return
FunctionEnd
Test/spv.offsets.frag
0 → 100755
View file @
19bdf90e
#version 450
layout
(
set
=
0
,
binding
=
0
,
std140
)
uniform
n1
{
layout
(
offset
=
8
)
int
a
;
layout
(
offset
=
4
)
int
b
;
layout
(
offset
=
0
)
int
c
;
layout
(
offset
=
12
)
int
d
;
}
i1
;
layout
(
set
=
0
,
binding
=
1
,
std430
)
buffer
n2
{
layout
(
offset
=
32
)
vec3
e
;
vec3
f
;
layout
(
offset
=
16
)
vec3
g
;
layout
(
offset
=
0
)
vec3
h
;
}
i2
;
void
main
()
{}
\ No newline at end of file
glslang/Include/revision.h
View file @
19bdf90e
...
...
@@ -2,5 +2,5 @@
// 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).
#define GLSLANG_REVISION "Overload400-PrecQual.15
59
"
#define GLSLANG_DATE "0
6
-Oct-2016"
#define GLSLANG_REVISION "Overload400-PrecQual.15
60
"
#define GLSLANG_DATE "0
7
-Oct-2016"
glslang/MachineIndependent/ParseHelper.cpp
View file @
19bdf90e
...
...
@@ -5946,16 +5946,23 @@ void TParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typ
if
(
!
IsMultipleOfPow2
(
memberQualifier
.
layoutOffset
,
memberAlignment
))
error
(
memberLoc
,
"must be a multiple of the member's alignment"
,
"offset"
,
""
);
// "It is a compile-time error to specify an offset that is smaller than the offset of the previous
//
GLSL:
"It is a compile-time error to specify an offset that is smaller than the offset of the previous
// member in the block or that lies within the previous member of the block"
if
(
memberQualifier
.
layoutOffset
<
offset
)
error
(
memberLoc
,
"cannot lie in previous members"
,
"offset"
,
""
);
// "The offset qualifier forces the qualified member to start at or after the specified
// integral-constant expression, which will be its byte offset from the beginning of the buffer.
// "The actual offset of a member is computed as
// follows: If offset was declared, start with that offset, otherwise start with the next available offset."
offset
=
std
::
max
(
offset
,
memberQualifier
.
layoutOffset
);
if
(
spvVersion
.
spv
==
0
)
{
if
(
memberQualifier
.
layoutOffset
<
offset
)
error
(
memberLoc
,
"cannot lie in previous members"
,
"offset"
,
""
);
// "The offset qualifier forces the qualified member to start at or after the specified
// integral-constant expression, which will be its byte offset from the beginning of the buffer.
// "The actual offset of a member is computed as
// follows: If offset was declared, start with that offset, otherwise start with the next available offset."
offset
=
std
::
max
(
offset
,
memberQualifier
.
layoutOffset
);
}
else
{
// TODO: Vulkan: "It is a compile-time error to have any offset, explicit or assigned,
// that lies within another member of the block."
offset
=
memberQualifier
.
layoutOffset
;
}
}
// "The actual alignment of a member will be the greater of the specified align alignment and the standard
...
...
gtests/Spv.FromFile.cpp
View file @
19bdf90e
...
...
@@ -230,6 +230,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.newTexture.frag"
,
"spv.noDeadDecorations.vert"
,
"spv.nonSquare.vert"
,
"spv.offsets.frag"
,
"spv.Operations.frag"
,
"spv.intOps.vert"
,
"spv.precision.frag"
,
...
...
hlsl/hlslParseHelper.cpp
View file @
19bdf90e
...
...
@@ -4731,11 +4731,6 @@ void HlslParseContext::fixBlockUniformOffsets(const TQualifier& qualifier, TType
if
(
!
IsMultipleOfPow2
(
memberQualifier
.
layoutOffset
,
memberAlignment
))
error
(
memberLoc
,
"must be a multiple of the member's alignment"
,
"offset"
,
""
);
// "It is a compile-time error to specify an offset that is smaller than the offset of the previous
// member in the block or that lies within the previous member of the block"
if
(
memberQualifier
.
layoutOffset
<
offset
)
error
(
memberLoc
,
"cannot lie in previous members"
,
"offset"
,
""
);
// "The offset qualifier forces the qualified member to start at or after the specified
// integral-constant expression, which will be its byte offset from the beginning of the buffer.
// "The actual offset of a member is computed as
...
...
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