Skip to content

WebGPURenderer: StorageTexture compute writes not visible to RenderPipeline texture() bindings in same frame #33795

Description

@lyonsno

Description

When writing to a StorageTexture via renderer.compute() and reading it back through a texture() node in a RenderPipeline output graph, the render pipeline sees stale data — not the current frame's compute output.

Reproduction

const storageTexture = new THREE.StorageTexture( 512, 512 );

const computeFn = Fn( ( { storageTexture } ) => {
    const px = instanceIndex.mod( 512 );
    const py = instanceIndex.div( 512 );
    const v = float( px ).div( 512.0 );
    textureStore( storageTexture, uvec2( px, py ), vec4( v, v, v, 1 ) ).toWriteOnly();
} );

const computeNode = computeFn( { storageTexture } ).compute( 512 * 512 );

const renderPipeline = new THREE.RenderPipeline( renderer );
renderPipeline.outputNode = texture( storageTexture );

function animate() {
    renderer.compute( computeNode );
    renderPipeline.render();
}

Expected behavior

texture( storageTexture ) in the render pipeline should reflect the current frame's renderer.compute() writes.

Observed behavior

The render pipeline displays the StorageTexture's initial state (black). The compute writes are correct — wrapping with convertToTexture() produces the expected output.

Workaround

convertToTexture( texture( storageTexture ) ) forces a quad render that reads the compute output correctly. Adds one fullscreen blit.

Platform

  • Three.js: dev branch (current)
  • Browser: Chrome 130+, macOS, WebGPU backend
  • OS: macOS 15.5, Apple M4 Max

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions