Skip to content
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

Refactor texture builtin for 0 vert/frag storage bufs/tex. #4090

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

greggman
Copy link
Contributor

Update textureLoad and textureStore to handle the case where the device supports 0 storage buffers in fragment and vertex stages.

Refactor texture.ts copyBufferToTextureViaRender so it doesn't use a storage buffer. Instead we use a r32float/r32sint/r32uint 1024x??? texture and treat it as a 1d array.

@greggman greggman force-pushed the zero-sbstfsvs-more branch 2 times, most recently from a01aef1 to 144be73 Compare December 14, 2024 03:31
@greggman greggman requested a review from shrekshao December 14, 2024 03:31
Copy link
Contributor

@shrekshao shrekshao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comments

);
t.skipIf(
stage === 'v' && !(t.device.limits.maxStorageTexturesInVertexStage! > 0),
'device does not support storage textures in fragment shaders'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'fragment shaders' -> 'vertex shaders'

);
this.skipIf(
stage === 'vertex' && !(this.device.limits.maxStorageTexturesInVertexStage! > 0),
'device does not support storage textures in fragment shaders'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'fragment shaders' -> 'vertex shaders'

Update textureLoad and textureStore to handle the case where
the device supports 0 storage buffers in fragment and vertex
stages.

Refactor texture.ts copyBufferToTextureViaRender so it doesn't
use a storage buffer. Instead we use a r32float/r32sint/r32uint
1024x??? texture and treat it as a 1d array.
@greggman greggman enabled auto-merge (squash) December 17, 2024 00:37
@greggman greggman merged commit b1d51e4 into gpuweb:main Dec 17, 2024
1 check passed
@greggman greggman deleted the zero-sbstfsvs-more branch December 17, 2024 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants