Commit 74dc66ca authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: More accurately determine whether a separate sRGB texture is required.

Read control is irrelevant without WINED3D_BIND_SHADER_RESOURCE, write control is irrelevant without WINED3D_BIND_RENDER_TARGET. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d00477e5
......@@ -5077,12 +5077,20 @@ static inline BOOL is_srgb_enabled(const DWORD *sampler_states)
static inline BOOL needs_separate_srgb_gl_texture(const struct wined3d_context *context,
const struct wined3d_texture *texture)
{
unsigned int flags = texture->resource.format_flags
& (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE);
if (!(context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL))
return FALSE;
if (!context->d3d_info->srgb_read_control
&& (texture->resource.bind_flags & WINED3D_BIND_SHADER_RESOURCE)
&& (texture->resource.format_flags & WINED3DFMT_FLAG_SRGB_READ))
return TRUE;
return (!context->d3d_info->srgb_read_control
|| (flags && flags != (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE)))
&& context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL;
if (!context->d3d_info->srgb_write_control
&& (texture->resource.bind_flags & WINED3D_BIND_RENDER_TARGET)
&& (texture->resource.format_flags & WINED3DFMT_FLAG_SRGB_WRITE))
return TRUE;
return FALSE;
}
static inline BOOL needs_srgb_write(const struct wined3d_context *context,
......
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