[host] d12: fix target for wait fence when effects are active

This commit is contained in:
Geoffrey McRae 2024-02-28 12:31:56 +11:00
parent a894348530
commit 2d41cda640

View File

@ -63,6 +63,7 @@ struct D12Interface
D12Backend * backend; D12Backend * backend;
Vector effects; Vector effects;
bool effectsActive;
// capture format tracking // capture format tracking
D12FrameFormat captureFormat; D12FrameFormat captureFormat;
@ -531,6 +532,7 @@ static CaptureResult d12_waitFrame(unsigned frameBufferIndex,
{ {
D12FrameFormat dstFormat = this->dstFormat; D12FrameFormat dstFormat = this->dstFormat;
this->captureFormat = srcFormat; this->captureFormat = srcFormat;
this->effectsActive = false;
D12Effect * effect; D12Effect * effect;
D12FrameFormat curFormat = srcFormat; D12FrameFormat curFormat = srcFormat;
@ -540,6 +542,7 @@ static CaptureResult d12_waitFrame(unsigned frameBufferIndex,
switch(d12_effectSetFormat(effect, *this->device, &curFormat, &dstFormat)) switch(d12_effectSetFormat(effect, *this->device, &curFormat, &dstFormat))
{ {
case D12_EFFECT_STATUS_OK: case D12_EFFECT_STATUS_OK:
this->effectsActive = true;
curFormat = dstFormat; curFormat = dstFormat;
effect->enabled = true; effect->enabled = true;
break; break;
@ -656,7 +659,7 @@ static CaptureResult d12_getFrame(unsigned frameBufferIndex,
// place a fence into the queue // place a fence into the queue
result = d12_backendSync(this->backend, result = d12_backendSync(this->backend,
this->allowRGB24 ? *this->computeQueue : *this->copyQueue); this->effectsActive ? *this->computeQueue : *this->copyQueue);
if (result != CAPTURE_RESULT_OK) if (result != CAPTURE_RESULT_OK)
goto exit; goto exit;
@ -774,7 +777,7 @@ static CaptureResult d12_getFrame(unsigned frameBufferIndex,
} }
// execute the compute commands // execute the compute commands
if (next != *src) if (this->effectsActive)
{ {
d12_commandGroupExecute(*this->computeQueue, &this->computeCommand); d12_commandGroupExecute(*this->computeQueue, &this->computeCommand);
@ -794,8 +797,7 @@ static CaptureResult d12_getFrame(unsigned frameBufferIndex,
this->dstFormat.desc.Height * this->pitch); this->dstFormat.desc.Height * this->pitch);
// reset the command queues // reset the command queues
if (next != *src) if (this->effectsActive && !d12_commandGroupReset(&this->computeCommand))
if (!d12_commandGroupReset(&this->computeCommand))
goto exit; goto exit;
if (!d12_commandGroupReset(&this->copyCommand)) if (!d12_commandGroupReset(&this->copyCommand))