Skip to content

Commit 4038a27

Browse files
Fix up automagic shared memory size determination
1 parent 9774305 commit 4038a27

19 files changed

+252
-121
lines changed
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
11
#include "shaderCommon.glsl"
22

3-
4-
5-
// TODO: test the fallbacks later
6-
#define _IRR_GLSL_SCRATCH_SHARED_SIZE_DEFINED_ ((_IRR_GLSL_WORKGROUP_SIZE_<<2)+4)
7-
shared uint tmpShared[_IRR_GLSL_SCRATCH_SHARED_SIZE_DEFINED_];
8-
#define _IRR_GLSL_SCRATCH_SHARED_DEFINED_ tmpShared
9-
10-
11-
123
#include "irr/builtin/glsl/workgroup/arithmetic.glsl"

include/irr/builtin/glsl/macros.glsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#define IRR_GLSL_ADD(X,Y) (IRR_GLSL_EVAL(X)+IRR_GLSL_EVAL(Y))
4343
#define IRR_GLSL_SUB(X,Y) (IRR_GLSL_EVAL(X)-IRR_GLSL_EVAL(Y))
4444

45+
// https://github.com/google/shaderc/issues/1155
4546
//#define IRR_GLSL_MAX(X,Y) (((IRR_GLSL_EVAL(X))>(IRR_GLSL_EVAL(Y))) ? (IRR_GLSL_EVAL(X)):(IRR_GLSL_EVAL(Y)))
4647
//#define IRR_GLSL_MIN(X,Y) (((IRR_GLSL_EVAL(X))<(IRR_GLSL_EVAL(Y))) ? (IRR_GLSL_EVAL(X)):(IRR_GLSL_EVAL(Y)))
4748

include/irr/builtin/glsl/subgroup/arithmetic_portability.glsl

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
#define _IRR_BUILTIN_GLSL_SUBGROUP_ARITHMETIC_PORTABILITY_INCLUDED_
33

44

5-
#include <irr/builtin/glsl/limits/numeric.glsl>
6-
#include <irr/builtin/glsl/math/typeless_arithmetic.glsl>
7-
#include <irr/builtin/glsl/subgroup/basic_portability.glsl>
5+
#include <irr/builtin/glsl/subgroup/shared_arithmetic_portability.glsl>
86

97

