[host] all: don't combine the downsampler rules

This commit is contained in:
Geoffrey McRae
2023-11-08 22:52:26 +11:00
parent 905fea57f0
commit d592f13f88
6 changed files with 43 additions and 19 deletions

View File

@@ -50,12 +50,13 @@ typedef struct
}
DownsampleInst;
static Vector downsampleRules = {0};
static void downsample_earlyInit(void)
{
struct Option options[] =
{
DOWNSAMPLE_PARSER("dxgi"),
DOWNSAMPLE_PARSER("dxgi", &downsampleRules),
{0}
};
@@ -99,7 +100,9 @@ static bool downsample_configure(void * opaque,
if (!this.pshader)
{
DownsampleRule * rule = downsampleRule_match(*width, *height);
DownsampleRule * rule = downsampleRule_match(&downsampleRules,
*width, *height);
if (!rule || (rule->targetX == *width && rule->targetY == *height))
{
this.disabled = true;

View File

@@ -136,11 +136,13 @@ static const char * nvfbc_getName(void)
return "NVFBC";
};
static Vector downsampleRules = {0};
static void nvfbc_initOptions(void)
{
struct Option options[] =
{
DOWNSAMPLE_PARSER("nvfbc"),
DOWNSAMPLE_PARSER("nvfbc", &downsampleRules),
{
.module = "nvfbc",
.name = "decoupleCursor",
@@ -202,12 +204,14 @@ static bool nvfbc_create(
static void updateScale(void)
{
DownsampleRule * rule = downsampleRule_match(this->width, this->height);
DownsampleRule * rule = downsampleRule_match(&downsampleRules,
this->width, this->height);
if (rule)
{
this->scale = true;
this->targetWidth = rule->targetX;
this->targetHeight = rule->targetY;
DEBUG_INFO("Downsampling to %dx%d", this->targetWidth, this->targetHeight);
return;
}