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

(GraphicsAPI) Use spec consts to change shader local work group size #25

Open
cfnptr opened this issue Dec 29, 2023 · 1 comment
Open
Labels
improvement Existing feature improvement

Comments

@cfnptr
Copy link
Owner

cfnptr commented Dec 29, 2023

We can optimize shaders for a different thread warp sizes on Nvidia, AMD and other GPUs.

https://www.reddit.com/r/vulkan/comments/cabask/set_localsize_dynamically/

Workgroup size is local size, they're the same thing.

You set it "dynamically" via specialization constants. In your GLSL, declare instead

layout(local_size_x_id = 0, local_size_y = 1, local_size_z = 1)

then on pipeline creation, specify the desired value for spec constant location 0. This does mean that, > yes, you have to rebuild your pipeline every time you change the values.

@cfnptr cfnptr added the improvement Existing feature improvement label Dec 29, 2023
@cfnptr
Copy link
Owner Author

cfnptr commented Dec 5, 2024

Also use VkPhysicalDeviceSubgroupProperties.subgroupSize to detect the best local work group size.

@cfnptr cfnptr added this to the First beta version (v0.1.0) milestone Dec 28, 2024
@cfnptr cfnptr changed the title Use spec consts to change shader local work group size (GraphicsAPI) Use spec consts to change shader local work group size Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Existing feature improvement
Projects
None yet
Development

No branches or pull requests

1 participant