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

Simplified BindGroup constructor #6221

Merged
merged 2 commits into from
Apr 3, 2024
Merged

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Apr 3, 2024

  • Simplified constructor of the BindGroup, which is manually specified for Compute shaders, to require a single array instead of up to 4 arrays.
  • Slot allocation is also moved to platform independent level, to make it available and easy to understand to the user.

Before:

new pc.BindGroupFormat(device, [
        // no uniform buffer
    ], [
        new pc.BindTextureFormat('uSceneColorMap', pc.SHADERSTAGE_COMPUTE, undefined, undefined, false)
    ], [
        // no storage textures
    ], [
        new pc.BindStorageBufferFormat('outBuffer', pc.SHADERSTAGE_COMPUTE)
    ])
)

Now:

new pc.BindGroupFormat(device, [
    new pc.BindTextureFormat('uSceneColorMap', pc.SHADERSTAGE_COMPUTE, undefined, undefined, false),
    new pc.BindStorageBufferFormat('outBuffer', pc.SHADERSTAGE_COMPUTE)
])

@mvaligursky mvaligursky self-assigned this Apr 3, 2024
@mvaligursky mvaligursky added area: graphics Graphics related issue enhancement labels Apr 3, 2024
@mvaligursky mvaligursky requested a review from a team April 3, 2024 14:37
@mvaligursky mvaligursky merged commit 563d644 into main Apr 3, 2024
7 checks passed
@mvaligursky mvaligursky deleted the mv-bind-group-constructor branch April 3, 2024 14:43
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants