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
656650f4
Unverified
Commit
656650f4
authored
Feb 06, 2020
by
John Kessenich
Committed by
GitHub
Feb 06, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2078 from amdrexu/bugfix
GLSL: Fix semantic error for GL_KHR_memory_scope_semantics
parents
b82ed734
b4bab3ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
9 deletions
+24
-9
spv.memoryScopeSemantics.comp.out
Test/baseResults/spv.memoryScopeSemantics.comp.out
+10
-1
spv.memoryScopeSemantics.comp
Test/spv.memoryScopeSemantics.comp
+3
-0
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+11
-8
No files found.
Test/baseResults/spv.memoryScopeSemantics.comp.out
View file @
656650f4
spv.memoryScopeSemantics.comp
spv.memoryScopeSemantics.comp
// Module Version 10300
// Module Version 10300
// Generated by (magic number): 80008
// Generated by (magic number): 80008
// Id's are bound by 16
3
// Id's are bound by 16
7
Capability Shader
Capability Shader
Capability Int64
Capability Int64
Capability Int64Atomics
Capability Int64Atomics
Capability StorageImageMultisample
Capability VulkanMemoryModelKHR
Capability VulkanMemoryModelKHR
Capability VulkanMemoryModelDeviceScopeKHR
Capability VulkanMemoryModelDeviceScopeKHR
Extension "SPV_KHR_vulkan_memory_model"
Extension "SPV_KHR_vulkan_memory_model"
...
@@ -49,6 +50,7 @@ spv.memoryScopeSemantics.comp
...
@@ -49,6 +50,7 @@ spv.memoryScopeSemantics.comp
Name 151 "BufferM"
Name 151 "BufferM"
MemberName 151(BufferM) 0 "x"
MemberName 151(BufferM) 0 "x"
Name 153 "bufferm"
Name 153 "bufferm"
Name 165 "imageMS"
Decorate 36(imagei) DescriptorSet 0
Decorate 36(imagei) DescriptorSet 0
Decorate 36(imagei) Binding 1
Decorate 36(imagei) Binding 1
Decorate 46(imageu) DescriptorSet 0
Decorate 46(imageu) DescriptorSet 0
...
@@ -83,6 +85,8 @@ spv.memoryScopeSemantics.comp
...
@@ -83,6 +85,8 @@ spv.memoryScopeSemantics.comp
Decorate 151(BufferM) Block
Decorate 151(BufferM) Block
Decorate 153(bufferm) DescriptorSet 0
Decorate 153(bufferm) DescriptorSet 0
Decorate 153(bufferm) Binding 9
Decorate 153(bufferm) Binding 9
Decorate 165(imageMS) DescriptorSet 0
Decorate 165(imageMS) Binding 10
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
6: TypeInt 32 1
6: TypeInt 32 1
...
@@ -174,6 +178,9 @@ spv.memoryScopeSemantics.comp
...
@@ -174,6 +178,9 @@ spv.memoryScopeSemantics.comp
152: TypePointer StorageBuffer 151(BufferM)
152: TypePointer StorageBuffer 151(BufferM)
153(bufferm): 152(ptr) Variable StorageBuffer
153(bufferm): 152(ptr) Variable StorageBuffer
161: 6(int) Constant 32768
161: 6(int) Constant 32768
163: TypeImage 6(int) 2D multi-sampled nonsampled format:R32i
164: TypePointer UniformConstant 163
165(imageMS): 164(ptr) Variable UniformConstant
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
8(origi): 7(ptr) Variable Function
8(origi): 7(ptr) Variable Function
...
@@ -271,5 +278,7 @@ spv.memoryScopeSemantics.comp
...
@@ -271,5 +278,7 @@ spv.memoryScopeSemantics.comp
159: 15(int) AtomicIAdd 158 12 17 51
159: 15(int) AtomicIAdd 158 12 17 51
160: 69(ptr) AccessChain 68(bufferu) 38
160: 69(ptr) AccessChain 68(bufferu) 38
162: 15(int) AtomicIAdd 160 12 42 16
162: 15(int) AtomicIAdd 160 12 42 16
166: 40(ptr) ImageTexelPointer 165(imageMS) 39 12
AtomicStore 166 12 33 14
Return
Return
FunctionEnd
FunctionEnd
Test/spv.memoryScopeSemantics.comp
View file @
656650f4
...
@@ -20,6 +20,7 @@ shared uint64_t atomu64;
...
@@ -20,6 +20,7 @@ shared uint64_t atomu64;
shared int64_t atomi64;
shared int64_t atomi64;
layout (binding = 8) volatile buffer BufferL { uint x; } bufferl;
layout (binding = 8) volatile buffer BufferL { uint x; } bufferl;
layout (binding = 9) buffer BufferM { volatile uint x; } bufferm;
layout (binding = 9) buffer BufferM { volatile uint x; } bufferm;
layout(binding = 10, r32i) volatile coherent uniform iimage2DMS imageMS;
void main()
void main()
...
@@ -66,5 +67,7 @@ void main()
...
@@ -66,5 +67,7 @@ void main()
imageAtomicAdd(imagei, ivec2(0,0), 3);
imageAtomicAdd(imagei, ivec2(0,0), 3);
atomicAdd(bufferu.x, 4u, gl_ScopeDevice, 0, 0);
atomicAdd(bufferu.x, 4u, gl_ScopeDevice, 0, 0);
atomicAdd(bufferu.x, 5u, gl_ScopeDevice, 0, gl_SemanticsVolatile);
atomicAdd(bufferu.x, 5u, gl_ScopeDevice, 0, gl_SemanticsVolatile);
imageAtomicStore(imageMS, ivec2(0,0), 1, 4, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease);
}
}
glslang/MachineIndependent/ParseHelper.cpp
View file @
656650f4
...
@@ -1672,6 +1672,9 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction&
...
@@ -1672,6 +1672,9 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction&
unsigned
int
semantics
=
0
,
storageClassSemantics
=
0
;
unsigned
int
semantics
=
0
,
storageClassSemantics
=
0
;
unsigned
int
semantics2
=
0
,
storageClassSemantics2
=
0
;
unsigned
int
semantics2
=
0
,
storageClassSemantics2
=
0
;
const
TIntermTyped
*
arg0
=
(
*
argp
)[
0
]
->
getAsTyped
();
const
bool
isMS
=
arg0
->
getBasicType
()
==
EbtSampler
&&
arg0
->
getType
().
getSampler
().
isMultiSample
();
// Grab the semantics and storage class semantics from the operands, based on opcode
// Grab the semantics and storage class semantics from the operands, based on opcode
switch
(
callNode
.
getOp
())
{
switch
(
callNode
.
getOp
())
{
case
EOpAtomicAdd
:
case
EOpAtomicAdd
:
...
@@ -1704,18 +1707,18 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction&
...
@@ -1704,18 +1707,18 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction&
case
EOpImageAtomicXor
:
case
EOpImageAtomicXor
:
case
EOpImageAtomicExchange
:
case
EOpImageAtomicExchange
:
case
EOpImageAtomicStore
:
case
EOpImageAtomicStore
:
storageClassSemantics
=
(
*
argp
)[
4
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
storageClassSemantics
=
(
*
argp
)[
isMS
?
5
:
4
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
semantics
=
(
*
argp
)[
5
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
semantics
=
(
*
argp
)[
isMS
?
6
:
5
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
break
;
break
;
case
EOpImageAtomicLoad
:
case
EOpImageAtomicLoad
:
storageClassSemantics
=
(
*
argp
)[
3
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
storageClassSemantics
=
(
*
argp
)[
isMS
?
4
:
3
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
semantics
=
(
*
argp
)[
4
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
semantics
=
(
*
argp
)[
isMS
?
5
:
4
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
break
;
break
;
case
EOpImageAtomicCompSwap
:
case
EOpImageAtomicCompSwap
:
storageClassSemantics
=
(
*
argp
)[
5
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
storageClassSemantics
=
(
*
argp
)[
isMS
?
6
:
5
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
semantics
=
(
*
argp
)[
6
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
semantics
=
(
*
argp
)[
isMS
?
7
:
6
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
storageClassSemantics2
=
(
*
argp
)[
7
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
storageClassSemantics2
=
(
*
argp
)[
isMS
?
8
:
7
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
semantics2
=
(
*
argp
)[
8
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
semantics2
=
(
*
argp
)[
isMS
?
9
:
8
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
].
getIConst
();
break
;
break
;
case
EOpBarrier
:
case
EOpBarrier
:
...
...
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