wined3d: Filter sRGB capabilities during format initialization.
This commit is contained in:
parent
6f18cc59dd
commit
d9d2fe31e3
|
@ -3159,7 +3159,7 @@ static BOOL CheckRenderTargetCapability(const struct wined3d_adapter *adapter,
|
|||
|
||||
static BOOL CheckSrgbReadCapability(const struct wined3d_adapter *adapter, const struct wined3d_format *format)
|
||||
{
|
||||
return adapter->gl_info.supported[EXT_TEXTURE_SRGB] && (format->flags & WINED3DFMT_FLAG_SRGB_READ);
|
||||
return format->flags & WINED3DFMT_FLAG_SRGB_READ;
|
||||
}
|
||||
|
||||
static BOOL CheckSrgbWriteCapability(const struct wined3d_adapter *adapter, const struct wined3d_format *format)
|
||||
|
|
|
@ -1197,6 +1197,14 @@ static BOOL init_format_texture_info(struct wined3d_gl_info *gl_info)
|
|||
format->flags |= format_texture_info[i].flags;
|
||||
format->heightscale = 1.0f;
|
||||
|
||||
/* Filter sRGB capabilities if EXT_texture_sRGB is not supported. */
|
||||
if (!gl_info->supported[EXT_TEXTURE_SRGB]
|
||||
&& format->glGammaInternal != format->glInternal)
|
||||
{
|
||||
format->glGammaInternal = format->glInternal;
|
||||
format->flags &= ~(WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE);
|
||||
}
|
||||
|
||||
/* Texture conversion stuff */
|
||||
format->convert = format_texture_info[i].convert;
|
||||
format->conv_byte_count = format_texture_info[i].conv_byte_count;
|
||||
|
|
|
@ -40,7 +40,6 @@ static HRESULT volumetexture_bind(IWineD3DBaseTextureImpl *texture, BOOL srgb)
|
|||
static void volumetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB srgb)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = texture->resource.device;
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
struct wined3d_context *context = NULL;
|
||||
BOOL srgb_mode = texture->baseTexture.is_srgb;
|
||||
BOOL srgb_was_toggled = FALSE;
|
||||
|
@ -49,7 +48,7 @@ static void volumetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3D
|
|||
TRACE("texture %p, srgb %#x.\n", texture, srgb);
|
||||
|
||||
if (!device->isInDraw) context = context_acquire(device, NULL);
|
||||
else if (gl_info->supported[EXT_TEXTURE_SRGB] && texture->baseTexture.bindCount > 0)
|
||||
else if (texture->baseTexture.bindCount > 0)
|
||||
{
|
||||
srgb_mode = device->stateBlock->state.sampler_states[texture->baseTexture.sampler][WINED3DSAMP_SRGBTEXTURE];
|
||||
srgb_was_toggled = texture->baseTexture.is_srgb != srgb_mode;
|
||||
|
|
Loading…
Reference in New Issue