diff options
author | Axel Davy <[email protected]> | 2020-05-08 22:26:07 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-15 15:43:57 +0000 |
commit | d771e0cc60a0aa853c5e1e0df304f970a47ab774 (patch) | |
tree | cf3ad7e83eca56eaebea1a3ab735035e8d17cd10 /src/gallium/frontends/nine | |
parent | 4cf13691beb4237a8a449dd317561066df492842 (diff) |
st/nine: Increase available GPU memory
This patch caps to 4GB the limit of GPU memory accessible
only for 32bits build.
This would deserve some tests on windows, so we might change that
behaviour in the future. For example, it's possible that
GetAvailableTextureMem is capped to 4GB on 64bits build.
We cap to a bit less than 4GB, which might help
https://github.com/iXit/Mesa-3D/issues/323
In addition, increase from 80% to 95% the allocation limit above
which we fail allocating.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
Diffstat (limited to 'src/gallium/frontends/nine')
-rw-r--r-- | src/gallium/frontends/nine/device9.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/frontends/nine/device9.c b/src/gallium/frontends/nine/device9.c index 97223cd8fa5..2634b88a614 100644 --- a/src/gallium/frontends/nine/device9.c +++ b/src/gallium/frontends/nine/device9.c @@ -217,14 +217,15 @@ NineDevice9_ctor( struct NineDevice9 *This, * instance. This is the Win 7 behavior. * Win XP shares this counter across multiple devices. */ This->available_texture_mem = This->screen->get_param(This->screen, PIPE_CAP_VIDEO_MEMORY); - if (This->available_texture_mem < 4096) - This->available_texture_mem <<= 20; - else - This->available_texture_mem = UINT_MAX; - /* We cap texture memory usage to 80% of what is reported free initially + This->available_texture_mem <<= 20; +#ifdef PIPE_ARCH_X86 + /* To prevent overflows for 32bits apps - Not sure about this one */ + This->available_texture_limit = MAX2(This->available_texture_limit, UINT_MAX - (64 << 20)); +#endif + /* We cap texture memory usage to 95% of what is reported free initially * This helps get closer Win behaviour. For example VertexBuffer allocation * still succeeds when texture allocation fails. */ - This->available_texture_limit = This->available_texture_mem * 20LL / 100LL; + This->available_texture_limit = This->available_texture_mem * 5LL / 100LL; /* create implicit swapchains */ This->nswapchains = ID3DPresentGroup_GetMultiheadCount(This->present); |