crocus: don't create staging resources > half aperture

The theory here is that a staging resource will need to be transferred
into or out of a non-staging resource. If the staging resource is too
big for 1/2 aperture threshold, then it the corresponding non-stage
resource will be similiarly sized. This means there's no hope of fitting
both of them in.

This will cause the st blit transfer path to fall back and allow
max-texture-size to pass.

Fixes piglit max-texture-size

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14347>
This commit is contained in:
Dave Airlie
2021-12-30 11:52:32 +10:00
parent d8a38edc48
commit f1c1fcfdce
4 changed files with 12 additions and 4 deletions

View File

@@ -254,6 +254,15 @@ crocus_resource_configure_main(const struct crocus_screen *screen,
if (!isl_surf_init_s(&screen->isl_dev, &res->surf, &init_info))
return false;
/*
* Don't create staging surfaces that will use > half the aperture
* since staging implies you are sending to another resource,
* which there is no way to fit both into aperture.
*/
if (templ->usage == PIPE_USAGE_STAGING)
if (res->surf.size_B > screen->aperture_threshold / 2)
return false;
res->internal_format = templ->format;
return true;