Skip to content

Commit

Permalink
[host] d12: fix target for wait fence when effects are active
Browse files Browse the repository at this point in the history
  • Loading branch information
gnif committed Feb 28, 2024
1 parent a894348 commit 2d41cda
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions host/platform/Windows/capture/D12/d12.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct D12Interface

D12Backend * backend;
Vector effects;
bool effectsActive;

// capture format tracking
D12FrameFormat captureFormat;
Expand Down Expand Up @@ -531,6 +532,7 @@ static CaptureResult d12_waitFrame(unsigned frameBufferIndex,
{
D12FrameFormat dstFormat = this->dstFormat;
this->captureFormat = srcFormat;
this->effectsActive = false;

D12Effect * effect;
D12FrameFormat curFormat = srcFormat;
Expand All @@ -540,8 +542,9 @@ static CaptureResult d12_waitFrame(unsigned frameBufferIndex,
switch(d12_effectSetFormat(effect, *this->device, &curFormat, &dstFormat))
{
case D12_EFFECT_STATUS_OK:
curFormat = dstFormat;
effect->enabled = true;
this->effectsActive = true;
curFormat = dstFormat;
effect->enabled = true;
break;

case D12_EFFECT_STATUS_ERROR:
Expand Down Expand Up @@ -656,7 +659,7 @@ static CaptureResult d12_getFrame(unsigned frameBufferIndex,

// place a fence into the queue
result = d12_backendSync(this->backend,
this->allowRGB24 ? *this->computeQueue : *this->copyQueue);
this->effectsActive ? *this->computeQueue : *this->copyQueue);

if (result != CAPTURE_RESULT_OK)
goto exit;
Expand Down Expand Up @@ -774,7 +777,7 @@ static CaptureResult d12_getFrame(unsigned frameBufferIndex,
}

// execute the compute commands
if (next != *src)
if (this->effectsActive)
{
d12_commandGroupExecute(*this->computeQueue, &this->computeCommand);

Expand All @@ -794,9 +797,8 @@ static CaptureResult d12_getFrame(unsigned frameBufferIndex,
this->dstFormat.desc.Height * this->pitch);

// reset the command queues
if (next != *src)
if (!d12_commandGroupReset(&this->computeCommand))
goto exit;
if (this->effectsActive && !d12_commandGroupReset(&this->computeCommand))
goto exit;

if (!d12_commandGroupReset(&this->copyCommand))
goto exit;
Expand Down

0 comments on commit 2d41cda

Please sign in to comment.