wined3d: Store the sRGB write format capability in the format table.

This commit is contained in:
Henri Verbeet 2010-04-29 00:09:02 +02:00 committed by Alexandre Julliard
parent c041781255
commit be7b01589f
3 changed files with 4 additions and 3 deletions

View File

@ -3308,7 +3308,7 @@ static BOOL CheckSrgbWriteCapability(struct wined3d_adapter *adapter,
/* Only offer SRGB writing on X8R8G8B8/A8R8G8B8 when we use ARB or GLSL shaders as we are
* doing the color fixup in shaders.
* Note Windows drivers (at least on the Geforce 8800) also offer this on R5G6B5. */
if ((format_desc->format == WINED3DFMT_B8G8R8X8_UNORM) || (format_desc->format == WINED3DFMT_B8G8R8A8_UNORM))
if (format_desc->Flags & WINED3DFMT_FLAG_SRGB_WRITE)
{
int vs_selected_mode;
int ps_selected_mode;

View File

@ -659,12 +659,12 @@ static const struct wined3d_format_texture_info format_texture_info[] =
{WINED3DFMT_B8G8R8A8_UNORM, GL_RGBA8, GL_SRGB8_ALPHA8_EXT, 0,
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET
| WINED3DFMT_FLAG_SRGB_READ,
| WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE,
WINED3D_GL_EXT_NONE, NULL},
{WINED3DFMT_B8G8R8X8_UNORM, GL_RGB8, GL_SRGB8_EXT, 0,
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET
| WINED3DFMT_FLAG_SRGB_READ,
| WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE,
WINED3D_GL_EXT_NONE, NULL},
{WINED3DFMT_B5G6R5_UNORM, GL_RGB5, GL_RGB5, GL_RGB8,
GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 0,

View File

@ -2990,6 +2990,7 @@ extern WINED3DFORMAT pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN;
#define WINED3DFMT_FLAG_FLOAT 0x00000200
#define WINED3DFMT_FLAG_BUMPMAP 0x00000400
#define WINED3DFMT_FLAG_SRGB_READ 0x00000800
#define WINED3DFMT_FLAG_SRGB_WRITE 0x00001000
struct wined3d_format_desc
{