Skip to content

Commit

Permalink
[host] dxgi: fix packed texture height calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
gnif committed Jan 26, 2024
1 parent 2316a5e commit 738a04d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion host/platform/Windows/capture/DXGI/src/pp/rgb24.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static bool rgb24_configure(void * opaque,
this.width = ALIGN_TO((*cols * 3 + 3) / 4, 64);

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

char sOutputWidth[6], sOutputHeight[6];
snprintf(sOutputWidth , sizeof(sOutputWidth) , "%d", this.width );
Expand Down Expand Up @@ -148,6 +148,7 @@ static bool rgb24_configure(void * opaque,
DEBUG_INFO("RGBA to RGB packing enabled, %.2f MiB per frame saved",
(float)((*width * *height - this.width * this.height) * 4) / 1048576
);
DEBUG_INFO("Packed size: %ux%u", this.width, this.height);
}

// This texture is actually going to contain the packed BGR24 output
Expand Down

0 comments on commit 738a04d

Please sign in to comment.