Skip to content

GPUQueue.writeBuffer size argument inconsistent with web API #31212

@justin-cotarla

Description

@justin-cotarla

Version: Deno 2.5.6

According to MDN:

[size] is a number of elements if data is a TypedArray, and a number of bytes if not. If omitted, size will be equal to the overall size of data, minus dataOffset.

When passing a Float32Array to writebuffer however, Deno does not interpret the it to be a TypedArray and therefore expects size to be a number of bytes and not a number of elements in the array.

This is inconsistent with what would happen if the same code were run in the Node or Browser contexts.

As far as I can tell this isn’t an intentional design feature, I don’t see any mention of this in the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions