Skip to content

WebGPUAttributes: Improper 4-byte alignment computation. #20441

@pplux

Description

@pplux

I just noticed this:

const size = array.byteLength + ( array.byteLength % 4 ); // ensure 4 byte alignment

This doesn't yield a new size with 4 byte alignment ( for example 5 + (5%4) = 6) Usually you would do

 size = size + (4-size%4);

but again, this is wrong when size is already mod 4 = 0, so probably what you want to use is

size = size + (4-size%4) % 4;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions