mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-03 11:17:10 +00:00
[host] dxgi: add option to disable damage-aware copies
This commit is contained in:
parent
cf7d501bc4
commit
c69b19e68f
2 changed files with 14 additions and 1 deletions
|
@ -113,6 +113,13 @@ static void dxgi_initOptions(void)
|
||||||
.type = OPTION_TYPE_STRING,
|
.type = OPTION_TYPE_STRING,
|
||||||
.value.x_string = "d3d11",
|
.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}
|
{0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -143,6 +150,7 @@ static bool dxgi_create(CaptureGetPointerBuffer getPointerBufferFn, CapturePostP
|
||||||
|
|
||||||
this->useAcquireLock = option_get_bool("dxgi", "useAcquireLock");
|
this->useAcquireLock = option_get_bool("dxgi", "useAcquireLock");
|
||||||
this->dwmFlush = option_get_bool("dxgi", "dwmFlush");
|
this->dwmFlush = option_get_bool("dxgi", "dwmFlush");
|
||||||
|
this->disableDamage = option_get_bool("dxgi", "disableDamage");
|
||||||
this->texture = calloc(this->maxTextures, sizeof(*this->texture));
|
this->texture = calloc(this->maxTextures, sizeof(*this->texture));
|
||||||
this->getPointerBufferFn = getPointerBufferFn;
|
this->getPointerBufferFn = getPointerBufferFn;
|
||||||
this->postPointerBufferFn = postPointerBufferFn;
|
this->postPointerBufferFn = postPointerBufferFn;
|
||||||
|
@ -517,7 +525,8 @@ static bool dxgi_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_INFO("Copy backend : %s", this->backend->name);
|
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)
|
for (int i = 0; i < this->maxTextures; ++i)
|
||||||
this->texture[i].texDamageCount = -1;
|
this->texture[i].texDamageCount = -1;
|
||||||
|
@ -669,6 +678,9 @@ static void computeFrameDamage(Texture * tex)
|
||||||
// By default, damage the full frame.
|
// By default, damage the full frame.
|
||||||
tex->damageRectsCount = 0;
|
tex->damageRectsCount = 0;
|
||||||
|
|
||||||
|
if (this->disableDamage)
|
||||||
|
return;
|
||||||
|
|
||||||
const int maxDamageRectsCount = ARRAY_LENGTH(tex->damageRects);
|
const int maxDamageRectsCount = ARRAY_LENGTH(tex->damageRects);
|
||||||
|
|
||||||
// Compute dirty rectangles.
|
// Compute dirty rectangles.
|
||||||
|
|
|
@ -75,6 +75,7 @@ struct DXGIInterface
|
||||||
LG_Lock deviceContextLock;
|
LG_Lock deviceContextLock;
|
||||||
bool useAcquireLock;
|
bool useAcquireLock;
|
||||||
bool dwmFlush;
|
bool dwmFlush;
|
||||||
|
bool disableDamage;
|
||||||
D3D_FEATURE_LEVEL featureLevel;
|
D3D_FEATURE_LEVEL featureLevel;
|
||||||
IDXGIOutputDuplication * dup;
|
IDXGIOutputDuplication * dup;
|
||||||
int maxTextures;
|
int maxTextures;
|
||||||
|
|
Loading…
Reference in a new issue