Skip to content

Commit

Permalink
[host] nvfbc: fix stride for odd resolutions in 24-bit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
gnif committed Nov 8, 2023
1 parent c84d55c commit 46781ee
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion host/platform/Windows/capture/NVFBC/src/nvfbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,15 @@ static CaptureResult nvfbc_waitFrame(CaptureFrame * frame,
this->isHDR = this->grabInfo.bIsHDR;

// Round up stride in IVSHMEM to avoid issues with dmabuf import.
this->shmStride = ALIGN_PAD(this->grabStride, 32);
if (this->format == CAPTURE_FMT_RGB_24)
{
// EGLImage via DMABUF does not support 24-bit images, the client will
// stuff this into a 32-bit texture so we need to ensure the padding is
// wide enough to keep things aligned.
this->shmStride = ALIGN_PAD(this->grabStride / 4, 64) * 4;
}
else
this->shmStride = ALIGN_PAD(this->grabStride, 64);

this->resChanged = false;
++this->formatVer;
Expand Down

0 comments on commit 46781ee

Please sign in to comment.