Skip to content

instancedArray.element(x).assign() does not chain correctly, always assigns at instanceIndex under WebGL2 fallback #31250

Open
@LastPhoen1x

Description

@LastPhoen1x

Description

As the title says.
In the following fiddle worker 0 should assign element 1, but it assigns element 0 (it's own index) to the storage array.

Either methods don't chain properly or it writes DataTexture at the wrong coordinates.
Is it possible to fix this behaviour?

Reproduction steps

  1. Make instancedArray.
  2. Compute Fn() with 1+ workers that assigns values to this array at indexes other than instanceIndex.
  3. Under WebGL2 values are assigned at instanceIndex instead.

Code

Fn(() => {
        If( instanceIndex.equal(0), () => { //ONLY if instanceIndex is 0
            posArray.element(1).assign(vec3(1, 1, 1)) //assign to element 1 only
        } )
        })().compute(count)

Live example

https://jsfiddle.net/gmcoh3jz/2/

Screenshots

Image

Version

r177

Device

Desktop

Browser

Chrome

OS

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    TSLThree.js Shading Language

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions