Ignore maxFragmentCombinedOutputResources for Mesa's Honeykrisp driver#9393
Ignore maxFragmentCombinedOutputResources for Mesa's Honeykrisp driver#9393im-0 wants to merge 1 commit intogfx-rs:trunkfrom
Conversation
7864729 to
a7e6095
Compare
|
Created new issue in Mesa: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15249 |
cwfitzgerald
left a comment
There was a problem hiding this comment.
LGTM minus some nits, this is a mesa bug, but we will need to ignore it on older driver versions anyway. Per the upstream bug we should also ignore it on mvk,
You mean nvk? Existing code already catches that by vendor_id == crate::auxil::db::nvidia::VENDOR. And now, when I am thinking about it, this feels like wrong thing to do. maxFragmentCombinedOutputResources is reported by driver, but there are multiple independent driver implementations for at least NV, AMD and Intel GPUs. |
For reference, I just tested on NVK and #9391 does not reproduce (but it reproduce as expected on Honeykrisp) EDIT: Seems that I missed the vendorID ignore... this should really match on the driver ID and not the vendorID. |
Currently, many wgpu apps that request the device with Limits::defaults() fail to start on Asahi Linux with following error message: Limit 'max_color_attachments' value 8 is better than allowed 5 This includes wgpu's own `wgpu-example-02-hello-window`. Value of '5' looked weirdly non-power-of-two and thus hightly sus, so I tried to investigate where exactly wgpu gets it. It looks like this was recently added by f06431f: new code divides maxFragmentCombinedOutputResources by 3 for all GPU vendors except of those who produce known to be wrong maxFragmentCombinedOutputResources. I am not 100% sure that Honeykrisp driver should also be exempt from this, but glxinfo reports GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES=248 on the same Apple M2 Max laptop with Asahi's OpenGL driver. If I understand correctly, GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES is a closest analog for maxFragmentCombinedOutputResources. It seems that `max_combined_shader_output_resources` is never set by OpenGL driver[1] and instead calculated by adding underlying limits by some "defaults" handling code. Also, as the same wgpu allows the same limits just fine on macOS with Metal backend on the same hardware, underlying hardware seems to support those limits. If you are interested, maxFragmentCombinedOutputResources=16 for Honeykrisp was added by initial commit[2] and never changed since. [1] https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/src/gallium/drivers/asahi [2] https://gitlab.freedesktop.org/mesa/mesa/-/commit/5bc828481630147575348b66677edaade9e891e6#line_ed3b525e6_A660 Fixes gfx-rs#9391
a7e6095 to
ba5e7b3
Compare
Connections
Fixes #9391
Description
Currently, many wgpu apps that request the device with Limits::defaults() fail to start on Asahi Linux with following error message:
This includes wgpu's own
wgpu-example-02-hello-window.Value of '5' looked weirdly non-power-of-two and thus hightly sus, so I tried to investigate where exactly wgpu gets it. It looks like this was recently added by f06431f: new code divides maxFragmentCombinedOutputResources by 3 for all GPU vendors except of those who produce known to be wrong maxFragmentCombinedOutputResources.
I am not 100% sure that Honeykrisp driver should also be exempt from this, but glxinfo reports GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES=248 on the same Apple M2 Max laptop with Asahi's OpenGL driver. If I understand correctly, GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES is a closest analog for maxFragmentCombinedOutputResources. It seems that
max_combined_shader_output_resourcesis never set by OpenGL driver[1] and instead calculated by adding underlying limits by some "defaults" handling code. Also, as the same wgpu allows the same limits just fine on macOS with Metal backend on the same hardware, underlying hardware seems to support those limits.If you are interested, maxFragmentCombinedOutputResources=16 for Honeykrisp was added by initial commit[2] and never changed since.
[1] https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/src/gallium/drivers/asahi
[2] https://gitlab.freedesktop.org/mesa/mesa/-/commit/5bc828481630147575348b66677edaade9e891e6#line_ed3b525e6_A660
Testing
No idea about what is the right way to test this. I just ran
cargo xtask testbefore and after the patch.Checklist
cargo fmt.taplo format.cargo clippy --tests.cargo xtask testto run tests. Same amount of failed tests with and without this patch (llvmpipe seems unrelated):CHANGELOG.mdentry.