108
/* TODO: @Hazardu or someone finish the definitions as soon as Nabla can report Vulkan GLSL equivalent caps
@@ -25,8 +23,6 @@
2523
#ifdef GL_KHR_subgroup_arithmetic
2624
2725
28-
#define _IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_SHARED_SIZE_NEEDED_ 0
29-
3026
3127
#define irr_glsl_subgroupAdd subgroupAnd
3228
@@ -112,21 +108,14 @@
112108

113109

114110

115-
#if defined(IRR_GLSL_SUBGROUP_SIZE_IS_CONSTEXPR)
116-
#define _IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_ROUNDED_WG_IMPL (IRR_GLSL_EVAL((_IRR_GLSL_WORKGROUP_SIZE_+irr_glsl_SubgroupSize-1)&(-irr_glsl_SubgroupSize)))
117-
#else
118-
#define _IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_ROUNDED_WG_IMPL (IRR_GLSL_EVAL((_IRR_GLSL_WORKGROUP_SIZE_+irr_glsl_MaxSubgroupSize-1)&(-irr_glsl_MaxSubgroupSize)))
119-
#endif
120-
#define _IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_SHARED_SIZE_NEEDED_ (IRR_GLSL_EVAL(_IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_ROUNDED_WG_IMPL<<1))
121-
122-
123111
#ifdef _IRR_GLSL_SCRATCH_SHARED_DEFINED_
124112
#if IRR_GLSL_LESS(_IRR_GLSL_SCRATCH_SHARED_SIZE_DEFINED_,_IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_SHARED_SIZE_NEEDED_)
125113
#error "Not enough shared memory declared"
126114
#endif
127115
#else
128116
#if IRR_GLSL_GREATER(_IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_SHARED_SIZE_NEEDED_,0)
129117
#define _IRR_GLSL_SCRATCH_SHARED_DEFINED_ irr_glsl_subgroupArithmeticEmulationScratchShared
118+
#define _IRR_GLSL_SCRATCH_SHARED_SIZE_DEFINED_ _IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_SHARED_SIZE_NEEDED_
130119
shared uint _IRR_GLSL_SCRATCH_SHARED_DEFINED_[_IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_SHARED_SIZE_NEEDED_];
131120
#endif
132121
#endif
@@ -160,9 +149,18 @@ uint irr_glsl_subgroup_impl_getSubgroupEmulationMemoryStoreOffset(in uint subgro
160149
}
161150
uint irr_glsl_subgroup_impl_getSubgroupEmulationMemoryStoreOffset(in uint subgroupMemoryStart, in uint pseudoSubgroupInvocation)
162151
{
163-
uint dummy = 0xdeadbeefu; // just so GLSL compilers shut the fuck up
152+
uint dummy;
164153
return irr_glsl_subgroup_impl_getSubgroupEmulationMemoryStoreOffset(subgroupMemoryStart,pseudoSubgroupInvocation,dummy);
165154
}
155+
uint irr_glsl_subgroup_getSubgroupEmulationMemoryStoreOffset(in uint loMask, in uint invocationIndex)
156+
{
157+
return irr_glsl_subgroup_impl_getSubgroupEmulationMemoryStoreOffset(
158+
irr_glsl_subgroup_impl_getSubgroupEmulationMemoryStart(
159+
irr_glsl_subgroup_impl_pseudoSubgroupElectedInvocation(loMask,invocationIndex)
160+
),
161+
irr_glsl_subgroup_impl_pseudoSubgroupInvocation(loMask,invocationIndex)
162+
);
163+
}
166164

167165
#define SUBGROUP_SCRATCH_OFFSETS_AND_MASKS const uint loMask = irr_glsl_SubgroupSize-1u; \
168166
const uint pseudoSubgroupElectedInvocation = irr_glsl_subgroup_impl_pseudoSubgroupElectedInvocation(loMask,gl_LocalInvocationIndex); \

include/irr/builtin/glsl/subgroup/basic_portability.glsl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,23 @@
77
#error "User needs to let us know the size of the workgroup via _IRR_GLSL_WORKGROUP_SIZE_!"
88
#endif
99

10-
#define irr_glsl_MaxWorkgroupSize 1024
10+
11+
#define irr_glsl_MaxWorkgroupSize 2048
12+
1113

1214
#define irr_glsl_MinSubgroupSize 4
1315
#define irr_glsl_MaxSubgroupSize 128
16+
17+
1418
// TODO: define this properly from gl_SubgroupSize and available extensions
1519
#define IRR_GLSL_SUBGROUP_SIZE_IS_CONSTEXPR
1620
#define irr_glsl_SubgroupSize 4
1721

22+
1823
#if IRR_GLSL_EVAL(irr_glsl_SubgroupSize)<IRR_GLSL_EVAL(irr_glsl_MinSubgroupSize)
1924
#error "Something went very wrong when figuring out irr_glsl_SubgroupSize!"
2025
#endif
21-
#define irr_glsl_HalfSubgroupSize (irr_glsl_SubgroupSize>>1u)
26+
#define irr_glsl_HalfSubgroupSize (irr_glsl_SubgroupSize>>1)
27+
2228

2329
#endif
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#ifndef _IRR_BUILTIN_GLSL_SUBGROUP_SHARED_ARITHMETIC_PORTABILITY_INCLUDED_
2+
#define _IRR_BUILTIN_GLSL_SUBGROUP_SHARED_ARITHMETIC_PORTABILITY_INCLUDED_
3+
4+
5+
#include <irr/builtin/glsl/limits/numeric.glsl>
6+
#include <irr/builtin/glsl/math/typeless_arithmetic.glsl>
7+
#include <irr/builtin/glsl/subgroup/basic_portability.glsl>
8+
9+
10+
/* TODO: @Hazardu or someone finish the definitions as soon as Nabla can report Vulkan GLSL equivalent caps
11+
#ifdef GL_KHR_subgroup_basic
12+
13+
14+
#define _IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_SHARED_SIZE_NEEDED_ 0
15+
16+
17+
#else
18+
*/
19+
20+
#if defined(IRR_GLSL_SUBGROUP_SIZE_IS_CONSTEXPR)
21+
#define IRR_GLSL_SUBGROUP_EMULATION_SCRATCH_BOUND(LAST_ITEM) ((((IRR_GLSL_EVAL(LAST_ITEM)&(-irr_glsl_SubgroupSize))<<1)|(IRR_GLSL_EVAL(LAST_ITEM)&irr_glsl_SubgroupSize))+(irr_glsl_SubgroupSize>>1)+1)
22+
#else
23+
#define IRR_GLSL_SUBGROUP_EMULATION_SCRATCH_BOUND(LAST_ITEM) ((IRR_GLSL_EVAL(LAST_ITEM)<<1)+(irr_glsl_MaxSubgroupSize>>1)+1)
24+
#endif
25+
26+
27+
#define _IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_SHARED_SIZE_NEEDED_ IRR_GLSL_EVAL(IRR_GLSL_SUBGROUP_EMULATION_SCRATCH_BOUND(_IRR_GLSL_WORKGROUP_SIZE_-1))
28+
29+
30+
31+
//#endif //GL_KHR_subgroup_arithmetic
32+
33+
34+
#endif

include/irr/builtin/glsl/workgroup/arithmetic.glsl

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,39 @@
22
#define _IRR_BUILTIN_GLSL_WORKGROUP_ARITHMETIC_INCLUDED_
33

44

5+
#include <irr/builtin/glsl/workgroup/shared_arithmetic.glsl>
6+
7+
8+
9+
#ifdef _IRR_GLSL_SCRATCH_SHARED_DEFINED_
10+
#if IRR_GLSL_EVAL(_IRR_GLSL_SCRATCH_SHARED_SIZE_DEFINED_)<IRR_GLSL_EVAL(_IRR_GLSL_WORKGROUP_ARITHMETIC_SHARED_SIZE_NEEDED_)
11+
#error "Not enough shared memory declared"
12+
#endif
13+
#else
14+
#define _IRR_GLSL_SCRATCH_SHARED_DEFINED_ irr_glsl_workgroupArithmeticScratchShared
15+
#define _IRR_GLSL_SCRATCH_SHARED_SIZE_DEFINED_ _IRR_GLSL_WORKGROUP_ARITHMETIC_SHARED_SIZE_NEEDED_
16+
shared uint _IRR_GLSL_SCRATCH_SHARED_DEFINED_[_IRR_GLSL_WORKGROUP_ARITHMETIC_SHARED_SIZE_NEEDED_];
17+
#endif
18+
19+
20+
521
#include <irr/builtin/glsl/workgroup/clustered.glsl>
622

723

24+
825
/*
926
#ifdef GL_KHR_subgroup_arithmetic
1027
11-
12-
// TODO: specialize for constexpr case (also remove the ugly `+4` its just the "number of passes" for the scan hierarchy
13-
#define _IRR_GLSL_WORKGROUP_ARITHMETIC_SHARED_SIZE_NEEDED_ (_IRR_GLSL_WORKGROUP_SIZE_/(irr_glsl_MinSubgroupSize-1u)+4u+irr_glsl_MaxSubgroupSize)
14-
1528
#define CONDITIONAL_BARRIER
1629
17-
1830
#else
1931
*/
20-
21-
// this is always greater than the case with native subgroup stuff, TODO: is it correct for small workgroups?
22-
#define _IRR_GLSL_WORKGROUP_ARITHMETIC_SHARED_SIZE_NEEDED_ (_IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_SHARED_SIZE_NEEDED_)
23-
2432
#define CONDITIONAL_BARRIER barrier();
2533

26-
2734
//#endif
2835

2936

37+
3038
#define DECLARE_OVERLOAD_WITH_BARRIERS(TYPE,FUNC_NAME) TYPE irr_glsl_##FUNC_NAME (in TYPE val) \
3139
{ \
3240
barrier(); \
@@ -36,18 +44,6 @@
3644
}
3745

3846

39-
40-
#ifdef _IRR_GLSL_SCRATCH_SHARED_DEFINED_
41-
#if IRR_GLSL_EVAL(_IRR_GLSL_SCRATCH_SHARED_SIZE_DEFINED_)<IRR_GLSL_EVAL(_IRR_GLSL_WORKGROUP_ARITHMETIC_SHARED_SIZE_NEEDED_)
42-
#error "Not enough shared memory declared for workgroup arithmetic!"
43-
#endif
44-
#else
45-
#define _IRR_GLSL_SCRATCH_SHARED_DEFINED_ irr_glsl_workgroupArithmeticScratchShared
46-
shared uint _IRR_GLSL_SCRATCH_SHARED_DEFINED_[_IRR_GLSL_WORKGROUP_ARITHMETIC_SHARED_SIZE_NEEDED_];
47-
#endif
48-
49-
50-
5147
// reduction
5248
#define IRR_GLSL_WORKGROUP_REDUCE(CONV,INCLUSIVE_SUBGROUP_OP,VALUE,IDENTITY,INVCONV) IRR_GLSL_WORKGROUP_COMMON_IMPL_HEAD(CONV,INCLUSIVE_SUBGROUP_OP,VALUE,IDENTITY,INVCONV,_IRR_GLSL_WORKGROUP_SIZE_,false); \
5349
barrier(); \

include/irr/builtin/glsl/workgroup/ballot.glsl

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
#define _IRR_BUILTIN_GLSL_WORKGROUP_BALLOT_INCLUDED_
33

44

5-
#include <irr/builtin/glsl/subgroup/arithmetic_portability.glsl>
6-
#include <irr/builtin/glsl/workgroup/basic.glsl>
7-
8-
9-
#define irr_glsl_workgroupBallot_impl_getDWORD(IX) (IX>>5)
10-
#define irr_glsl_workgroupBallot_impl_BitfieldDWORDs irr_glsl_workgroupBallot_impl_getDWORD(_IRR_GLSL_WORKGROUP_SIZE_+31)
115

12-
13-
#define _IRR_GLSL_WORKGROUP_BALLOT_SHARED_SIZE_NEEDED_IMPL_ (irr_glsl_workgroupBallot_impl_BitfieldDWORDs+_IRR_GLSL_WORKGROUP_SIZE_)
6+
#include <irr/builtin/glsl/workgroup/shared_ballot.glsl>
147

158

169
/*
1710
#ifdef GL_KHR_subgroup_arithmetic
1811
12+
1913
#define CONDITIONAL_BARRIER
2014
15+
// just do nothing here
16+
#define SUBGROUP_SCRATCH_INITIALIZE(IDENTITY) ;
17+
18+
2119
#else
2220
*/
2321

@@ -28,12 +26,6 @@ If `GL_KHR_subgroup_arithmetic` is not available then these functions require em
2826
`irr_glsl_workgroupOp`s then the workgroup size must not be smaller than half a subgroup but having workgroups smaller than a subgroup is extremely bad practice.
2927
*/
3028

31-
#if IRR_GLSL_GREATER(_IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_SHARED_SIZE_NEEDED_,_IRR_GLSL_WORKGROUP_BALLOT_SHARED_SIZE_NEEDED_IMPL_)
32-
#define _IRR_GLSL_WORKGROUP_BALLOT_SHARED_SIZE_NEEDED_ _IRR_GLSL_SUBGROUP_ARITHMETIC_EMULATION_SHARED_SIZE_NEEDED_
33-
#else
34-
#define _IRR_GLSL_WORKGROUP_BALLOT_SHARED_SIZE_NEEDED_ _IRR_GLSL_WORKGROUP_BALLOT_SHARED_SIZE_NEEDED_IMPL_
35-
#endif
36-
3729
//#endif
3830

3931

