Function setIntrinsicsToView

  • Set which intrinsic types to make views for.

    Example:

    Given a an array of intrinsics like this array<vec3, 200>

    The default is to create a single Float32Array(4 * 200) because creating 200 Float32Array views is not usually what you want.

    If you do want individual views then you'd call setIntrinsicsToView(['vec3f']) and now you get an array of 200 Float32Arrays.

    Note: setIntrinsicsToView always sets ALL types. The list you pass it is the types you want views created for, all other types will be reset to do the default. In other words

    setIntrinsicsToView(['vec3f'])
    setIntrinsicsToView(['vec2f'])

    Only vec2f will have views created. vec3f has been reset to the default by the second call

    You can pass in true as the 2nd parameter to make it set which types to flatten and all others will be set to have views created. For example to expand all types would be setIntrinsicsToView([], true). To expand all except f32 would be setIntrinsicsToView(['f32'], true).

    To reset all types to the default call it with no arguments

    Parameters

    • types: readonly ("i32" | "u32" | "f32" | "f16" | "vec2f" | "vec2i" | "vec2u" | "vec2h" | "vec3i" | "vec3u" | "vec3f" | "vec3h" | "vec4i" | "vec4u" | "vec4f" | "vec4h" | "mat2x2f" | "mat2x2h" | "mat3x2f" | "mat3x2h" | "mat4x2f" | "mat4x2h" | "mat2x3f" | "mat2x3h" | "mat3x3f" | "mat3x3h" | "mat4x3f" | "mat4x3h" | "mat2x4f" | "mat2x4h" | "mat3x4f" | "mat3x4h" | "mat4x4f" | "mat4x4h" | "bool" | "atomic<i32>" | "atomic<u32>" | "vec2<i32>" | "vec2<u32>" | "vec2<f32>" | "vec2<f16>" | "vec3<i32>" | "vec3<u32>" | "vec3<f32>" | "vec3<f16>" | "vec4<i32>" | "vec4<u32>" | "vec4<f32>" | "vec4<f16>" | "mat2x2<f32>" | "mat2x2<f16>" | "mat3x2<f32>" | "mat3x2<f16>" | "mat4x2<f32>" | "mat4x2<f16>" | "mat2x3<f32>" | "mat2x3<f16>" | "mat3x3<f32>" | "mat3x3<f16>" | "mat4x3<f32>" | "mat4x3<f16>" | "mat2x4<f32>" | "mat2x4<f16>" | "mat3x4<f32>" | "mat3x4<f16>" | "mat4x4<f32>" | "mat4x4<f16>")[] = []

      array of types to make views for

    • Optional flatten: boolean

      whether to flatten or expand the specified types.

    Returns void

Generated using TypeDoc