[host] dxgi: fix packed texture height calculation

This commit is contained in:
Geoffrey McRae 2024-01-27 10:56:23 +11:00
parent 2316a5e64d
commit 738a04d0bc

View file

@ -82,7 +82,7 @@ static bool rgb24_configure(void * opaque,
this.width = ALIGN_TO((*cols * 3 + 3) / 4, 64); this.width = ALIGN_TO((*cols * 3 + 3) / 4, 64);
/* adjust for the aligned width */ /* 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]; char sOutputWidth[6], sOutputHeight[6];
snprintf(sOutputWidth , sizeof(sOutputWidth) , "%d", this.width ); snprintf(sOutputWidth , sizeof(sOutputWidth) , "%d", this.width );
@ -148,6 +148,7 @@ static bool rgb24_configure(void * opaque,
DEBUG_INFO("RGBA to RGB packing enabled, %.2f MiB per frame saved", DEBUG_INFO("RGBA to RGB packing enabled, %.2f MiB per frame saved",
(float)((*width * *height - this.width * this.height) * 4) / 1048576 (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 // This texture is actually going to contain the packed BGR24 output