samplevec = (float4)(packed_samples.s1); should work
Awesome, thanks! That really makes the code more compact and readable.
Do you know that
float4 val = (float4)(1.0f)
replicates the scalar across all the elements so
val = (1.0f,1.0f,1.0f,1.0f)
, don't you? There's no need to force the
val = float4(1.0f,1.0f,1.0f,1.0f),
val = (float4)(1.0f) is equivalent according to the OpenCL spec.