-
Notifications
You must be signed in to change notification settings - Fork 984
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
[vulkan] Different behaviour for max_color_attachment_bytes_per_sample in 23.0 #6853
Comments
The limit on Vulkan is currently static since there isn't a limit that Vulkan exposes for this but as the comment says we could probably increase it for non-tiled GPUs. wgpu/wgpu-hal/src/vulkan/adapter.rs Lines 1053 to 1056 in 826db5e
You weren't running into this in v22 because the limit check was missing, it got added in 9619a43. |
Talking with the Dawn devs, they use |
As for your example, there's padding and one bizzare definition making this confusing.
Rgba8UnormSrgb being 8 bytes is the surprising number and stems from metal being metal. You can see the whole table here https://gpuweb.github.io/gpuweb/#texture-format-caps under "Render Target Pixel Byte Cost` |
Awesome, thanks for answer and the resource! |
I have a program that sets the device required limits of
max_color_attachment_bytes_per_sample
to 128 and later creates a pipeline requiring 48 bytes of color attachments.In 22.0 the adapter limits returns 32 bytes but I can request how much I want in the device creation and the pipeline runs fine.
In 23.0 the adapter limits also returns 32 bytes but I can't request 128 in the device required limits. If I request 32 then the pipeline creation fails because the pipeline is asking for 48 bytes while the device only allows for up to 32.
Panics in
adapter.request_device
:Unable to find a suitable GPU adapter!: RequestDeviceError { inner: Core(LimitsExceeded(FailedLimit { name: "max_color_attachment_bytes_per_sample", requested: 128, allowed: 32 })) }
or in
device.create_render_pipeline
:[2025-01-03T21:11:49Z ERROR wgpu_core::device::global] Device::create_render_pipeline error: The total number of bytes per sample in color attachments 48 exceeds the limit 32
My adapter is the same in both cases:
Adapter Vulkan AdapterInfo { name: "NVIDIA GeForce RTX 3080 Ti", vendor: 4318, device: 8712, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "560.94", backend: Vulkan }
on Windows 11.Requesting a dx12 backend gives me 64 bytes available in both versions of wgpu, but, again, let me ask for more in the device if I want. I haven't tried a pipeline requiring more than 64 though.
Which behaviour is correct? Is the adapter limit wrong and device correct as in 22.0, or is it impossible to have a pipeline of more that 32 bytes per sample for my adapter (in which case, what happened before in 22.0?)
On a side note the pipeline that needs 48 bytes has the following layout:
How does it count for 48? I would expect 43, 44 or 52 depending on internal optimizations and alignment, but not 48.
Thanks!
Minimal reproducible code
This project runs fine in 22.0 but crashes in
adapter.request_device
in 23.0 due to the required limits.Dependencies are
or
wgpu = "23.0.0"
to switch version.Log files
v22.0.0.txt
v23.0.0.txt
The text was updated successfully, but these errors were encountered: