Files
UnrealEngine/Engine/Source/ThirdParty/Intel/ISPC/ispc-1.24.0/tests/lit-tests/2333.ispc
2025-05-18 13:04:45 +08:00

25 lines
834 B
Plaintext

// RUN: %{ispc} --target=host --nowrap --nostdlib -O2 %s -o %t.o
#if TARGET_WIDTH == 2
#define INITIALIZER 1,0,
#elif TARGET_WIDTH == 4
#define INITIALIZER 1,0,1,0,
#elif TARGET_WIDTH == 8
#define INITIALIZER 1,0,1,0,1,0,1,0,
#elif TARGET_WIDTH == 16
#define INITIALIZER 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
#elif TARGET_WIDTH == 32
#define INITIALIZER 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
#elif TARGET_WIDTH == 64
#define INITIALIZER 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
#endif
void foo( uniform float dst[], const uniform uint32 baseIndex, const varying float src )
{
static const varying bool mask = { INITIALIZER }; // crashes
if ( mask != 0 )
{
dst[baseIndex+programIndex] = src;
}
}