Skip to content

bitcast

const bitcast: TgpuComptime<<FromType, ToType>(from, to) => object[FromType][ToType & "bool" | ToType & "f32" | ToType & "f16" | ToType & "i32" | ToType & "u32" | ToType & "u16" | ToType & "vec2f" | ToType & "vec2h" | ToType & "vec2i" | ToType & "vec2u" | ToType & "vec2<bool>" | ToType & "vec3f" | ToType & "vec3h" | ToType & "vec3i" | ToType & "vec3u" | ToType & "vec3<bool>" | ToType & "vec4f" | ToType & "vec4h" | ToType & "vec4i" | ToType & "vec4u" | ToType & "vec4<bool>" | ToType & "mat2x2f" | ToType & "mat3x3f" | ToType & "mat4x4f" | ToType & "struct" | ToType & "array" | ToType & "ptr" | ToType & "atomic" | ToType & "decorated" | ToType & "abstractInt" | ToType & "abstractFloat" | ToType & "void" | ToType & (“texture_1d” | “texture_2d” | “texture_multisampled_2d” | “texture_depth_2d” | “texture_depth_multisampled_2d” | “texture_2d_array” | “texture_depth_2d_array” | … 4 more … | “texture_3d”) | ToType & (“texture_storage_1d” | “texture_storage_2d” | “texture_storage_2d_array” | “texture_storage_3d”) | ToType & "texture_external" | ToType & "sampler" | ToType & "sampler_comparison"]>

Defined in: packages/typegpu/src/std/bitcast.ts:408