mirror of
https://github.com/libretro/glslang.git
synced 2024-11-27 09:51:24 +00:00
Front-end atomics: Finish adding atomic built-in functions (non-image) into the AST.
This commit is contained in:
parent
d1a6846ba2
commit
917ec4ac8c
@ -187,7 +187,7 @@ ERROR: node is still EOpNull!
|
||||
0:123 'c' (in highp atomic_uint)
|
||||
0:125 Sequence
|
||||
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:128 Function Definition: func2(au1; (global highp uint)
|
||||
0:128 Function Parameters:
|
||||
@ -196,7 +196,7 @@ ERROR: node is still EOpNull!
|
||||
0:130 Branch: Return with expression
|
||||
0:130 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
|
||||
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:134 Function Definition: mainAC( (global void)
|
||||
0:134 Function Parameters:
|
||||
@ -204,9 +204,9 @@ ERROR: node is still EOpNull!
|
||||
0:137 Sequence
|
||||
0:137 move second child to first child (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: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:146 Function Definition: opac( (global void)
|
||||
0:146 Function Parameters:
|
||||
@ -227,26 +227,26 @@ ERROR: node is still EOpNull!
|
||||
0:159 Sequence
|
||||
0:159 move second child to first child (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 Constant:
|
||||
0:159 3 (const int)
|
||||
0:160 Sequence
|
||||
0:160 move second child to first child (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 Constant:
|
||||
0:160 7 (const uint)
|
||||
0:161 move second child to first child (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 Constant:
|
||||
0:161 4 (const int)
|
||||
0:162 move second child to first child (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 Constant:
|
||||
0:162 10 (const uint)
|
||||
@ -599,7 +599,7 @@ ERROR: node is still EOpNull!
|
||||
0:123 'c' (in highp atomic_uint)
|
||||
0:125 Sequence
|
||||
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:128 Function Definition: func2(au1; (global highp uint)
|
||||
0:128 Function Parameters:
|
||||
@ -608,7 +608,7 @@ ERROR: node is still EOpNull!
|
||||
0:130 Branch: Return with expression
|
||||
0:130 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint)
|
||||
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:134 Function Definition: mainAC( (global void)
|
||||
0:134 Function Parameters:
|
||||
@ -616,9 +616,9 @@ ERROR: node is still EOpNull!
|
||||
0:137 Sequence
|
||||
0:137 move second child to first child (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: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:146 Function Definition: opac( (global void)
|
||||
0:146 Function Parameters:
|
||||
@ -639,26 +639,26 @@ ERROR: node is still EOpNull!
|
||||
0:159 Sequence
|
||||
0:159 move second child to first child (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 Constant:
|
||||
0:159 3 (const int)
|
||||
0:160 Sequence
|
||||
0:160 move second child to first child (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 Constant:
|
||||
0:160 7 (const uint)
|
||||
0:161 move second child to first child (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 Constant:
|
||||
0:161 4 (const int)
|
||||
0:162 move second child to first child (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 Constant:
|
||||
0:162 10 (const uint)
|
||||
|
@ -28,7 +28,7 @@ ERROR: node is still EOpNull!
|
||||
0:5 'c' (in atomic_uint)
|
||||
0:7 Sequence
|
||||
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:10 Function Definition: func2(au1; (global uint)
|
||||
0:10 Function Parameters:
|
||||
@ -37,7 +37,7 @@ ERROR: node is still EOpNull!
|
||||
0:12 Branch: Return with expression
|
||||
0:12 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
|
||||
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:16 Function Definition: main( (global void)
|
||||
0:16 Function Parameters:
|
||||
@ -45,9 +45,9 @@ ERROR: node is still EOpNull!
|
||||
0:19 Sequence
|
||||
0:19 move second child to first child (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:20 Function Call: atomicCounterDecrement(au1; (global uint)
|
||||
0:20 AtomicCounterDecrement (global uint)
|
||||
0:20 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
|
||||
0:26 Function Definition: opac( (global void)
|
||||
0:26 Function Parameters:
|
||||
@ -91,7 +91,7 @@ ERROR: node is still EOpNull!
|
||||
0:5 'c' (in atomic_uint)
|
||||
0:7 Sequence
|
||||
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:10 Function Definition: func2(au1; (global uint)
|
||||
0:10 Function Parameters:
|
||||
@ -100,7 +100,7 @@ ERROR: node is still EOpNull!
|
||||
0:12 Branch: Return with expression
|
||||
0:12 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
|
||||
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:16 Function Definition: main( (global void)
|
||||
0:16 Function Parameters:
|
||||
@ -108,9 +108,9 @@ ERROR: node is still EOpNull!
|
||||
0:19 Sequence
|
||||
0:19 move second child to first child (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:20 Function Call: atomicCounterDecrement(au1; (global uint)
|
||||
0:20 AtomicCounterDecrement (global uint)
|
||||
0:20 'counter' (layout(binding=0 offset=0 ) uniform atomic_uint)
|
||||
0:26 Function Definition: opac( (global void)
|
||||
0:26 Function Parameters:
|
||||
|
@ -234,7 +234,7 @@ enum TOperator {
|
||||
EOpMemoryBarrierShared, // compute only
|
||||
EOpGroupMemoryBarrier, // compute only
|
||||
|
||||
EOpAtomicAdd, // TODO: AST functionality: hook these up
|
||||
EOpAtomicAdd,
|
||||
EOpAtomicMin,
|
||||
EOpAtomicMax,
|
||||
EOpAtomicAnd,
|
||||
@ -243,6 +243,10 @@ enum TOperator {
|
||||
EOpAtomicExchange,
|
||||
EOpAtomicCompSwap,
|
||||
|
||||
EOpAtomicCounterIncrement,
|
||||
EOpAtomicCounterDecrement,
|
||||
EOpAtomicCounter,
|
||||
|
||||
EOpAny,
|
||||
EOpAll,
|
||||
|
||||
|
@ -3133,6 +3133,19 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
|
||||
symbolTable.relateToOperator("memoryBarrierBuffer", EOpMemoryBarrierBuffer);
|
||||
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) {
|
||||
symbolTable.relateToOperator("imageQuerySize", EImageQuerySize);
|
||||
symbolTable.relateToOperator("imageQuerySamples", EImageQuerySamples);
|
||||
|
@ -289,6 +289,10 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
||||
case EOpEmitStreamVertex: out.debug << "EmitStreamVertex"; 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");
|
||||
}
|
||||
|
||||
@ -395,6 +399,15 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpMemoryBarrierShared: out.debug << "MemoryBarrierShared"; 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 EImageQuerySamples: out.debug << "imageQuerySamples"; break;
|
||||
case EImageLoad: out.debug << "imageLoad"; break;
|
||||
|
Loading…
Reference in New Issue
Block a user