From 57433da776d31c356fbfe242e4fcbe8f59a2bb58 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B3zef=20Kucia?= Date: Tue, 7 Nov 2017 14:29:14 +0100 Subject: [PATCH] wined3d: Disable pixel shader when rasterization is disabled. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Allows us to split shader output variables when rasterization is disabled. Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/glsl_shader.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 91a6c6e345b..11d91462d2d 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -9926,7 +9926,13 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const gs_id = find_glsl_geometry_shader(context, priv, gshader, &args); } - if (!(context->shader_update_mask & (1u << WINED3D_SHADER_TYPE_PIXEL)) && ctx_data->glsl_program) + /* A pixel shader is not used when rasterization is disabled. */ + if (gshader && gshader->u.gs.so_desc.rasterizer_stream_idx == WINED3D_NO_RASTERIZER_STREAM) + { + ps_id = 0; + ps_list = NULL; + } + else if (!(context->shader_update_mask & (1u << WINED3D_SHADER_TYPE_PIXEL)) && ctx_data->glsl_program) { ps_id = ctx_data->glsl_program->ps.id; ps_list = &ctx_data->glsl_program->ps.shader_entry; @@ -11274,6 +11280,8 @@ static void glsl_vertex_pipe_hs(struct wined3d_context *context, static void glsl_vertex_pipe_geometry_shader(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; + if (state->shader[WINED3D_SHADER_TYPE_DOMAIN]) context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_DOMAIN; else if (state->shader[WINED3D_SHADER_TYPE_VERTEX] -- 2.11.4.GIT