[client] egl: fix post processing failure when converting pixel formats

This commit is contained in:
Geoffrey McRae 2024-01-25 17:51:06 +11:00
parent c2237f29ae
commit 7247fadad8
6 changed files with 13 additions and 9 deletions

View File

@ -80,9 +80,9 @@ typedef struct EGL_FilterOps
void (*setOutputResHint)(EGL_Filter * filter, void (*setOutputResHint)(EGL_Filter * filter,
unsigned int x, unsigned int y); unsigned int x, unsigned int y);
/* returns the output resolution of the filter */ /* returns the output resolution and pixel format of the filter */
void (*getOutputRes)(EGL_Filter * filter, void (*getOutputRes)(EGL_Filter * filter,
unsigned int *x, unsigned int *y); unsigned int *x, unsigned int *y, enum EGL_PixelFormat *pixFmt);
/* prepare the shader for use /* prepare the shader for use
* A filter can return false to bypass it */ * A filter can return false to bypass it */
@ -162,9 +162,9 @@ static inline void egl_filterSetOutputResHint(EGL_Filter * filter,
} }
static inline void egl_filterGetOutputRes(EGL_Filter * filter, static inline void egl_filterGetOutputRes(EGL_Filter * filter,
unsigned int *x, unsigned int *y) unsigned int *x, unsigned int *y, enum EGL_PixelFormat *pixFmt)
{ {
return filter->ops.getOutputRes(filter, x, y); return filter->ops.getOutputRes(filter, x, y, pixFmt);
} }
static inline bool egl_filterPrepare(EGL_Filter * filter) static inline bool egl_filterPrepare(EGL_Filter * filter)

View File

@ -162,11 +162,12 @@ static bool egl_filter24bitSetup(EGL_Filter * filter,
} }
static void egl_filter24bitGetOutputRes(EGL_Filter * filter, static void egl_filter24bitGetOutputRes(EGL_Filter * filter,
unsigned int *width, unsigned int *height) unsigned int *width, unsigned int *height, enum EGL_PixelFormat *pixFmt)
{ {
EGL_Filter24bit * this = UPCAST(EGL_Filter24bit, filter); EGL_Filter24bit * this = UPCAST(EGL_Filter24bit, filter);
*width = this->desktopWidth; *width = this->desktopWidth;
*height = this->desktopHeight; *height = this->desktopHeight;
*pixFmt = EGL_PF_BGRA;
} }
static bool egl_filter24bitPrepare(EGL_Filter * filter) static bool egl_filter24bitPrepare(EGL_Filter * filter)

View File

@ -370,11 +370,12 @@ static bool egl_filterDownscaleSetup(EGL_Filter * filter,
} }
static void egl_filterDownscaleGetOutputRes(EGL_Filter * filter, static void egl_filterDownscaleGetOutputRes(EGL_Filter * filter,
unsigned int *width, unsigned int *height) unsigned int *width, unsigned int *height, enum EGL_PixelFormat *pixFmt)
{ {
EGL_FilterDownscale * this = UPCAST(EGL_FilterDownscale, filter); EGL_FilterDownscale * this = UPCAST(EGL_FilterDownscale, filter);
*width = this->width; *width = this->width;
*height = this->height; *height = this->height;
*pixFmt = this->pixFmt;
} }
static bool egl_filterDownscalePrepare(EGL_Filter * filter) static bool egl_filterDownscalePrepare(EGL_Filter * filter)

View File

@ -254,11 +254,12 @@ static bool egl_filterFFXCASSetup(EGL_Filter * filter,
} }
static void egl_filterFFXCASGetOutputRes(EGL_Filter * filter, static void egl_filterFFXCASGetOutputRes(EGL_Filter * filter,
unsigned int *width, unsigned int *height) unsigned int *width, unsigned int *height, enum EGL_PixelFormat *pixFmt)
{ {
EGL_FilterFFXCAS * this = UPCAST(EGL_FilterFFXCAS, filter); EGL_FilterFFXCAS * this = UPCAST(EGL_FilterFFXCAS, filter);
*width = this->width; *width = this->width;
*height = this->height; *height = this->height;
*pixFmt = this->pixFmt;
} }
static bool egl_filterFFXCASPrepare(EGL_Filter * filter) static bool egl_filterFFXCASPrepare(EGL_Filter * filter)

View File

@ -383,11 +383,12 @@ static bool egl_filterFFXFSR1Setup(EGL_Filter * filter,
} }
static void egl_filterFFXFSR1GetOutputRes(EGL_Filter * filter, static void egl_filterFFXFSR1GetOutputRes(EGL_Filter * filter,
unsigned int *width, unsigned int *height) unsigned int *width, unsigned int *height, enum EGL_PixelFormat *pixFmt)
{ {
EGL_FilterFFXFSR1 * this = UPCAST(EGL_FilterFFXFSR1, filter); EGL_FilterFFXFSR1 * this = UPCAST(EGL_FilterFFXFSR1, filter);
*width = this->width; *width = this->width;
*height = this->height; *height = this->height;
*pixFmt = this->pixFmt;
} }
static bool egl_filterFFXFSR1Prepare(EGL_Filter * filter) static bool egl_filterFFXFSR1Prepare(EGL_Filter * filter)

View File

@ -685,7 +685,7 @@ bool egl_postProcessRun(EGL_PostProcess * this, EGL_Texture * tex,
continue; continue;
texture = egl_filterRun(filter, &filterRects, texture); texture = egl_filterRun(filter, &filterRects, texture);
egl_filterGetOutputRes(filter, &sizeX, &sizeY); egl_filterGetOutputRes(filter, &sizeX, &sizeY, &pixFmt);
if (lastFilter) if (lastFilter)
egl_filterRelease(lastFilter); egl_filterRelease(lastFilter);