Skip to content

[Fix] Return correct typed array from texture.read() on WebGPU platform#8251

Merged
mvaligursky merged 1 commit intomainfrom
mv-webgpu-texture-read-type-fix
Dec 15, 2025
Merged

[Fix] Return correct typed array from texture.read() on WebGPU platform#8251
mvaligursky merged 1 commit intomainfrom
mv-webgpu-texture-read-type-fix

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Dec 15, 2025

Overview

  • Fixed WebgpuTexture.read() to return the correctly-typed array based on texture format, matching the WebGL implementation behavior.
  • Return Float32Array for float textures, Uint32Array for uint textures, etc. instead of always returning Uint8Array
  • Optimize memory usage by writing directly to user-provided buffer during row depadding, avoiding an intermediate allocation and copy

@mvaligursky mvaligursky merged commit cdceba5 into main Dec 15, 2025
7 checks passed
@mvaligursky mvaligursky deleted the mv-webgpu-texture-read-type-fix branch December 15, 2025 11:52
mvaligursky added a commit that referenced this pull request Dec 19, 2025
…rm (#8251)

Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants