Commit a0127f2e authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Allow using a different internal format for fbos.

OpenGL drivers do not support some low precision internal formats like GL_RGB5 for fbo color targets. Direct3D application depend on them, so provide a fallback format for render targets if the requested format itself is not supported.
parent 28170c14
......@@ -1414,11 +1414,18 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
/* Default values: From the surface */
*format = glDesc->glFormat;
*internal = srgb_mode?glDesc->glGammaInternal:glDesc->glInternal;
*type = glDesc->glType;
*convert = NO_CONVERSION;
*target_bpp = This->bytesPerPixel;
if(srgb_mode) {
*internal = glDesc->glGammaInternal;
} else if(This->resource.usage & WINED3DUSAGE_RENDERTARGET) {
*internal = glDesc->rtInternal;
} else {
*internal = glDesc->glInternal;
}
/* Ok, now look if we have to do any conversion */
switch(This->resource.format) {
case WINED3DFMT_P8:
......
......@@ -3616,7 +3616,7 @@ typedef BOOL (WINAPI * WINED3D_PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer,
****************************************************/
typedef struct {
GLint glInternal, glGammaInternal, glFormat, glType;
GLint glInternal, glGammaInternal, rtInternal, glFormat, glType;
WINED3DFORMAT conversion_group;
} GlPixelFormatDesc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment