Array indexing doesn't work there.
I'm yet to setup my CUDA computer, in the meantime this proved to work (tested by Daniel Salazar).
If I found other ways of doing it I get back to that.
{
float3 color = stack_load_float3(stack, icolor_offset);
- if (stack_valid(out_offset))
- stack_store_float(stack, out_offset, color[color_index]);
+ if (stack_valid(out_offset)) {
+ if (color_index == 0)
+ stack_store_float(stack, out_offset, color.x);
+ else if (color_index == 1)
+ stack_store_float(stack, out_offset, color.y);
+ else
+ stack_store_float(stack, out_offset, color.z);
+ }
}
CCL_NAMESPACE_END