-
-
Notifications
You must be signed in to change notification settings - Fork 36k
WebGPURenderer: Read-Only and Read-Write Storage Textures Access support in TSL #28531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGPURenderer: Read-Only and Read-Write Storage Textures Access support in TSL #28531
Conversation
|
||
if ( depthSnippet ) { | ||
|
||
return `textureLoad( ${ textureProperty }, ${ uvIndexSnippet }, ${ depthSnippet }, ${ levelSnippet } )`; | ||
|
||
} else if ( accessSnippet ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we detect if it's a StorageTexture
here instead of moving the setAccess() to TextureNode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically since textureLoad
inherits from TextureNode
and not StorageTextureNode
it's not possible.
We need to be able to specify the access in the reading (textureLoad
) via textureLoad( readTex, ivec2( x, y ) ).setAccess( 'read-only' )
that can differ from the writing textureStore( writeTex, uv, value, 'read-write' )
.
Alternative would be to add a 4th argument for textureLoad:
textureLoad( readTex, ivec2( x, y ), null, 'read-only' )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we would extend generateSnippet
to support generateTextureLoad
with access on StorageTextureNode
and keep TextureNode
as it was. This was part of the implementation although not finalized use textureStore
just to read texture if you don't add value
as parameter to assign, for example: textureStore( storageTexture, indexUV )
Fixed with #29881 |
Related issue: #28455
Description
This PR adds support for Read Only and Read/Write Storage Textures access in TSL.
Example:
This contribution is funded by Utsubo