Skip to content

Commit

Permalink
[host] dxgi: ensure 24-bit packed output is properly aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
gnif committed Jan 26, 2024
1 parent 47ad93f commit 2316a5e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions host/platform/Windows/capture/DXGI/src/pp/rgb24.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ static bool rgb24_configure(void * opaque,

if (!this.pshader)
{
this.width = (*cols * 3 + 3) / 4;
this.height = *rows;
/* we must align to 64 byte boundaries to avoid breaking dmabuf import */
this.width = ALIGN_TO((*cols * 3 + 3) / 4, 64);

/* adjust for the aligned width */
this.height = ((*rows * *cols) + this.width - 1) / this.width;

char sOutputWidth[6], sOutputHeight[6];
snprintf(sOutputWidth , sizeof(sOutputWidth) , "%d", this.width );
Expand Down

0 comments on commit 2316a5e

Please sign in to comment.