Skip to content

Difference between Float32Array::new().subarray and Float32Array::view() #1615

Closed
@dakom

Description

@dakom

Summary

The docs show Float32Array::view() as unsafe while the webgl example does not use this function - rather it uses a combo of Float32Array::new() and Float32Array::subarray

Is there a performance tradeoff happening with this approach, that would be gained by switching to view() ?

Additional Details

If we are always able to get a view into Float32Array, without really allocating, I wonder if we actually gain from bufferSubData() ? (e.g. https://docs.rs/web-sys/0.3.7/web_sys/struct.WebGl2RenderingContext.html#method.buffer_sub_data_with_i32_and_array_buffer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions