Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3dcompiler_43/reflection.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 4415399793d..bd064793587 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -140,7 +140,7 @@ struct d3dcompiler_shader_reflection UINT dynamic_flow_control_count; UINT c_control_points; D3D_TESSELLATOR_OUTPUT_PRIMITIVE hs_output_primitive; - D3D_TESSELLATOR_PARTITIONING hs_prtitioning; + D3D_TESSELLATOR_PARTITIONING hs_partitioning; D3D_TESSELLATOR_DOMAIN tessellator_domain;
struct d3dcompiler_shader_signature *isgn; @@ -428,7 +428,7 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetDesc(ID3D11Sha desc->cGSInstanceCount = 0; desc->cControlPoints = This->c_control_points; desc->HSOutputPrimitive = This->hs_output_primitive; - desc->HSPartitioning = This->hs_prtitioning; + desc->HSPartitioning = This->hs_partitioning; desc->TessellatorDomain = This->tessellator_domain; desc->cBarrierInstructions = 0; desc->cInterlockedInstructions = 0; @@ -1184,8 +1184,8 @@ static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, c r->hs_output_primitive = read_dword(&ptr); TRACE("HSOutputPrimitive: %x\n", r->hs_output_primitive);
- r->hs_prtitioning = read_dword(&ptr); - TRACE("HSPartitioning: %x\n", r->hs_prtitioning); + r->hs_partitioning = read_dword(&ptr); + TRACE("HSPartitioning: %x\n", r->hs_partitioning);
r->tessellator_domain = read_dword(&ptr); TRACE("TessellatorDomain: %x\n", r->tessellator_domain);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/resource.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 58e3e5c77fd..54cbd514e27 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -141,15 +141,15 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id)); continue; } - } - if (((width & (width - 1)) || (height & (height - 1))) + if (((width & (width - 1)) || (height & (height - 1))) && !d3d_info->texture_npot && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT] && gl_type == WINED3D_GL_RES_TYPE_TEX_2D) - { - TRACE("Skipping 2D texture type to try texture rectangle.\n"); - tex_2d_ok = TRUE; - continue; + { + TRACE("Skipping 2D texture type to try texture rectangle.\n"); + tex_2d_ok = TRUE; + continue; + } } break; }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91534
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
On Mon, 31 May 2021 at 21:13, Matteo Bruni mbruni@codeweavers.com wrote:
@@ -141,15 +141,15 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id)); continue; }
}
if (((width & (width - 1)) || (height & (height - 1)))
if (((width & (width - 1)) || (height & (height - 1))) && !d3d_info->texture_npot && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT] && gl_type == WINED3D_GL_RES_TYPE_TEX_2D)
{
TRACE("Skipping 2D texture type to try texture rectangle.\n");
tex_2d_ok = TRUE;
continue;
{
TRACE("Skipping 2D texture type to try texture rectangle.\n");
tex_2d_ok = TRUE;
continue;
}} } break;
Does this make a difference? Buffer resources would fail the "gl_type == WINED3D_GL_RES_TYPE_TEX_2D" check, and in terms of performance, well, don't create resources in your rendering loop. Still, this would be fine, except that now you've messed up the indentation of the if-statement. Note that instead of the "if (type != WINED3D_RTYPE_BUFFER) { ... }" block above, you could just "if (type == WINED3D_RTYPE_BUFFER) break;", and save some indentation.
On Tue, Jun 1, 2021 at 6:54 PM Henri Verbeet hverbeet@gmail.com wrote:
On Mon, 31 May 2021 at 21:13, Matteo Bruni mbruni@codeweavers.com wrote:
@@ -141,15 +141,15 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id)); continue; }
}
if (((width & (width - 1)) || (height & (height - 1)))
if (((width & (width - 1)) || (height & (height - 1))) && !d3d_info->texture_npot && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT] && gl_type == WINED3D_GL_RES_TYPE_TEX_2D)
{
TRACE("Skipping 2D texture type to try texture rectangle.\n");
tex_2d_ok = TRUE;
continue;
{
TRACE("Skipping 2D texture type to try texture rectangle.\n");
tex_2d_ok = TRUE;
continue;
}} } break;
Does this make a difference? Buffer resources would fail the "gl_type == WINED3D_GL_RES_TYPE_TEX_2D" check, and in terms of performance, well, don't create resources in your rendering loop. Still, this would be fine, except that now you've messed up the indentation of the if-statement. Note that instead of the "if (type != WINED3D_RTYPE_BUFFER) { ... }" block above, you could just "if (type == WINED3D_RTYPE_BUFFER) break;", and save some indentation.
That's what happens when I write patches on the Mac :/ Yeah, it shouldn't affect anything but it seemed pointless to have that sit out of the if (type != WINED3D_RTYPE_BUFFER){} block.
But indeed, it's even nicer to flip the condition entirely.
This fixes the non-default ARB shader backend, broken since 2ddb6b66a7cda0bf6aaddc0c6899e35cc92ceee9, although the fundamental issue was there long before that.
Originally the STATE_VDECL handler did some bookkeeping (basically, computing what is now the stream info data) that's a prerequisite for running other state handlers. For this reason a somewhat complicated dance was put in place, with the dependent handlers returning right away until the STATE_VDECL handler could prepare everything up and the STATE_VDECL handler in turn explicitly calling these "downstream" handlers so that they could do their job. With the commit mentioned above the state dirty flags are cleared after the corresponding handlers are executed, which means that the relevant handlers are skipped twice and some stuff is never set up properly.
Stream info is computed by context_apply_draw_state() before going through the state handler table for a long time now, getting rid of this obscure handler interdependency. So let's just get rid of the skipping altogether.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/state.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 1194604e7dc..264a9974b40 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -278,11 +278,7 @@ static void state_lighting(struct wined3d_context *context, const struct wined3d
/* Lighting is not enabled if transformed vertices are drawn, but lighting * does not affect the stream sources, so it is not grouped for - * performance reasons. This state reads the decoded vertex declaration, - * so if it is dirty don't do anything. The vertex declaration applying - * function calls this function for updating. */ - if (isStateDirty(context, STATE_VDECL)) - return; + * performance reasons. */
if (state->render_states[WINED3D_RS_LIGHTING] && !context->stream_info.position_transformed) @@ -1510,12 +1506,6 @@ static void state_colormat(struct wined3d_context *context, const struct wined3d const struct wined3d_gl_info *gl_info = context_gl->gl_info; GLenum Parm = 0;
- /* Depends on the decoded vertex declaration to read the existence of - * diffuse data. The vertex declaration will call this function if the - * fixed function pipeline is used. */ - if (isStateDirty(&context_gl->c, STATE_VDECL)) - return; - context_gl->untracked_material_count = 0; if ((context_gl->c.stream_info.use_map & (1u << WINED3D_FFP_DIFFUSE)) && state->render_states[WINED3D_RS_COLORVERTEX]) @@ -1656,9 +1646,6 @@ static void state_normalize(struct wined3d_context *context, const struct wined3 { const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
- if (isStateDirty(context, STATE_VDECL)) - return; - /* Without vertex normals, we set the current normal to 0/0/0 to remove the diffuse factor * from the opengl lighting equation, as d3d does. Normalization of 0/0/0 can lead to a division * by zero and is not properly defined in opengl, so avoid it @@ -3444,10 +3431,9 @@ static void transform_texture(struct wined3d_context *context, const struct wine unsigned int mapped_stage = context_gl->tex_unit_map[tex]; struct wined3d_matrix mat;
- /* Ignore this when a vertex shader is used, or if the streams aren't sorted out yet */ - if (use_vs(state) || isStateDirty(context, STATE_VDECL)) + if (use_vs(state)) { - TRACE("Using a vertex shader, or stream sources not sorted out yet, skipping\n"); + TRACE("Using a vertex shader, skipping.\n"); return; }
@@ -4013,8 +3999,6 @@ static void transform_projection(struct wined3d_context *context, const struct w
static void streamsrc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (isStateDirty(context, STATE_VDECL)) - return; wined3d_context_gl_update_stream_sources(wined3d_context_gl(context), state); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91535
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
On Mon, 31 May 2021 at 21:13, Matteo Bruni mbruni@codeweavers.com wrote:
This fixes the non-default ARB shader backend, broken since 2ddb6b66a7cda0bf6aaddc0c6899e35cc92ceee9, although the fundamental issue was there long before that.
Originally the STATE_VDECL handler did some bookkeeping (basically, computing what is now the stream info data) that's a prerequisite for running other state handlers. For this reason a somewhat complicated dance was put in place, with the dependent handlers returning right away until the STATE_VDECL handler could prepare everything up and the STATE_VDECL handler in turn explicitly calling these "downstream" handlers so that they could do their job. With the commit mentioned above the state dirty flags are cleared after the corresponding handlers are executed, which means that the relevant handlers are skipped twice and some stuff is never set up properly.
Stream info is computed by context_apply_draw_state() before going through the state handler table for a long time now, getting rid of this obscure handler interdependency. So let's just get rid of the skipping altogether.
Although now handlers may end up getting called twice. I'm tempted to think we should clear the "dirty_graphics_states" bitmap only after all handlers have run, similar to what we do in wined3d_context_vk_apply_draw_state().
On Tue, Jun 1, 2021 at 6:54 PM Henri Verbeet hverbeet@gmail.com wrote:
On Mon, 31 May 2021 at 21:13, Matteo Bruni mbruni@codeweavers.com wrote:
This fixes the non-default ARB shader backend, broken since 2ddb6b66a7cda0bf6aaddc0c6899e35cc92ceee9, although the fundamental issue was there long before that.
Originally the STATE_VDECL handler did some bookkeeping (basically, computing what is now the stream info data) that's a prerequisite for running other state handlers. For this reason a somewhat complicated dance was put in place, with the dependent handlers returning right away until the STATE_VDECL handler could prepare everything up and the STATE_VDECL handler in turn explicitly calling these "downstream" handlers so that they could do their job. With the commit mentioned above the state dirty flags are cleared after the corresponding handlers are executed, which means that the relevant handlers are skipped twice and some stuff is never set up properly.
Stream info is computed by context_apply_draw_state() before going through the state handler table for a long time now, getting rid of this obscure handler interdependency. So let's just get rid of the skipping altogether.
Although now handlers may end up getting called twice. I'm tempted to think we should clear the "dirty_graphics_states" bitmap only after all handlers have run, similar to what we do in wined3d_context_vk_apply_draw_state().
Oh, good idea! I'll try it and look through the various handlers for more weird shenanigans.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/ati_fragment_shader.c | 2 +- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/utils.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 7bec9d70d29..7bd68d615d6 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -6581,7 +6581,7 @@ static void fragment_prog_arbfp(struct wined3d_context *context, const struct wi { /* Find or create a shader implementing the fixed function pipeline * settings, then activate it. */ - gen_ffp_frag_op(context, state, &settings, FALSE); + wined3d_ffp_get_fs_settings(context, state, &settings, FALSE); desc = (const struct arbfp_ffp_desc *)find_ffp_frag_shader(&priv->fragment_shaders, &settings); if (!desc) { diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index ae2843db403..08fb2c81507 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -1024,7 +1024,7 @@ static void set_tex_op_atifs(struct wined3d_context *context, const struct wined DWORD mapped_stage; unsigned int i;
- gen_ffp_frag_op(context, state, &settings, TRUE); + wined3d_ffp_get_fs_settings(context, state, &settings, TRUE); desc = (const struct atifs_ffp_desc *)find_ffp_frag_shader(&priv->fragment_shaders, &settings); if (!desc) { diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 3876e71af58..5a3cb4c8a69 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -10321,7 +10321,7 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl, struct glsl_ffp_fragment_shader *ffp_shader; struct ffp_frag_settings settings;
- gen_ffp_frag_op(&context_gl->c, state, &settings, FALSE); + wined3d_ffp_get_fs_settings(&context_gl->c, state, &settings, FALSE); ffp_shader = shader_glsl_find_ffp_fragment_shader(priv, &settings, context_gl); ps_id = ffp_shader->id; ps_list = &ffp_shader->linked_programs; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index dc7823b9534..b39fb46cadc 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -6053,7 +6053,7 @@ void multiply_matrix(struct wined3d_matrix *dst, const struct wined3d_matrix *sr *dst = tmp; }
-void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d_state *state, +void wined3d_ffp_get_fs_settings(const struct wined3d_context *context, const struct wined3d_state *state, struct ffp_frag_settings *settings, BOOL ignore_textype) { #define ARG1 0x01 diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 8e3efccffc2..21f34a5895d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3528,7 +3528,7 @@ int wined3d_ffp_vertex_program_key_compare(const void *key, const struct wine_rb
extern const struct wined3d_parent_ops wined3d_null_parent_ops DECLSPEC_HIDDEN;
-void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d_state *state, +void wined3d_ffp_get_fs_settings(const struct wined3d_context *context, const struct wined3d_state *state, struct ffp_frag_settings *settings, BOOL ignore_textype) DECLSPEC_HIDDEN; const struct ffp_frag_desc *find_ffp_frag_shader(const struct wine_rb_tree *fragment_shaders, const struct ffp_frag_settings *settings) DECLSPEC_HIDDEN;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91536
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- This is just an optimization since it avoids the ycorrection uniform and the multiplication (ycorrection.y is always 1 with FBO ORM).
I've been sitting on this patch for a long time; it's probably not going to make any difference in practice but I might as well upstream it...
dlls/wined3d/glsl_shader.c | 39 +++++++++++++++++++------------------- dlls/wined3d/shader.c | 5 +++-- 2 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 5a3cb4c8a69..6a3aaabe39b 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -4036,6 +4036,9 @@ static void shader_glsl_pow(const struct wined3d_shader_instruction *ins) /* Map the opcode 1-to-1 to the GL code (arg->dst = instruction(src0, src1, ...) */ static void shader_glsl_map2gl(const struct wined3d_shader_instruction *ins) { + const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; + bool y_correction = ins->ctx->reg_maps->shader_version.type == WINED3D_SHADER_TYPE_PIXEL + ? !priv->cur_ps_args->render_offscreen : false; struct wined3d_string_buffer *buffer = ins->ctx->buffer; struct glsl_src_param src_param; const char *instruction; @@ -4052,9 +4055,9 @@ static void shader_glsl_map2gl(const struct wined3d_shader_instruction *ins) case WINED3DSIH_DSX: instruction = "dFdx"; break; case WINED3DSIH_DSX_COARSE: instruction = "dFdxCoarse"; break; case WINED3DSIH_DSX_FINE: instruction = "dFdxFine"; break; - case WINED3DSIH_DSY: instruction = "ycorrection.y * dFdy"; break; - case WINED3DSIH_DSY_COARSE: instruction = "ycorrection.y * dFdyCoarse"; break; - case WINED3DSIH_DSY_FINE: instruction = "ycorrection.y * dFdyFine"; break; + case WINED3DSIH_DSY: instruction = y_correction ? "ycorrection.y * dFdy" : "dFdy"; break; + case WINED3DSIH_DSY_COARSE: instruction = y_correction ? "ycorrection.y * dFdyCoarse" : "dFdyCoarse"; break; + case WINED3DSIH_DSY_FINE: instruction = y_correction ? "ycorrection.y * dFdyFine" : "dFdyFine"; break; case WINED3DSIH_FIRSTBIT_HI: instruction = "findMSB"; break; case WINED3DSIH_FIRSTBIT_LO: instruction = "findLSB"; break; case WINED3DSIH_FIRSTBIT_SHI: instruction = "findMSB"; break; @@ -7773,25 +7776,23 @@ static GLuint shader_glsl_generate_fragment_shader(const struct wined3d_context_ shader_glsl_append_imm_vec(buffer, &wined3d_srgb_const[1].x, 4, gl_info); shader_addline(buffer, ";\n"); } - if (reg_maps->vpos || reg_maps->usesdsy) + if ((reg_maps->usesdsy && wined3d_settings.offscreen_rendering_mode != ORM_FBO) + || (reg_maps->vpos && !gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS])) { - if (reg_maps->usesdsy || !gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS]) - { - ++extra_constants_needed; - shader_addline(buffer, "uniform vec4 ycorrection;\n"); - } - if (reg_maps->vpos) + ++extra_constants_needed; + shader_addline(buffer, "uniform vec4 ycorrection;\n"); + } + if (reg_maps->vpos) + { + if (gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS]) { - if (gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS]) - { - if (context_gl->c.d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER) - shader_addline(buffer, "layout(%spixel_center_integer) in vec4 gl_FragCoord;\n", - args->render_offscreen ? "" : "origin_upper_left, "); - else if (!args->render_offscreen) - shader_addline(buffer, "layout(origin_upper_left) in vec4 gl_FragCoord;\n"); - } - shader_addline(buffer, "vec4 vpos;\n"); + if (context_gl->c.d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER) + shader_addline(buffer, "layout(%spixel_center_integer) in vec4 gl_FragCoord;\n", + args->render_offscreen ? "" : "origin_upper_left, "); + else if (!args->render_offscreen) + shader_addline(buffer, "layout(origin_upper_left) in vec4 gl_FragCoord;\n"); } + shader_addline(buffer, "vec4 vpos;\n"); }
if (args->alpha_test_func + 1 != WINED3D_CMP_ALWAYS) diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 42a3c108860..ae9b21defa1 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -4212,8 +4212,9 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 if (d3d_info->emulated_flatshading) args->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
- args->render_offscreen = shader->reg_maps.vpos && gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS] - ? context->render_offscreen : 0; + args->render_offscreen = (shader->reg_maps.vpos && gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS]) + || (shader->reg_maps.usesdsy && wined3d_settings.offscreen_rendering_mode != ORM_FBO) + ? context->render_offscreen : 1;
for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i) {
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91537
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/adapter_gl.c | 1 + dlls/wined3d/glsl_shader.c | 6 +++--- dlls/wined3d/shader.c | 5 ++--- dlls/wined3d/wined3d_private.h | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 8787324571a..f6ef04a5fbb 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -5115,6 +5115,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_ d3d_info->shader_color_key = !!(fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_COLOR_KEY); d3d_info->shader_double_precision = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_DOUBLE_PRECISION); d3d_info->shader_output_interpolation = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION); + d3d_info->frag_coord_correction = !!gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS]; d3d_info->viewport_array_index_any_shader = !!gl_info->supported[ARB_SHADER_VIEWPORT_LAYER_ARRAY]; d3d_info->texture_npot = !!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]; d3d_info->texture_npot_conditional = gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT] diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 6a3aaabe39b..398d3f5bffa 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -4038,7 +4038,7 @@ static void shader_glsl_map2gl(const struct wined3d_shader_instruction *ins) { const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; bool y_correction = ins->ctx->reg_maps->shader_version.type == WINED3D_SHADER_TYPE_PIXEL - ? !priv->cur_ps_args->render_offscreen : false; + ? priv->cur_ps_args->y_correction : false; struct wined3d_string_buffer *buffer = ins->ctx->buffer; struct glsl_src_param src_param; const char *instruction; @@ -7788,8 +7788,8 @@ static GLuint shader_glsl_generate_fragment_shader(const struct wined3d_context_ { if (context_gl->c.d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER) shader_addline(buffer, "layout(%spixel_center_integer) in vec4 gl_FragCoord;\n", - args->render_offscreen ? "" : "origin_upper_left, "); - else if (!args->render_offscreen) + args->y_correction ? "origin_upper_left, " : ""); + else if (args->y_correction) shader_addline(buffer, "layout(origin_upper_left) in vec4 gl_FragCoord;\n"); } shader_addline(buffer, "vec4 vpos;\n"); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index ae9b21defa1..4374269b9a1 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -3952,7 +3952,6 @@ void find_gs_compile_args(const struct wined3d_state *state, const struct wined3 void find_ps_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, BOOL position_transformed, struct ps_compile_args *args, const struct wined3d_context *context) { - const struct wined3d_gl_info *gl_info = &context->device->adapter->gl_info; const struct wined3d_d3d_info *d3d_info = context->d3d_info; struct wined3d_texture *texture; unsigned int i; @@ -4212,9 +4211,9 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 if (d3d_info->emulated_flatshading) args->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
- args->render_offscreen = (shader->reg_maps.vpos && gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS]) + args->y_correction = (shader->reg_maps.vpos && d3d_info->frag_coord_correction) || (shader->reg_maps.usesdsy && wined3d_settings.offscreen_rendering_mode != ORM_FBO) - ? context->render_offscreen : 1; + ? !context->render_offscreen : 0;
for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 21f34a5895d..d5bc1e6c6c8 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -222,6 +222,7 @@ struct wined3d_d3d_info uint32_t shader_color_key : 1; uint32_t shader_double_precision : 1; uint32_t shader_output_interpolation : 1; + uint32_t frag_coord_correction : 1; uint32_t viewport_array_index_any_shader : 1; uint32_t texture_npot : 1; uint32_t texture_npot_conditional : 1; @@ -1438,7 +1439,7 @@ struct ps_compile_args DWORD pointsprite : 1; DWORD flatshading : 1; DWORD alpha_test_func : 3; - DWORD render_offscreen : 1; + DWORD y_correction : 1; DWORD rt_alpha_swizzle : 8; /* WINED3D_MAX_RENDER_TARGETS, 8 */ DWORD dual_source_blend : 1; DWORD padding : 17;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91538
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
It's already part of the context.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/shader.c | 3 ++- dlls/wined3d/wined3d_private.h | 3 +-- 4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 7bd68d615d6..e297c724412 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4477,7 +4477,7 @@ static void find_arb_vs_compile_args(const struct wined3d_state *state, int i; WORD int_skip;
- find_vs_compile_args(state, shader, context_gl->c.stream_info.swizzle_map, &args->super, &context_gl->c); + find_vs_compile_args(state, shader, &args->super, &context_gl->c);
args->clip.boolclip_compare = 0; if (use_ps(state)) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 398d3f5bffa..ccfd5f3f28e 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -10245,7 +10245,7 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
vshader = state->shader[WINED3D_SHADER_TYPE_VERTEX];
- find_vs_compile_args(state, vshader, context_gl->c.stream_info.swizzle_map, &vs_compile_args, &context_gl->c); + find_vs_compile_args(state, vshader, &vs_compile_args, &context_gl->c); vs_id = find_glsl_vertex_shader(context_gl, priv, vshader, &vs_compile_args); vs_list = &vshader->linked_programs; } diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 4374269b9a1..b34ec539014 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -3524,12 +3524,13 @@ static void init_interpolation_compile_args(DWORD *interpolation_args, }
void find_vs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, - WORD swizzle_map, struct vs_compile_args *args, const struct wined3d_context *context) + struct vs_compile_args *args, const struct wined3d_context *context) { const struct wined3d_shader *geometry_shader = state->shader[WINED3D_SHADER_TYPE_GEOMETRY]; const struct wined3d_shader *pixel_shader = state->shader[WINED3D_SHADER_TYPE_PIXEL]; const struct wined3d_shader *hull_shader = state->shader[WINED3D_SHADER_TYPE_HULL]; const struct wined3d_d3d_info *d3d_info = context->d3d_info; + WORD swizzle_map = context->stream_info.swizzle_map;
args->fog_src = state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3D_FOG_NONE ? VS_FOG_COORD : VS_FOG_Z; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index d5bc1e6c6c8..b0f8ea1bf93 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5562,8 +5562,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 BOOL vshader_get_input(const struct wined3d_shader *shader, BYTE usage_req, BYTE usage_idx_req, unsigned int *regnum) DECLSPEC_HIDDEN; void find_vs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, - WORD swizzle_map, struct vs_compile_args *args, - const struct wined3d_context *context) DECLSPEC_HIDDEN; + struct vs_compile_args *args, const struct wined3d_context *context) DECLSPEC_HIDDEN;
void find_ds_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, struct ds_compile_args *args, const struct wined3d_context *context) DECLSPEC_HIDDEN;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91539
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91533
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/d3dcompiler_43/reflection.c:1184 Task: Patch failed to apply