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
838d7afc
Commit
838d7afc
authored
Dec 12, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: HLSL: Move to correct HLSL barrier semantics, per Khronos recommendation.
parent
c72e5937
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
37 deletions
+46
-37
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+18
-10
hlsl.intrinsics.barriers.comp.out
Test/baseResults/hlsl.intrinsics.barriers.comp.out
+22
-23
intermediate.h
glslang/Include/intermediate.h
+2
-1
intermOut.cpp
glslang/MachineIndependent/intermOut.cpp
+2
-1
hlslParseables.cpp
hlsl/hlslParseables.cpp
+2
-2
No files found.
SPIRV/GlslangToSpv.cpp
View file @
838d7afc
...
@@ -1762,8 +1762,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
...
@@ -1762,8 +1762,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
case
glslang
:
:
EOpMemoryBarrierImage
:
case
glslang
:
:
EOpMemoryBarrierImage
:
case
glslang
:
:
EOpMemoryBarrierShared
:
case
glslang
:
:
EOpMemoryBarrierShared
:
case
glslang
:
:
EOpGroupMemoryBarrier
:
case
glslang
:
:
EOpGroupMemoryBarrier
:
case
glslang
:
:
EOpDeviceMemoryBarrier
:
case
glslang
:
:
EOpAllMemoryBarrierWithGroupSync
:
case
glslang
:
:
EOpAllMemoryBarrierWithGroupSync
:
case
glslang
:
:
EOp
Group
MemoryBarrierWithGroupSync
:
case
glslang
:
:
EOp
Device
MemoryBarrierWithGroupSync
:
case
glslang
:
:
EOpWorkgroupMemoryBarrier
:
case
glslang
:
:
EOpWorkgroupMemoryBarrier
:
case
glslang
:
:
EOpWorkgroupMemoryBarrierWithGroupSync
:
case
glslang
:
:
EOpWorkgroupMemoryBarrierWithGroupSync
:
noReturnValue
=
true
;
noReturnValue
=
true
;
...
@@ -5466,21 +5467,28 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
...
@@ -5466,21 +5467,28 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
spv
::
MemorySemanticsAcquireReleaseMask
);
spv
::
MemorySemanticsAcquireReleaseMask
);
return
0
;
return
0
;
case
glslang
:
:
EOpAllMemoryBarrierWithGroupSync
:
case
glslang
:
:
EOpAllMemoryBarrierWithGroupSync
:
// Control barrier with non-"None" semantic is also a memory barrier.
builder
.
createControlBarrier
(
spv
::
ScopeWorkgroup
,
spv
::
ScopeDevice
,
builder
.
createControlBarrier
(
spv
::
ScopeDevice
,
spv
::
ScopeDevice
,
spv
::
MemorySemanticsAllMemory
|
spv
::
MemorySemanticsAllMemory
|
spv
::
MemorySemantics
SequentiallyConsistent
Mask
);
spv
::
MemorySemantics
AcquireRelease
Mask
);
return
0
;
return
0
;
case
glslang
:
:
EOpGroupMemoryBarrierWithGroupSync
:
case
glslang
:
:
EOpDeviceMemoryBarrier
:
// Control barrier with non-"None" semantic is also a memory barrier.
builder
.
createMemoryBarrier
(
spv
::
ScopeDevice
,
spv
::
MemorySemanticsUniformMemoryMask
|
builder
.
createControlBarrier
(
spv
::
ScopeDevice
,
spv
::
ScopeDevice
,
spv
::
MemorySemanticsCrossWorkgroupMemoryMask
);
spv
::
MemorySemanticsImageMemoryMask
|
spv
::
MemorySemanticsAcquireReleaseMask
);
return
0
;
case
glslang
:
:
EOpDeviceMemoryBarrierWithGroupSync
:
builder
.
createControlBarrier
(
spv
::
ScopeWorkgroup
,
spv
::
ScopeDevice
,
spv
::
MemorySemanticsUniformMemoryMask
|
spv
::
MemorySemanticsImageMemoryMask
|
spv
::
MemorySemanticsAcquireReleaseMask
);
return
0
;
return
0
;
case
glslang
:
:
EOpWorkgroupMemoryBarrier
:
case
glslang
:
:
EOpWorkgroupMemoryBarrier
:
builder
.
createMemoryBarrier
(
spv
::
ScopeWorkgroup
,
spv
::
MemorySemanticsWorkgroupMemoryMask
);
builder
.
createMemoryBarrier
(
spv
::
ScopeWorkgroup
,
spv
::
MemorySemanticsWorkgroupMemoryMask
|
spv
::
MemorySemanticsAcquireReleaseMask
);
return
0
;
return
0
;
case
glslang
:
:
EOpWorkgroupMemoryBarrierWithGroupSync
:
case
glslang
:
:
EOpWorkgroupMemoryBarrierWithGroupSync
:
// Control barrier with non-"None" semantic is also a memory barrier.
builder
.
createControlBarrier
(
spv
::
ScopeWorkgroup
,
spv
::
ScopeWorkgroup
,
builder
.
createControlBarrier
(
spv
::
ScopeWorkgroup
,
spv
::
ScopeWorkgroup
,
spv
::
MemorySemanticsWorkgroupMemoryMask
);
spv
::
MemorySemanticsWorkgroupMemoryMask
|
spv
::
MemorySemanticsAcquireReleaseMask
);
return
0
;
return
0
;
#ifdef AMD_EXTENSIONS
#ifdef AMD_EXTENSIONS
case
glslang
:
:
EOpTime
:
case
glslang
:
:
EOpTime
:
...
...
Test/baseResults/hlsl.intrinsics.barriers.comp.out
View file @
838d7afc
...
@@ -7,8 +7,8 @@ local_size = (1, 1, 1)
...
@@ -7,8 +7,8 @@ local_size = (1, 1, 1)
0:? Sequence
0:? Sequence
0:4 MemoryBarrier ( temp void)
0:4 MemoryBarrier ( temp void)
0:5 AllMemoryBarrierWithGroupSync ( temp void)
0:5 AllMemoryBarrierWithGroupSync ( temp void)
0:6
Group
MemoryBarrier ( temp void)
0:6
Device
MemoryBarrier ( temp void)
0:7
Group
MemoryBarrierWithGroupSync ( temp void)
0:7
Device
MemoryBarrierWithGroupSync ( temp void)
0:8 WorkgroupMemoryBarrier ( temp void)
0:8 WorkgroupMemoryBarrier ( temp void)
0:9 WorkgroupMemoryBarrierWithGroupSync ( temp void)
0:9 WorkgroupMemoryBarrierWithGroupSync ( temp void)
0:11 Branch: Return with expression
0:11 Branch: Return with expression
...
@@ -35,8 +35,8 @@ local_size = (1, 1, 1)
...
@@ -35,8 +35,8 @@ local_size = (1, 1, 1)
0:? Sequence
0:? Sequence
0:4 MemoryBarrier ( temp void)
0:4 MemoryBarrier ( temp void)
0:5 AllMemoryBarrierWithGroupSync ( temp void)
0:5 AllMemoryBarrierWithGroupSync ( temp void)
0:6
Group
MemoryBarrier ( temp void)
0:6
Device
MemoryBarrier ( temp void)
0:7
Group
MemoryBarrierWithGroupSync ( temp void)
0:7
Device
MemoryBarrierWithGroupSync ( temp void)
0:8 WorkgroupMemoryBarrier ( temp void)
0:8 WorkgroupMemoryBarrier ( temp void)
0:9 WorkgroupMemoryBarrierWithGroupSync ( temp void)
0:9 WorkgroupMemoryBarrierWithGroupSync ( temp void)
0:11 Branch: Return with expression
0:11 Branch: Return with expression
...
@@ -53,18 +53,18 @@ local_size = (1, 1, 1)
...
@@ -53,18 +53,18 @@ local_size = (1, 1, 1)
// Module Version 10000
// Module Version 10000
// Generated by (magic number): 80003
// Generated by (magic number): 80003
// Id's are bound by 2
3
// Id's are bound by 2
2
Capability Shader
Capability Shader
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "ComputeShaderFunction" 2
1
EntryPoint GLCompute 4 "ComputeShaderFunction" 2
0
ExecutionMode 4 LocalSize 1 1 1
ExecutionMode 4 LocalSize 1 1 1
Source HLSL 500
Source HLSL 500
Name 4 "ComputeShaderFunction"
Name 4 "ComputeShaderFunction"
Name 8 "@ComputeShaderFunction("
Name 8 "@ComputeShaderFunction("
Name 2
1
"@entryPointOutput"
Name 2
0
"@entryPointOutput"
Decorate 2
1
(@entryPointOutput) Location 0
Decorate 2
0
(@entryPointOutput) Location 0
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
6: TypeFloat 32
6: TypeFloat 32
...
@@ -72,26 +72,25 @@ local_size = (1, 1, 1)
...
@@ -72,26 +72,25 @@ local_size = (1, 1, 1)
10: TypeInt 32 0
10: TypeInt 32 0
11: 10(int) Constant 1
11: 10(int) Constant 1
12: 10(int) Constant 4040
12: 10(int) Constant 4040
13: 10(int) Constant 4048
13: 10(int) Constant 2
14: 10(int) Constant 2
14: 10(int) Constant 2120
15: 10(int) Constant 512
15: 10(int) Constant 264
16: 10(int) Constant 256
16: 6(float) Constant 0
17: 6(float) Constant 0
19: TypePointer Output 6(float)
20: TypePointer Output 6(float)
20(@entryPointOutput): 19(ptr) Variable Output
21(@entryPointOutput): 20(ptr) Variable Output
4(ComputeShaderFunction): 2 Function None 3
4(ComputeShaderFunction): 2 Function None 3
5: Label
5: Label
2
2
: 6(float) FunctionCall 8(@ComputeShaderFunction()
2
1
: 6(float) FunctionCall 8(@ComputeShaderFunction()
Store 2
1(@entryPointOutput) 22
Store 2
0(@entryPointOutput) 21
Return
Return
FunctionEnd
FunctionEnd
8(@ComputeShaderFunction(): 6(float) Function None 7
8(@ComputeShaderFunction(): 6(float) Function None 7
9: Label
9: Label
MemoryBarrier 11 12
MemoryBarrier 11 12
ControlBarrier 1
1 11 13
ControlBarrier 1
3 11 12
MemoryBarrier 1
4 12
MemoryBarrier 1
1 14
ControlBarrier 1
1 11 15
ControlBarrier 1
3 11 14
MemoryBarrier 1
4 16
MemoryBarrier 1
3 15
ControlBarrier 1
4 14 16
ControlBarrier 1
3 13 15
ReturnValue 1
7
ReturnValue 1
6
FunctionEnd
FunctionEnd
glslang/Include/intermediate.h
View file @
838d7afc
...
@@ -722,7 +722,8 @@ enum TOperator {
...
@@ -722,7 +722,8 @@ enum TOperator {
EOpInterlockedOr
,
// ...
EOpInterlockedOr
,
// ...
EOpInterlockedXor
,
// ...
EOpInterlockedXor
,
// ...
EOpAllMemoryBarrierWithGroupSync
,
// memory barriers without non-hlsl AST equivalents
EOpAllMemoryBarrierWithGroupSync
,
// memory barriers without non-hlsl AST equivalents
EOpGroupMemoryBarrierWithGroupSync
,
// ...
EOpDeviceMemoryBarrier
,
// ...
EOpDeviceMemoryBarrierWithGroupSync
,
// ...
EOpWorkgroupMemoryBarrier
,
// ...
EOpWorkgroupMemoryBarrier
,
// ...
EOpWorkgroupMemoryBarrierWithGroupSync
,
// ...
EOpWorkgroupMemoryBarrierWithGroupSync
,
// ...
EOpEvaluateAttributeSnapped
,
// InterpolateAtOffset with int position on 16x16 grid
EOpEvaluateAttributeSnapped
,
// InterpolateAtOffset with int position on 16x16 grid
...
...
glslang/MachineIndependent/intermOut.cpp
View file @
838d7afc
...
@@ -791,7 +791,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
...
@@ -791,7 +791,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case
EOpGenMul
:
out
.
debug
<<
"mul"
;
break
;
case
EOpGenMul
:
out
.
debug
<<
"mul"
;
break
;
case
EOpAllMemoryBarrierWithGroupSync
:
out
.
debug
<<
"AllMemoryBarrierWithGroupSync"
;
break
;
case
EOpAllMemoryBarrierWithGroupSync
:
out
.
debug
<<
"AllMemoryBarrierWithGroupSync"
;
break
;
case
EOpGroupMemoryBarrierWithGroupSync
:
out
.
debug
<<
"GroupMemoryBarrierWithGroupSync"
;
break
;
case
EOpDeviceMemoryBarrier
:
out
.
debug
<<
"DeviceMemoryBarrier"
;
break
;
case
EOpDeviceMemoryBarrierWithGroupSync
:
out
.
debug
<<
"DeviceMemoryBarrierWithGroupSync"
;
break
;
case
EOpWorkgroupMemoryBarrier
:
out
.
debug
<<
"WorkgroupMemoryBarrier"
;
break
;
case
EOpWorkgroupMemoryBarrier
:
out
.
debug
<<
"WorkgroupMemoryBarrier"
;
break
;
case
EOpWorkgroupMemoryBarrierWithGroupSync
:
out
.
debug
<<
"WorkgroupMemoryBarrierWithGroupSync"
;
break
;
case
EOpWorkgroupMemoryBarrierWithGroupSync
:
out
.
debug
<<
"WorkgroupMemoryBarrierWithGroupSync"
;
break
;
...
...
hlsl/hlslParseables.cpp
View file @
838d7afc
...
@@ -1087,8 +1087,8 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil
...
@@ -1087,8 +1087,8 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil
symbolTable
.
relateToOperator
(
"ddy_fine"
,
EOpDPdyFine
);
symbolTable
.
relateToOperator
(
"ddy_fine"
,
EOpDPdyFine
);
symbolTable
.
relateToOperator
(
"degrees"
,
EOpDegrees
);
symbolTable
.
relateToOperator
(
"degrees"
,
EOpDegrees
);
symbolTable
.
relateToOperator
(
"determinant"
,
EOpDeterminant
);
symbolTable
.
relateToOperator
(
"determinant"
,
EOpDeterminant
);
symbolTable
.
relateToOperator
(
"DeviceMemoryBarrier"
,
EOp
Group
MemoryBarrier
);
symbolTable
.
relateToOperator
(
"DeviceMemoryBarrier"
,
EOp
Device
MemoryBarrier
);
symbolTable
.
relateToOperator
(
"DeviceMemoryBarrierWithGroupSync"
,
EOp
GroupMemoryBarrierWithGroupSync
);
// ...
symbolTable
.
relateToOperator
(
"DeviceMemoryBarrierWithGroupSync"
,
EOp
DeviceMemoryBarrierWithGroupSync
);
symbolTable
.
relateToOperator
(
"distance"
,
EOpDistance
);
symbolTable
.
relateToOperator
(
"distance"
,
EOpDistance
);
symbolTable
.
relateToOperator
(
"dot"
,
EOpDot
);
symbolTable
.
relateToOperator
(
"dot"
,
EOpDot
);
symbolTable
.
relateToOperator
(
"dst"
,
EOpDst
);
symbolTable
.
relateToOperator
(
"dst"
,
EOpDst
);
...
...
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