mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 06:47:19 +00:00
[host] dxgi: add option to disable damage-aware copies
This commit is contained in:
parent
cf7d501bc4
commit
c69b19e68f
@ -113,6 +113,13 @@ static void dxgi_initOptions(void)
|
||||
.type = OPTION_TYPE_STRING,
|
||||
.value.x_string = "d3d11",
|
||||
},
|
||||
{
|
||||
.module = "dxgi",
|
||||
.name = "disableDamage",
|
||||
.description = "Do not do damage-aware copies, i.e. always do full frame copies",
|
||||
.type = OPTION_TYPE_BOOL,
|
||||
.value.x_bool = false
|
||||
},
|
||||
{0}
|
||||
};
|
||||
|
||||
@ -143,6 +150,7 @@ static bool dxgi_create(CaptureGetPointerBuffer getPointerBufferFn, CapturePostP
|
||||
|
||||
this->useAcquireLock = option_get_bool("dxgi", "useAcquireLock");
|
||||
this->dwmFlush = option_get_bool("dxgi", "dwmFlush");
|
||||
this->disableDamage = option_get_bool("dxgi", "disableDamage");
|
||||
this->texture = calloc(this->maxTextures, sizeof(*this->texture));
|
||||
this->getPointerBufferFn = getPointerBufferFn;
|
||||
this->postPointerBufferFn = postPointerBufferFn;
|
||||
@ -517,7 +525,8 @@ static bool dxgi_init(void)
|
||||
}
|
||||
|
||||
DEBUG_INFO("Copy backend : %s", this->backend->name);
|
||||
DEBUG_INFO("AcquireLock : %s", this->useAcquireLock ? "enabled" : "disabled");
|
||||
DEBUG_INFO("AcquireLock : %s", this->useAcquireLock ? "enabled" : "disabled");
|
||||
DEBUG_INFO("Damage-aware copy : %s", this->disableDamage ? "disabled" : "enabled" );
|
||||
|
||||
for (int i = 0; i < this->maxTextures; ++i)
|
||||
this->texture[i].texDamageCount = -1;
|
||||
@ -669,6 +678,9 @@ static void computeFrameDamage(Texture * tex)
|
||||
// By default, damage the full frame.
|
||||
tex->damageRectsCount = 0;
|
||||
|
||||
if (this->disableDamage)
|
||||
return;
|
||||
|
||||
const int maxDamageRectsCount = ARRAY_LENGTH(tex->damageRects);
|
||||
|
||||
// Compute dirty rectangles.
|
||||
|
@ -75,6 +75,7 @@ struct DXGIInterface
|
||||
LG_Lock deviceContextLock;
|
||||
bool useAcquireLock;
|
||||
bool dwmFlush;
|
||||
bool disableDamage;
|
||||
D3D_FEATURE_LEVEL featureLevel;
|
||||
IDXGIOutputDuplication * dup;
|
||||
int maxTextures;
|
||||
|
Loading…
Reference in New Issue
Block a user