From 91755300ece3a67194270db636e6e8c3252fa8f7 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Sun, 7 Feb 2021 22:01:41 +0100 Subject: [PATCH] st/nine: Set default dynamic_texture_workaround to true Now the texture virtual memory usage is less of a problem, we can use this workaround permanently. In the spirit of the API it's certainly not the proper way of implementing DYNAMIC textures (it seems they are ok to have hidden copies in driver managed memory, but not have virtual addressing space reduced), but it makes sense for us, both performance wise, and to avoid bugs. Signed-off-by: Axel Davy Part-of: --- src/gallium/frontends/nine/surface9.c | 3 ++- src/gallium/frontends/nine/volume9.c | 3 +-- src/gallium/targets/d3dadapter9/drm.c | 2 +- src/util/00-mesa-defaults.conf | 5 ----- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/gallium/frontends/nine/surface9.c b/src/gallium/frontends/nine/surface9.c index eb7183fd07a..e8479b8fb9e 100644 --- a/src/gallium/frontends/nine/surface9.c +++ b/src/gallium/frontends/nine/surface9.c @@ -149,7 +149,8 @@ NineSurface9_ctor( struct NineSurface9 *This, TRUE); if (This->base.info.format != This->format_internal || /* DYNAMIC Textures requires same stride as ram buffers. - * Do not use workaround by default as it eats more virtual space */ + * The workaround stores a copy in RAM for locks. It eats more virtual space, + * but that is compensated by the use of shmem */ (pParams->device->workarounds.dynamic_texture_workaround && pDesc->Pool == D3DPOOL_DEFAULT && pDesc->Usage & D3DUSAGE_DYNAMIC)) { This->data_internal = nine_allocate(pParams->device->allocator, diff --git a/src/gallium/frontends/nine/volume9.c b/src/gallium/frontends/nine/volume9.c index e1c16ff77f3..7d0b8c86a83 100644 --- a/src/gallium/frontends/nine/volume9.c +++ b/src/gallium/frontends/nine/volume9.c @@ -119,8 +119,7 @@ NineVolume9_ctor( struct NineVolume9 *This, This->info.bind, FALSE, TRUE); if (This->info.format != This->format_internal || - /* DYNAMIC Textures requires same stride as ram buffers. - * Do not use workaround by default as it eats more virtual space */ + /* See surface9.c */ (pParams->device->workarounds.dynamic_texture_workaround && pDesc->Pool == D3DPOOL_DEFAULT && pDesc->Usage & D3DUSAGE_DYNAMIC)) { This->stride_internal = nine_format_get_stride(This->format_internal, diff --git a/src/gallium/targets/d3dadapter9/drm.c b/src/gallium/targets/d3dadapter9/drm.c index 4967b06c0e8..c6df2973b7d 100644 --- a/src/gallium/targets/d3dadapter9/drm.c +++ b/src/gallium/targets/d3dadapter9/drm.c @@ -58,7 +58,7 @@ const driOptionDescription __driConfigOptionsNine[] = { DRI_CONF_NINE_ALLOWDISCARDDELAYEDRELEASE(true) DRI_CONF_NINE_TEARFREEDISCARD(false) DRI_CONF_NINE_CSMT(-1) - DRI_CONF_NINE_DYNAMICTEXTUREWORKAROUND(false) + DRI_CONF_NINE_DYNAMICTEXTUREWORKAROUND(true) DRI_CONF_NINE_SHADERINLINECONSTANTS(false) DRI_CONF_NINE_SHMEM_LIMIT() DRI_CONF_SECTION_END diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf index ec8b225dec8..f959461fe08 100644 --- a/src/util/00-mesa-defaults.conf +++ b/src/util/00-mesa-defaults.conf @@ -612,11 +612,6 @@ TODO: document the other workarounds.