From 229d4aa7bc23beab02a7b1f7f20187069dcdeed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Fri, 26 May 2017 10:48:04 +0200 Subject: [PATCH] wined3d: Trace color fixup checks in apply_format_fixups(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/arb_program_shader.c | 15 +-------------- dlls/wined3d/ati_fragment_shader.c | 17 ++--------------- dlls/wined3d/glsl_shader.c | 15 +-------------- dlls/wined3d/nvidia_texture_shader.c | 15 +-------------- dlls/wined3d/state.c | 15 +-------------- dlls/wined3d/utils.c | 9 +++++++++ 6 files changed, 15 insertions(+), 71 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index c9e5880f56b..612a51b62b1 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4977,21 +4977,8 @@ static void shader_arb_get_caps(const struct wined3d_gl_info *gl_info, struct sh static BOOL shader_arb_color_fixup_supported(struct color_fixup_desc fixup) { - if (TRACE_ON(d3d_shader) && TRACE_ON(d3d)) - { - TRACE("Checking support for color_fixup:\n"); - dump_color_fixup_desc(fixup); - } - /* We support everything except complex conversions. */ - if (!is_complex_fixup(fixup)) - { - TRACE("[OK]\n"); - return TRUE; - } - - TRACE("[FAILED]\n"); - return FALSE; + return !is_complex_fixup(fixup); } static void shader_arb_add_instruction_modifiers(const struct wined3d_shader_instruction *ins) { diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index c9af8e700b9..0fca3e661ec 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -1352,22 +1352,9 @@ static void atifs_free(struct wined3d_device *device) static BOOL atifs_color_fixup_supported(struct color_fixup_desc fixup) { - if (TRACE_ON(d3d_shader) && TRACE_ON(d3d)) - { - TRACE("Checking support for fixup:\n"); - dump_color_fixup_desc(fixup); - } - /* We only support sign fixup of the first two channels. */ - if (is_identity_fixup(fixup) || is_same_fixup(fixup, color_fixup_rg) - || is_same_fixup(fixup, color_fixup_rgl) || is_same_fixup(fixup, color_fixup_rgba)) - { - TRACE("[OK]\n"); - return TRUE; - } - - TRACE("[FAILED]\n"); - return FALSE; + return is_identity_fixup(fixup) || is_same_fixup(fixup, color_fixup_rg) + || is_same_fixup(fixup, color_fixup_rgl) || is_same_fixup(fixup, color_fixup_rgba); } static BOOL atifs_alloc_context_data(struct wined3d_context *context) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 6a405ba503e..5f3af0394b0 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -10589,21 +10589,8 @@ static void shader_glsl_get_caps(const struct wined3d_gl_info *gl_info, struct s static BOOL shader_glsl_color_fixup_supported(struct color_fixup_desc fixup) { - if (TRACE_ON(d3d_shader) && TRACE_ON(d3d)) - { - TRACE("Checking support for fixup:\n"); - dump_color_fixup_desc(fixup); - } - /* We support everything except YUV conversions. */ - if (!is_complex_fixup(fixup)) - { - TRACE("[OK]\n"); - return TRUE; - } - - TRACE("[FAILED]\n"); - return FALSE; + return !is_complex_fixup(fixup); } static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TABLE_SIZE] = diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c index d329656177b..9d3a3a18061 100644 --- a/dlls/wined3d/nvidia_texture_shader.c +++ b/dlls/wined3d/nvidia_texture_shader.c @@ -761,21 +761,8 @@ static void nvrc_fragment_free(struct wined3d_device *device) {} static BOOL nvts_color_fixup_supported(struct color_fixup_desc fixup) { - if (TRACE_ON(d3d)) - { - TRACE("Checking support for fixup:\n"); - dump_color_fixup_desc(fixup); - } - /* We only support identity conversions. */ - if (is_identity_fixup(fixup)) - { - TRACE("[OK]\n"); - return TRUE; - } - - TRACE("[FAILED]\n"); - return FALSE; + return is_identity_fixup(fixup); } static const struct StateEntryTemplate nvrc_fragmentstate_template[] = diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index a59e9135e36..bc5b098be83 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -5845,21 +5845,8 @@ static DWORD ffp_fragment_get_emul_mask(const struct wined3d_gl_info *gl_info) static BOOL ffp_color_fixup_supported(struct color_fixup_desc fixup) { - if (TRACE_ON(d3d)) - { - TRACE("Checking support for fixup:\n"); - dump_color_fixup_desc(fixup); - } - /* We only support identity conversions. */ - if (is_identity_fixup(fixup)) - { - TRACE("[OK]\n"); - return TRUE; - } - - TRACE("[FAILED]\n"); - return FALSE; + return is_identity_fixup(fixup); } static BOOL ffp_none_context_alloc(struct wined3d_context *context) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index bf7f91615d2..912511bd523 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3350,9 +3350,18 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ if (!(format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_TEXTURE)) continue; + TRACE("Checking support for fixup:\n"); + dump_color_fixup_desc(format->color_fixup); if (!adapter->shader_backend->shader_color_fixup_supported(format->color_fixup) || !adapter->fragment_pipe->color_fixup_supported(format->color_fixup)) + { + TRACE("[FAILED]\n"); format_clear_flag(format, WINED3DFMT_FLAG_TEXTURE); + } + else + { + TRACE("[OK]\n"); + } } /* GL_EXT_texture_compression_s3tc does not support 3D textures. Some Windows drivers