mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-22 05:42:58 +00:00
[client] egl: fix post processing failure when converting pixel formats
This commit is contained in:
parent
c2237f29ae
commit
7247fadad8
6 changed files with 13 additions and 9 deletions
|
@ -80,9 +80,9 @@ typedef struct EGL_FilterOps
|
|||
void (*setOutputResHint)(EGL_Filter * filter,
|
||||
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,
|
||||
unsigned int *x, unsigned int *y);
|
||||
unsigned int *x, unsigned int *y, enum EGL_PixelFormat *pixFmt);
|
||||
|
||||
/* prepare the shader for use
|
||||
* 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,
|
||||
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)
|
||||
|
|
|
@ -162,11 +162,12 @@ static bool egl_filter24bitSetup(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);
|
||||
*width = this->desktopWidth;
|
||||
*height = this->desktopHeight;
|
||||
*pixFmt = EGL_PF_BGRA;
|
||||
}
|
||||
|
||||
static bool egl_filter24bitPrepare(EGL_Filter * filter)
|
||||
|
|
|
@ -370,11 +370,12 @@ static bool egl_filterDownscaleSetup(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);
|
||||
*width = this->width;
|
||||
*height = this->height;
|
||||
*pixFmt = this->pixFmt;
|
||||
}
|
||||
|
||||
static bool egl_filterDownscalePrepare(EGL_Filter * filter)
|
||||
|
|
|
@ -254,11 +254,12 @@ static bool egl_filterFFXCASSetup(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);
|
||||
*width = this->width;
|
||||
*height = this->height;
|
||||
*pixFmt = this->pixFmt;
|
||||
}
|
||||
|
||||
static bool egl_filterFFXCASPrepare(EGL_Filter * filter)
|
||||
|
|
|
@ -383,11 +383,12 @@ static bool egl_filterFFXFSR1Setup(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);
|
||||
*width = this->width;
|
||||
*height = this->height;
|
||||
*pixFmt = this->pixFmt;
|
||||
}
|
||||
|
||||
static bool egl_filterFFXFSR1Prepare(EGL_Filter * filter)
|
||||
|
|
|
@ -685,7 +685,7 @@ bool egl_postProcessRun(EGL_PostProcess * this, EGL_Texture * tex,
|
|||
continue;
|
||||
|
||||
texture = egl_filterRun(filter, &filterRects, texture);
|
||||
egl_filterGetOutputRes(filter, &sizeX, &sizeY);
|
||||
egl_filterGetOutputRes(filter, &sizeX, &sizeY, &pixFmt);
|
||||
|
||||
if (lastFilter)
|
||||
egl_filterRelease(lastFilter);
|
||||
|
|
Loading…
Reference in a new issue