diff options
author | Axel Davy <[email protected]> | 2016-11-19 13:11:15 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-12-20 23:44:21 +0100 |
commit | 59048e75489e6a8d1a75ed6b9c869bd96886f75c (patch) | |
tree | 21dd4a8a69e4e1f43cc0378962f4387d1fb71ef9 /src/gallium | |
parent | 06657fa203a46c37042e87d05d741439857156c7 (diff) |
st/nine: Add new driconf options to control DISCARD behaviour
See the patch for the new controls added.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/nine/adapter9.h | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/swapchain9.c | 4 | ||||
-rw-r--r-- | src/gallium/targets/d3dadapter9/drm.c | 17 |
3 files changed, 21 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/nine/adapter9.h b/src/gallium/state_trackers/nine/adapter9.h index aaf7435fcda..4a71540ab4a 100644 --- a/src/gallium/state_trackers/nine/adapter9.h +++ b/src/gallium/state_trackers/nine/adapter9.h @@ -39,6 +39,8 @@ struct d3dadapter9_context int throttling_value; int vblank_mode; BOOL thread_submit; + BOOL discard_delayed_release; + BOOL tearfree_discard; void (*destroy)( struct d3dadapter9_context *ctx ); }; diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c index 79530f5319e..8a405f2374c 100644 --- a/src/gallium/state_trackers/nine/swapchain9.c +++ b/src/gallium/state_trackers/nine/swapchain9.c @@ -72,8 +72,8 @@ NineSwapChain9_ctor( struct NineSwapChain9 *This, D3DPRESENT_PARAMETERS2 params2; memset(¶ms2, 0, sizeof(D3DPRESENT_PARAMETERS2)); - params2.AllowDISCARDDelayedRelease = TRUE; - params2.TearFreeDISCARD = FALSE; + params2.AllowDISCARDDelayedRelease = This->actx->discard_delayed_release; + params2.TearFreeDISCARD = This->actx->tearfree_discard; ID3DPresent_SetPresentParameters2(pPresent, ¶ms2); } diff --git a/src/gallium/targets/d3dadapter9/drm.c b/src/gallium/targets/d3dadapter9/drm.c index 767a17a55da..e0c2e26c02f 100644 --- a/src/gallium/targets/d3dadapter9/drm.c +++ b/src/gallium/targets/d3dadapter9/drm.c @@ -56,6 +56,8 @@ DRI_CONF_BEGIN DRI_CONF_NINE_OVERRIDEVENDOR(-1) DRI_CONF_NINE_THROTTLE(-2) DRI_CONF_NINE_THREADSUBMIT("false") + DRI_CONF_NINE_ALLOWDISCARDDELAYEDRELEASE("true") + DRI_CONF_NINE_TEARFREEDISCARD("false") DRI_CONF_SECTION_END DRI_CONF_END; @@ -284,6 +286,21 @@ drm_create_adapter( int fd, override_vendorid = driQueryOptioni(&userInitOptions, "override_vendorid"); } + if (driCheckOption(&userInitOptions, "discard_delayed_release", DRI_BOOL)) + ctx->base.discard_delayed_release = driQueryOptionb(&userInitOptions, "discard_delayed_release"); + else + ctx->base.discard_delayed_release = TRUE; + + if (driCheckOption(&userInitOptions, "tearfree_discard", DRI_BOOL)) + ctx->base.tearfree_discard = driQueryOptionb(&userInitOptions, "tearfree_discard"); + else + ctx->base.tearfree_discard = FALSE; + + if (ctx->base.tearfree_discard && !ctx->base.discard_delayed_release) { + ERR("tearfree_discard requires discard_delayed_release\n"); + ctx->base.tearfree_discard = FALSE; + } + driDestroyOptionCache(&userInitOptions); driDestroyOptionInfo(&defaultInitOptions); |