_pdep_u32 in GLSL / HLSL / SPIR-V

318 views Asked by At

I need to interleave* the bits of three unsigned integers in a GLSL program that will be compiled to SPIR-V. In C, I would use the intrinsic _pdep_u32 but I can't find something like that in the OpenGL reference. Does it exist with some other name? Alternatively, does it exist in HLSL or in raw SPIR-V? I am aware that there is a tool for converting LLVM IR to SPIR-V. Is it possible to use it to generate _pdep_u32-equivalent bytecode? Otherwise, can this behavior be implemented in some other way that is also very fast?

*That is, the bits from the 32-bit integers A, B and C must appear in the order ABCABC...etc

0

There are 0 answers