mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 01:40:08 +01:00
anv: Allocate more push constant space.
Previously we allocated 4kB of push constant space for VS, GS, and PS (for a total of 12kB) no matter what. This works, but doesn't fully utilize the space - we have 16kB or 32kB of space. This makes anv use the same method as brw - divide up the space evenly among all active shader stages. This means HS and DS would get space, if those shader stages existed. In the future, we can probably do better by inspecting how many push constants each shader stage uses, and weight things accordingly. But this is strictly better than the old code, and ideally we'd justify a fancier solution with actual performance data.
This commit is contained in:
parent
3f11517730
commit
3ecd357d81
1 changed files with 11 additions and 5 deletions
|
|
@ -891,11 +891,17 @@ gen7_compute_urb_partition(struct anv_pipeline *pipeline)
|
|||
pipeline->urb.size[MESA_SHADER_TESS_EVAL] = 1;
|
||||
pipeline->urb.entries[MESA_SHADER_TESS_EVAL] = 0;
|
||||
|
||||
pipeline->urb.push_size[MESA_SHADER_VERTEX] = 4;
|
||||
pipeline->urb.push_size[MESA_SHADER_TESS_CTRL] = 0;
|
||||
pipeline->urb.push_size[MESA_SHADER_TESS_EVAL] = 0;
|
||||
pipeline->urb.push_size[MESA_SHADER_GEOMETRY] = 4;
|
||||
pipeline->urb.push_size[MESA_SHADER_FRAGMENT] = 4;
|
||||
const unsigned stages =
|
||||
_mesa_bitcount(pipeline->active_stages & VK_SHADER_STAGE_ALL_GRAPHICS);
|
||||
const unsigned size_per_stage = push_constant_kb / stages;
|
||||
|
||||
for (int i = MESA_SHADER_VERTEX; i < MESA_SHADER_FRAGMENT; i++) {
|
||||
pipeline->urb.push_size[i] =
|
||||
(pipeline->active_stages & (1 << i)) ? size_per_stage : 1;
|
||||
}
|
||||
|
||||
pipeline->urb.push_size[MESA_SHADER_FRAGMENT] =
|
||||
push_constant_kb - size_per_stage * (stages - 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue