From 43bfe54b66dab58e176ccef223d97eab250cd41b Mon Sep 17 00:00:00 2001 From: rakslice Date: Sun, 12 Jan 2025 21:43:47 -0800 Subject: [PATCH] implement log2GobsPerBlockY values for even smaller images --- src/direct/nv-driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/direct/nv-driver.c b/src/direct/nv-driver.c index 09bad55..cf668c7 100644 --- a/src/direct/nv-driver.c +++ b/src/direct/nv-driver.c @@ -487,6 +487,9 @@ bool alloc_memory(const NVDriverContext *context, const uint32_t size, int *fd) //first figure out the gob layout uint32_t log2GobsPerBlockX = 0; //TODO not sure if these are the correct numbers to start with, but they're the largest ones i've seen used uint32_t log2GobsPerBlockY = height < 86 ? 3 : 4; //TODO 86 is a guess, 80px high needs 3, 112px needs 4, 96px needs 4, 88px needs 4, 86px needs 4 + if (height < 43) log2GobsPerBlockY = 2; + if (height < 22) log2GobsPerBlockY = 1; + if (height < 11) log2GobsPerBlockY = 0; uint32_t log2GobsPerBlockZ = 0; //LOG("Calculated GOB size: %dx%d (%dx%d)", gobWidthInBytes << log2GobsPerBlockX, gobHeightInBytes << log2GobsPerBlockY, log2GobsPerBlockX, log2GobsPerBlockY);