mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-28 09:40:21 +01:00
zink: better handle separate shader dsl creation when no bindings exist
this otherwise underflows the array and provides a (probably huge) garbage value for the binding id, which then causes the driver to massively overallocate both the layout and set/pool/buffer the main result of this is that on radv any simple test that should be near-instant takes 2-3 seconds to execute, which somehow nobody noticed Fixes:e3b746e3a3("zink: use GPL to handle (simple) separate shader objects") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24501> (cherry picked from commit652e87bc5d)
This commit is contained in:
parent
b5330ce1d4
commit
80f1e28d56
2 changed files with 10 additions and 4 deletions
|
|
@ -10514,7 +10514,7 @@
|
|||
"description": "zink: better handle separate shader dsl creation when no bindings exist",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "e3b746e3a31e350e9f0962717e49acba28efee30",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -676,9 +676,15 @@ void
|
|||
zink_descriptor_shader_get_binding_offsets(const struct zink_shader *shader, unsigned *offsets)
|
||||
{
|
||||
offsets[ZINK_DESCRIPTOR_TYPE_UBO] = 0;
|
||||
offsets[ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW] = shader->bindings[ZINK_DESCRIPTOR_TYPE_UBO][shader->num_bindings[ZINK_DESCRIPTOR_TYPE_UBO] - 1].binding + 1;
|
||||
offsets[ZINK_DESCRIPTOR_TYPE_SSBO] = offsets[ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW] + shader->bindings[ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW][shader->num_bindings[ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW] - 1].binding + 1;
|
||||
offsets[ZINK_DESCRIPTOR_TYPE_IMAGE] = offsets[ZINK_DESCRIPTOR_TYPE_SSBO] + shader->bindings[ZINK_DESCRIPTOR_TYPE_SSBO][shader->num_bindings[ZINK_DESCRIPTOR_TYPE_SSBO] - 1].binding + 1;
|
||||
offsets[ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW] = (shader->num_bindings[ZINK_DESCRIPTOR_TYPE_UBO] ?
|
||||
shader->bindings[ZINK_DESCRIPTOR_TYPE_UBO][shader->num_bindings[ZINK_DESCRIPTOR_TYPE_UBO] - 1].binding + 1 :
|
||||
1);
|
||||
offsets[ZINK_DESCRIPTOR_TYPE_SSBO] = offsets[ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW] + (shader->num_bindings[ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW] ?
|
||||
shader->bindings[ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW][shader->num_bindings[ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW] - 1].binding + 1 :
|
||||
1);
|
||||
offsets[ZINK_DESCRIPTOR_TYPE_IMAGE] = offsets[ZINK_DESCRIPTOR_TYPE_SSBO] + (shader->num_bindings[ZINK_DESCRIPTOR_TYPE_SSBO] ?
|
||||
shader->bindings[ZINK_DESCRIPTOR_TYPE_SSBO][shader->num_bindings[ZINK_DESCRIPTOR_TYPE_SSBO] - 1].binding + 1 :
|
||||
1);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue