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

wined3d: Reinstall the G16R16F format surface load fixup.

We cannot remove this because we still have to load the surface as RGB. The shader may take care of setting the blue channel to 1.0 now, but we still get the red and green channels loaded incorrectly if we don't insert a blue channel before loading.
parent 6ec741e7
...@@ -1696,6 +1696,14 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_ ...@@ -1696,6 +1696,14 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
*target_bpp = 2; *target_bpp = 2;
break; break;
case WINED3DFMT_G16R16:
*convert = CONVERT_G16R16;
*format = GL_RGB;
*internal = GL_RGB16_EXT;
*type = GL_UNSIGNED_SHORT;
*target_bpp = 6;
break;
default: default:
break; break;
} }
...@@ -2023,6 +2031,27 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI ...@@ -2023,6 +2031,27 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI
break; break;
} }
case CONVERT_G16R16:
{
unsigned int x, y;
const WORD *Source;
WORD *Dest;
for(y = 0; y < height; y++) {
Source = (const WORD *)(src + y * pitch);
Dest = (WORD *) (dst + y * outpitch);
for (x = 0; x < width; x++ ) {
WORD green = (*Source++);
WORD red = (*Source++);
Dest[0] = green;
Dest[1] = red;
Dest[2] = 0xffff;
Dest += 3;
}
}
break;
}
default: default:
ERR("Unsupported conversation type %d\n", convert); ERR("Unsupported conversation type %d\n", convert);
} }
......
...@@ -1679,6 +1679,7 @@ typedef enum { ...@@ -1679,6 +1679,7 @@ typedef enum {
CONVERT_Q8W8V8U8, CONVERT_Q8W8V8U8,
CONVERT_V16U16, CONVERT_V16U16,
CONVERT_A4L4, CONVERT_A4L4,
CONVERT_G16R16,
} CONVERT_TYPES; } CONVERT_TYPES;
HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, GLenum *format, GLenum *internal, GLenum *type, CONVERT_TYPES *convert, int *target_bpp, BOOL srgb_mode); HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, GLenum *format, GLenum *internal, GLenum *type, CONVERT_TYPES *convert, int *target_bpp, BOOL srgb_mode);
......
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