Skip to content

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Dec 22, 2025

Fixes #7872

Adds support for binding specific mip levels and array layers of textures in compute shaders via a new TextureView class.

Features

  • New TextureView class representing a view into a subset of a texture (WebGPU only)
  • Texture.getView() factory method for creating views
  • Support for specifying baseMipLevel, mipLevelCount, baseArrayLayer, and arrayLayerCount

Usage

// Create views for specific mip levels
const mip0View = texture.getView(0);
const mip1View = texture.getView(1);

// Use with compute shader (e.g., HZB generation)
compute.setParameter('srcTexture', mip0View);
compute.setParameter('destTexture', mip1View);

@mvaligursky mvaligursky self-assigned this Dec 22, 2025
@mvaligursky mvaligursky added enhancement Request for a new feature area: graphics Graphics related issue labels Dec 22, 2025
@mvaligursky mvaligursky requested a review from a team December 22, 2025 13:04
@mvaligursky mvaligursky merged commit 2c7f2c4 into main Dec 24, 2025
7 checks passed
@mvaligursky mvaligursky deleted the mv-texture-view branch December 24, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue enhancement Request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Reading and Writing to texture mip levels in Compute Shaders

3 participants