@@ -45,12 +37,17 @@ If `GL_KHR_subgroup_arithmetic` is not available then these functions require em
4537
#else
4638
#if IRR_GLSL_GREATER(_IRR_GLSL_WORKGROUP_BALLOT_SHARED_SIZE_NEEDED_,0)
4739
#define _IRR_GLSL_SCRATCH_SHARED_DEFINED_ irr_glsl_workgroupBallotScratchShared
40+
#define _IRR_GLSL_SCRATCH_SHARED_SIZE_DEFINED_ _IRR_GLSL_WORKGROUP_BALLOT_SHARED_SIZE_NEEDED_
4841
shared uint _IRR_GLSL_SCRATCH_SHARED_DEFINED_[_IRR_GLSL_WORKGROUP_BALLOT_SHARED_SIZE_NEEDED_];
4942
#endif
5043
#endif
5144

5245

5346

47+
#include <irr/builtin/glsl/subgroup/arithmetic_portability.glsl>
48+
49+
50+
5451
// puts the result into shared memory at offsets [0,_IRR_GLSL_WORKGROUP_SIZE_/32)
5552
void irr_glsl_workgroupBallot_noBarriers(in bool value)
5653
{
@@ -166,13 +163,8 @@ uint irr_glsl_workgroupBallotFindMSB();
166163
const bool possibleProp = pseudoSubgroupInvocation==loMask; \
167164
const uint subgroupSizeLog2 = findLSB(irr_glsl_SubgroupSize); \
168165
const uint pseudoSubgroupID = (gl_LocalInvocationIndex>>subgroupSizeLog2); \
169-
const uint nextStoreIndex = irr_glsl_subgroup_impl_getSubgroupEmulationMemoryStoreOffset( \
170-
irr_glsl_subgroup_impl_getSubgroupEmulationMemoryStart( \
171-
irr_glsl_subgroup_impl_pseudoSubgroupElectedInvocation(loMask,pseudoSubgroupID) \
172-
), \
173-
irr_glsl_subgroup_impl_pseudoSubgroupInvocation(loMask,pseudoSubgroupID) \
174-
); \
175-
uint scanStoreIndex = (ITEM_COUNT<<1u)+gl_LocalInvocationIndex; \
166+
const uint nextStoreIndex = irr_glsl_subgroup_getSubgroupEmulationMemoryStoreOffset(loMask,pseudoSubgroupID); \
167+
uint scanStoreIndex = irr_glsl_subgroup_getSubgroupEmulationMemoryStoreOffset(loMask,lastInvocation)+gl_LocalInvocationIndex+1u; \
176168
bool participate = gl_LocalInvocationIndex<=lastInvocationInLevel; \
177169
while (lastInvocationInLevel>=irr_glsl_SubgroupSize*irr_glsl_SubgroupSize) \
178170
{ \
@@ -229,15 +221,18 @@ uint irr_glsl_workgroupBallotFindMSB();
229221
if (gl_LocalInvocationIndex<=lastInvocation && pseudoSubgroupID!=0u) \
230222
{ \
231223
const uint higherLevelExclusive = _IRR_GLSL_SCRATCH_SHARED_DEFINED_[scanLoadIndex+currentToHighLevel-1u]; \
232-
firstLevelScan = INVCONV(OP (CONV(higherLevelExclusive),CONV(firstLevelScan))); \
224+
firstLevelScan = INVCONV(OP(CONV(higherLevelExclusive), CONV(firstLevelScan))); \
233225
} \
234226
} \
235227
if (EXCLUSIVE) \
236228
{ \
237-
const uint sharedOffsetOutTheWay = scanStoreIndex+lastInvocationInLevel; \
238-
_IRR_GLSL_SCRATCH_SHARED_DEFINED_[sharedOffsetOutTheWay+1u] = firstLevelScan; \
239-
barrier(); \
240-
return gl_LocalInvocationIndex!=0u ? CONV(_IRR_GLSL_SCRATCH_SHARED_DEFINED_[sharedOffsetOutTheWay]):IDENTITY; \
229+
if (gl_LocalInvocationIndex<lastInvocation) \
230+
_IRR_GLSL_SCRATCH_SHARED_DEFINED_[gl_LocalInvocationIndex+1u] = firstLevelScan; \
231+
barrier(); \
232+
if (gl_LocalInvocationIndex<lastInvocation) \
233+
return gl_LocalInvocationIndex!=0u ? CONV(_IRR_GLSL_SCRATCH_SHARED_DEFINED_[gl_LocalInvocationIndex]):IDENTITY; \
234+
else \
235+
return IDENTITY; \
241236
} \
242237
else \
243238
return CONV(firstLevelScan);
@@ -262,20 +257,28 @@ uint irr_glsl_workgroupBallotScanBitCount_impl_impl(in uint localBitfield)
262257
}
263258
uint irr_glsl_workgroupBallotScanBitCount_impl(in bool exclusive)
264259
{
265-
uint localBitfieldBackup;
266-
if (gl_LocalInvocationIndex<irr_glsl_workgroupBallot_impl_BitfieldDWORDs)
267-
localBitfieldBackup = _IRR_GLSL_SCRATCH_SHARED_DEFINED_[gl_LocalInvocationIndex];
260+
const uint _dword = irr_glsl_workgroupBallot_impl_getDWORD(gl_LocalInvocationIndex);
261+
const uint localBitfield = _IRR_GLSL_SCRATCH_SHARED_DEFINED_[_dword];
268262

269-
// scan hierarchically
270-
uint globalCount = irr_glsl_workgroupBallotScanBitCount_impl_impl(localBitfieldBackup);
271-
272-
// restore
273-
if (gl_LocalInvocationIndex<irr_glsl_workgroupBallot_impl_BitfieldDWORDs)
274-
_IRR_GLSL_SCRATCH_SHARED_DEFINED_[gl_LocalInvocationIndex] = localBitfieldBackup;
275-
barrier();
263+
uint globalCount;
264+
{
265+
uint localBitfieldBackup;
266+
if (gl_LocalInvocationIndex<irr_glsl_workgroupBallot_impl_BitfieldDWORDs)
267+
localBitfieldBackup = _IRR_GLSL_SCRATCH_SHARED_DEFINED_[gl_LocalInvocationIndex];
268+
// scan hierarchically, invocations with `gl_LocalInvocationIndex>=irr_glsl_workgroupBallot_impl_BitfieldDWORDs` will have garbage here
269+
irr_glsl_workgroupBallotScanBitCount_impl_impl(localBitfieldBackup);
270+
// fix it (abuse the fact memory is left over)
271+
globalCount = _dword!=0u ? _IRR_GLSL_SCRATCH_SHARED_DEFINED_[_dword]:0u;
272+
barrier();
273+
274+
// restore
275+
if (gl_LocalInvocationIndex<irr_glsl_workgroupBallot_impl_BitfieldDWORDs)
276+
_IRR_GLSL_SCRATCH_SHARED_DEFINED_[gl_LocalInvocationIndex] = localBitfieldBackup;
277+
barrier();
278+
}
276279

277280
const uint mask = 0xffffffffu>>((exclusive ? 32u:31u)-(gl_LocalInvocationIndex&31u));
278-
return globalCount+bitCount(localBitfieldBackup&mask);
281+
return globalCount+bitCount(localBitfield&mask);
279282
}
280283

281284
#undef CONDITIONAL_BARRIER

include/irr/builtin/glsl/workgroup/basic.glsl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
#ifndef _IRR_BUILTIN_GLSL_WORKGROUP_BASIC_INCLUDED_
22
#define _IRR_BUILTIN_GLSL_WORKGROUP_BASIC_INCLUDED_
33

4-
#include <irr/builtin/glsl/macros.glsl>
5-
#include <irr/builtin/glsl/math/typeless_arithmetic.glsl>
64

5+
#include <irr/builtin/glsl/math/typeless_arithmetic.glsl>
6+
#include <irr/builtin/glsl/subgroup/basic_portability.glsl>
77

8-
#ifndef _IRR_GLSL_WORKGROUP_SIZE_
9-
#error "User needs to let us know the size of the workgroup via _IRR_GLSL_WORKGROUP_SIZE_!"
10-
#endif
11-
128

139
//! all functions must be called in uniform control flow (all workgroup invocations active)
1410
bool irr_glsl_workgroupElect()

0 commit comments

Comments
 (0)