Hello,
I was wondering if multidimensional __constant__
arrays (similar like below) would be possible in CUDA and OptiX:
__constant__ float3 samples[][] =
{
{ {-1.f, -1.f, -1.f}, {0.f, 0.f, 0.f}, {1.f, 1.f, 1.f} },
{ {-1.f, -1.f, -1.f}, {0.f, 0.f, 0.f}, {1.f, 1.f, 1.f} },
{ {-1.f, -1.f, -1.f}, {0.f, 0.f, 0.f}, {1.f, 1.f, 1.f} },
{ {-1.f, -1.f, -1.f}, {0.f, 0.f, 0.f}, {1.f, 1.f, 1.f} },
{ {-1.f, -1.f, -1.f}, {0.f, 0.f, 0.f}, {1.f, 1.f, 1.f} }
};
So basically an array containing 5 arrays of 3 float3 vectors. That mentioned syntax however, fails with
error : an array may not have elements of this type
So, I’m not sure if it’s a matter of syntax or if it’s not possible in general.
Thank you and kind regards,
Markus