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
917ec4ac
Commit
917ec4ac
authored
Jul 22, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Front-end atomics: Finish adding atomic built-in functions (non-image) into the AST.
parent
d1a6846b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
25 deletions
+55
-25
310.comp.out
Test/baseResults/310.comp.out
+16
-16
atomic_uint.frag.out
Test/baseResults/atomic_uint.frag.out
+8
-8
intermediate.h
glslang/Include/intermediate.h
+5
-1
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+13
-0
intermOut.cpp
glslang/MachineIndependent/intermOut.cpp
+13
-0
No files found.
Test/baseResults/310.comp.out
View file @
917ec4ac
...
@@ -187,7 +187,7 @@ ERROR: node is still EOpNull!
...
@@ -187,7 +187,7 @@ ERROR: node is still EOpNull!
0:123 'c' (in highp atomic_uint)
0:123 'c' (in highp atomic_uint)
0:125 Sequence
0:125 Sequence
0:125 Branch: Return with expression
0:125 Branch: Return with expression
0:125
Function Call: atomicCounterIncrement(au1;
(global highp uint)
0:125
AtomicCounterIncrement
(global highp uint)
0:125 'c' (in highp atomic_uint)
0:125 'c' (in highp atomic_uint)
0:128 Function Definition: func2(au1; (global highp uint)
0:128 Function Definition: func2(au1; (global highp uint)
0:128 Function Parameters:
0:128 Function Parameters:
...
@@ -196,7 +196,7 @@ ERROR: node is still EOpNull!
...
@@ -196,7 +196,7 @@ ERROR: node is still EOpNull!
0:130 Branch: Return with expression
0:130 Branch: Return with expression
0:130 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:130 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:131 Branch: Return with expression
0:131 Branch: Return with expression
0:131
Function Call: atomicCounter(au1;
(global highp uint)
0:131
AtomicCounter
(global highp uint)
0:131 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:131 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:134 Function Definition: mainAC( (global void)
0:134 Function Definition: mainAC( (global void)
0:134 Function Parameters:
0:134 Function Parameters:
...
@@ -204,9 +204,9 @@ ERROR: node is still EOpNull!
...
@@ -204,9 +204,9 @@ ERROR: node is still EOpNull!
0:137 Sequence
0:137 Sequence
0:137 move second child to first child (temp highp uint)
0:137 move second child to first child (temp highp uint)
0:137 'val' (temp highp uint)
0:137 'val' (temp highp uint)
0:137
Function Call: atomicCounter(au1;
(global highp uint)
0:137
AtomicCounter
(global highp uint)
0:137 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:137 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:138
Function Call: atomicCounterDecrement(au1;
(global highp uint)
0:138
AtomicCounterDecrement
(global highp uint)
0:138 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:138 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:146 Function Definition: opac( (global void)
0:146 Function Definition: opac( (global void)
0:146 Function Parameters:
0:146 Function Parameters:
...
@@ -227,26 +227,26 @@ ERROR: node is still EOpNull!
...
@@ -227,26 +227,26 @@ ERROR: node is still EOpNull!
0:159 Sequence
0:159 Sequence
0:159 move second child to first child (temp highp int)
0:159 move second child to first child (temp highp int)
0:159 'origi' (temp highp int)
0:159 'origi' (temp highp int)
0:159
Function Call: atomicAdd(i1;i1;
(global highp int)
0:159
AtomicAdd
(global highp int)
0:159 'atomi' (shared highp int)
0:159 'atomi' (shared highp int)
0:159 Constant:
0:159 Constant:
0:159 3 (const int)
0:159 3 (const int)
0:160 Sequence
0:160 Sequence
0:160 move second child to first child (temp highp uint)
0:160 move second child to first child (temp highp uint)
0:160 'origu' (temp highp uint)
0:160 'origu' (temp highp uint)
0:160
Function Call: atomicAnd(u1;u1;
(global highp uint)
0:160
AtomicAnd
(global highp uint)
0:160 'atomu' (shared highp uint)
0:160 'atomu' (shared highp uint)
0:160 Constant:
0:160 Constant:
0:160 7 (const uint)
0:160 7 (const uint)
0:161 move second child to first child (temp highp int)
0:161 move second child to first child (temp highp int)
0:161 'origi' (temp highp int)
0:161 'origi' (temp highp int)
0:161
Function Call: atomicExchange(i1;i1;
(global highp int)
0:161
AtomicExchange
(global highp int)
0:161 'atomi' (shared highp int)
0:161 'atomi' (shared highp int)
0:161 Constant:
0:161 Constant:
0:161 4 (const int)
0:161 4 (const int)
0:162 move second child to first child (temp highp uint)
0:162 move second child to first child (temp highp uint)
0:162 'origu' (temp highp uint)
0:162 'origu' (temp highp uint)
0:162
Function Call: atomicCompSwap(u1;u1;u1;
(global highp uint)
0:162
AtomicCompSwap
(global highp uint)
0:162 'atomu' (shared highp uint)
0:162 'atomu' (shared highp uint)
0:162 Constant:
0:162 Constant:
0:162 10 (const uint)
0:162 10 (const uint)
...
@@ -599,7 +599,7 @@ ERROR: node is still EOpNull!
...
@@ -599,7 +599,7 @@ ERROR: node is still EOpNull!
0:123 'c' (in highp atomic_uint)
0:123 'c' (in highp atomic_uint)
0:125 Sequence
0:125 Sequence
0:125 Branch: Return with expression
0:125 Branch: Return with expression
0:125
Function Call: atomicCounterIncrement(au1;
(global highp uint)
0:125
AtomicCounterIncrement
(global highp uint)
0:125 'c' (in highp atomic_uint)
0:125 'c' (in highp atomic_uint)
0:128 Function Definition: func2(au1; (global highp uint)
0:128 Function Definition: func2(au1; (global highp uint)
0:128 Function Parameters:
0:128 Function Parameters:
...
@@ -608,7 +608,7 @@ ERROR: node is still EOpNull!
...
@@ -608,7 +608,7 @@ ERROR: node is still EOpNull!
0:130 Branch: Return with expression
0:130 Branch: Return with expression
0:130 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:130 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:131 Branch: Return with expression
0:131 Branch: Return with expression
0:131
Function Call: atomicCounter(au1;
(global highp uint)
0:131
AtomicCounter
(global highp uint)
0:131 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:131 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:134 Function Definition: mainAC( (global void)
0:134 Function Definition: mainAC( (global void)
0:134 Function Parameters:
0:134 Function Parameters:
...
@@ -616,9 +616,9 @@ ERROR: node is still EOpNull!
...
@@ -616,9 +616,9 @@ ERROR: node is still EOpNull!
0:137 Sequence
0:137 Sequence
0:137 move second child to first child (temp highp uint)
0:137 move second child to first child (temp highp uint)
0:137 'val' (temp highp uint)
0:137 'val' (temp highp uint)
0:137
Function Call: atomicCounter(au1;
(global highp uint)
0:137
AtomicCounter
(global highp uint)
0:137 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:137 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:138
Function Call: atomicCounterDecrement(au1;
(global highp uint)
0:138
AtomicCounterDecrement
(global highp uint)
0:138 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:138 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
0:146 Function Definition: opac( (global void)
0:146 Function Definition: opac( (global void)
0:146 Function Parameters:
0:146 Function Parameters:
...
@@ -639,26 +639,26 @@ ERROR: node is still EOpNull!
...
@@ -639,26 +639,26 @@ ERROR: node is still EOpNull!
0:159 Sequence
0:159 Sequence
0:159 move second child to first child (temp highp int)
0:159 move second child to first child (temp highp int)
0:159 'origi' (temp highp int)
0:159 'origi' (temp highp int)
0:159
Function Call: atomicAdd(i1;i1;
(global highp int)
0:159
AtomicAdd
(global highp int)
0:159 'atomi' (shared highp int)
0:159 'atomi' (shared highp int)
0:159 Constant:
0:159 Constant:
0:159 3 (const int)
0:159 3 (const int)
0:160 Sequence
0:160 Sequence
0:160 move second child to first child (temp highp uint)
0:160 move second child to first child (temp highp uint)
0:160 'origu' (temp highp uint)
0:160 'origu' (temp highp uint)
0:160
Function Call: atomicAnd(u1;u1;
(global highp uint)
0:160
AtomicAnd
(global highp uint)
0:160 'atomu' (shared highp uint)
0:160 'atomu' (shared highp uint)
0:160 Constant:
0:160 Constant:
0:160 7 (const uint)
0:160 7 (const uint)
0:161 move second child to first child (temp highp int)
0:161 move second child to first child (temp highp int)
0:161 'origi' (temp highp int)
0:161 'origi' (temp highp int)
0:161
Function Call: atomicExchange(i1;i1;
(global highp int)
0:161
AtomicExchange
(global highp int)
0:161 'atomi' (shared highp int)
0:161 'atomi' (shared highp int)
0:161 Constant:
0:161 Constant:
0:161 4 (const int)
0:161 4 (const int)
0:162 move second child to first child (temp highp uint)
0:162 move second child to first child (temp highp uint)
0:162 'origu' (temp highp uint)
0:162 'origu' (temp highp uint)
0:162
Function Call: atomicCompSwap(u1;u1;u1;
(global highp uint)
0:162
AtomicCompSwap
(global highp uint)
0:162 'atomu' (shared highp uint)
0:162 'atomu' (shared highp uint)
0:162 Constant:
0:162 Constant:
0:162 10 (const uint)
0:162 10 (const uint)
...
...
Test/baseResults/atomic_uint.frag.out
View file @
917ec4ac
...
@@ -28,7 +28,7 @@ ERROR: node is still EOpNull!
...
@@ -28,7 +28,7 @@ ERROR: node is still EOpNull!
0:5 'c' (in atomic_uint)
0:5 'c' (in atomic_uint)
0:7 Sequence
0:7 Sequence
0:7 Branch: Return with expression
0:7 Branch: Return with expression
0:7
Function Call: atomicCounterIncrement(au1;
(global uint)
0:7
AtomicCounterIncrement
(global uint)
0:7 'c' (in atomic_uint)
0:7 'c' (in atomic_uint)
0:10 Function Definition: func2(au1; (global uint)
0:10 Function Definition: func2(au1; (global uint)
0:10 Function Parameters:
0:10 Function Parameters:
...
@@ -37,7 +37,7 @@ ERROR: node is still EOpNull!
...
@@ -37,7 +37,7 @@ ERROR: node is still EOpNull!
0:12 Branch: Return with expression
0:12 Branch: Return with expression
0:12 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:12 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:13 Branch: Return with expression
0:13 Branch: Return with expression
0:13
Function Call: atomicCounter(au1;
(global uint)
0:13
AtomicCounter
(global uint)
0:13 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:13 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:16 Function Definition: main( (global void)
0:16 Function Definition: main( (global void)
0:16 Function Parameters:
0:16 Function Parameters:
...
@@ -45,9 +45,9 @@ ERROR: node is still EOpNull!
...
@@ -45,9 +45,9 @@ ERROR: node is still EOpNull!
0:19 Sequence
0:19 Sequence
0:19 move second child to first child (temp uint)
0:19 move second child to first child (temp uint)
0:19 'val' (temp uint)
0:19 'val' (temp uint)
0:19
Function Call: atomicCounter(au1;
(global uint)
0:19
AtomicCounter
(global uint)
0:19 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:19 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:20
Function Call: atomicCounterDecrement(au1;
(global uint)
0:20
AtomicCounterDecrement
(global uint)
0:20 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:20 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:26 Function Definition: opac( (global void)
0:26 Function Definition: opac( (global void)
0:26 Function Parameters:
0:26 Function Parameters:
...
@@ -91,7 +91,7 @@ ERROR: node is still EOpNull!
...
@@ -91,7 +91,7 @@ ERROR: node is still EOpNull!
0:5 'c' (in atomic_uint)
0:5 'c' (in atomic_uint)
0:7 Sequence
0:7 Sequence
0:7 Branch: Return with expression
0:7 Branch: Return with expression
0:7
Function Call: atomicCounterIncrement(au1;
(global uint)
0:7
AtomicCounterIncrement
(global uint)
0:7 'c' (in atomic_uint)
0:7 'c' (in atomic_uint)
0:10 Function Definition: func2(au1; (global uint)
0:10 Function Definition: func2(au1; (global uint)
0:10 Function Parameters:
0:10 Function Parameters:
...
@@ -100,7 +100,7 @@ ERROR: node is still EOpNull!
...
@@ -100,7 +100,7 @@ ERROR: node is still EOpNull!
0:12 Branch: Return with expression
0:12 Branch: Return with expression
0:12 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:12 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:13 Branch: Return with expression
0:13 Branch: Return with expression
0:13
Function Call: atomicCounter(au1;
(global uint)
0:13
AtomicCounter
(global uint)
0:13 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:13 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:16 Function Definition: main( (global void)
0:16 Function Definition: main( (global void)
0:16 Function Parameters:
0:16 Function Parameters:
...
@@ -108,9 +108,9 @@ ERROR: node is still EOpNull!
...
@@ -108,9 +108,9 @@ ERROR: node is still EOpNull!
0:19 Sequence
0:19 Sequence
0:19 move second child to first child (temp uint)
0:19 move second child to first child (temp uint)
0:19 'val' (temp uint)
0:19 'val' (temp uint)
0:19
Function Call: atomicCounter(au1;
(global uint)
0:19
AtomicCounter
(global uint)
0:19 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:19 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:20
Function Call: atomicCounterDecrement(au1;
(global uint)
0:20
AtomicCounterDecrement
(global uint)
0:20 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:20 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
0:26 Function Definition: opac( (global void)
0:26 Function Definition: opac( (global void)
0:26 Function Parameters:
0:26 Function Parameters:
...
...
glslang/Include/intermediate.h
View file @
917ec4ac
...
@@ -234,7 +234,7 @@ enum TOperator {
...
@@ -234,7 +234,7 @@ enum TOperator {
EOpMemoryBarrierShared
,
// compute only
EOpMemoryBarrierShared
,
// compute only
EOpGroupMemoryBarrier
,
// compute only
EOpGroupMemoryBarrier
,
// compute only
EOpAtomicAdd
,
// TODO: AST functionality: hook these up
EOpAtomicAdd
,
EOpAtomicMin
,
EOpAtomicMin
,
EOpAtomicMax
,
EOpAtomicMax
,
EOpAtomicAnd
,
EOpAtomicAnd
,
...
@@ -243,6 +243,10 @@ enum TOperator {
...
@@ -243,6 +243,10 @@ enum TOperator {
EOpAtomicExchange
,
EOpAtomicExchange
,
EOpAtomicCompSwap
,
EOpAtomicCompSwap
,
EOpAtomicCounterIncrement
,
EOpAtomicCounterDecrement
,
EOpAtomicCounter
,
EOpAny
,
EOpAny
,
EOpAll
,
EOpAll
,
...
...
glslang/MachineIndependent/Initialize.cpp
View file @
917ec4ac
...
@@ -3133,6 +3133,19 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
...
@@ -3133,6 +3133,19 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
symbolTable
.
relateToOperator
(
"memoryBarrierBuffer"
,
EOpMemoryBarrierBuffer
);
symbolTable
.
relateToOperator
(
"memoryBarrierBuffer"
,
EOpMemoryBarrierBuffer
);
symbolTable
.
relateToOperator
(
"memoryBarrierImage"
,
EOpMemoryBarrierImage
);
symbolTable
.
relateToOperator
(
"memoryBarrierImage"
,
EOpMemoryBarrierImage
);
symbolTable
.
relateToOperator
(
"atomicAdd"
,
EOpAtomicAdd
);
symbolTable
.
relateToOperator
(
"atomicMin"
,
EOpAtomicMin
);
symbolTable
.
relateToOperator
(
"atomicMax"
,
EOpAtomicMax
);
symbolTable
.
relateToOperator
(
"atomicAnd"
,
EOpAtomicAnd
);
symbolTable
.
relateToOperator
(
"atomicOr"
,
EOpAtomicOr
);
symbolTable
.
relateToOperator
(
"atomicXor"
,
EOpAtomicXor
);
symbolTable
.
relateToOperator
(
"atomicExchange"
,
EOpAtomicExchange
);
symbolTable
.
relateToOperator
(
"atomicCompSwap"
,
EOpAtomicCompSwap
);
symbolTable
.
relateToOperator
(
"atomicCounterIncrement"
,
EOpAtomicCounterIncrement
);
symbolTable
.
relateToOperator
(
"atomicCounterDecrement"
,
EOpAtomicCounterDecrement
);
symbolTable
.
relateToOperator
(
"atomicCounter"
,
EOpAtomicCounter
);
if
(
PureOperatorBuiltins
)
{
if
(
PureOperatorBuiltins
)
{
symbolTable
.
relateToOperator
(
"imageQuerySize"
,
EImageQuerySize
);
symbolTable
.
relateToOperator
(
"imageQuerySize"
,
EImageQuerySize
);
symbolTable
.
relateToOperator
(
"imageQuerySamples"
,
EImageQuerySamples
);
symbolTable
.
relateToOperator
(
"imageQuerySamples"
,
EImageQuerySamples
);
...
...
glslang/MachineIndependent/intermOut.cpp
View file @
917ec4ac
...
@@ -289,6 +289,10 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
...
@@ -289,6 +289,10 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case
EOpEmitStreamVertex
:
out
.
debug
<<
"EmitStreamVertex"
;
break
;
case
EOpEmitStreamVertex
:
out
.
debug
<<
"EmitStreamVertex"
;
break
;
case
EOpEndStreamPrimitive
:
out
.
debug
<<
"EndStreamPrimitive"
;
break
;
case
EOpEndStreamPrimitive
:
out
.
debug
<<
"EndStreamPrimitive"
;
break
;
case
EOpAtomicCounterIncrement
:
out
.
debug
<<
"AtomicCounterIncrement"
;
break
;
case
EOpAtomicCounterDecrement
:
out
.
debug
<<
"AtomicCounterDecrement"
;
break
;
case
EOpAtomicCounter
:
out
.
debug
<<
"AtomicCounter"
;
break
;
default
:
out
.
debug
.
message
(
EPrefixError
,
"Bad unary op"
);
default
:
out
.
debug
.
message
(
EPrefixError
,
"Bad unary op"
);
}
}
...
@@ -395,6 +399,15 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
...
@@ -395,6 +399,15 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case
EOpMemoryBarrierShared
:
out
.
debug
<<
"MemoryBarrierShared"
;
break
;
case
EOpMemoryBarrierShared
:
out
.
debug
<<
"MemoryBarrierShared"
;
break
;
case
EOpGroupMemoryBarrier
:
out
.
debug
<<
"GroupMemoryBarrier"
;
break
;
case
EOpGroupMemoryBarrier
:
out
.
debug
<<
"GroupMemoryBarrier"
;
break
;
case
EOpAtomicAdd
:
out
.
debug
<<
"AtomicAdd"
;
break
;
case
EOpAtomicMin
:
out
.
debug
<<
"AtomicMin"
;
break
;
case
EOpAtomicMax
:
out
.
debug
<<
"AtomicMax"
;
break
;
case
EOpAtomicAnd
:
out
.
debug
<<
"AtomicAnd"
;
break
;
case
EOpAtomicOr
:
out
.
debug
<<
"AtomicOr"
;
break
;
case
EOpAtomicXor
:
out
.
debug
<<
"AtomicXor"
;
break
;
case
EOpAtomicExchange
:
out
.
debug
<<
"AtomicExchange"
;
break
;
case
EOpAtomicCompSwap
:
out
.
debug
<<
"AtomicCompSwap"
;
break
;
case
EImageQuerySize
:
out
.
debug
<<
"imageQuerySize"
;
break
;
case
EImageQuerySize
:
out
.
debug
<<
"imageQuerySize"
;
break
;
case
EImageQuerySamples
:
out
.
debug
<<
"imageQuerySamples"
;
break
;
case
EImageQuerySamples
:
out
.
debug
<<
"imageQuerySamples"
;
break
;
case
EImageLoad
:
out
.
debug
<<
"imageLoad"
;
break
;
case
EImageLoad
:
out
.
debug
<<
"imageLoad"
;
break
;
...
...
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