[PATCH 3/8] wined3d: Simplify shader interface matching for SM4+ vertex shaders.

Henri Verbeet hverbeet at gmail.com
Wed Apr 20 05:50:41 CDT 2016


On 19 April 2016 at 18:56, Matteo Bruni <mbruni at codeweavers.com> wrote:
> After some testing it looks like, with SM4+ on Windows:
> 1. Output registers have to match with input registers from the
> following shader stage (register index and mask). There is no "smart"
> matching of semantics like in SM3.
> 2. Using uninitialized varyings in SM4+ shaders doesn't give consistent
> results.
> That means we can simplify the relevant code quite a bit. Applications
> shouldn't be able to depend on particular values for uninitialized
> varyings so we can avoid explicitly initializing them.
>
Does that mean we don't need the separate "reorder" shader between the
stages? (Even more so if we have separate shader objects.)

On 19 April 2016 at 18:56, Matteo Bruni <mbruni at codeweavers.com> wrote:
> -static void shader_glsl_setup_shader_output(struct shader_glsl_priv *priv,
> +static void shader_glsl_setup_vs3_output(struct shader_glsl_priv *priv,
>          const struct wined3d_gl_info *gl_info, const DWORD *map,
>          const struct wined3d_shader_signature *input_signature,
>          const struct wined3d_shader_reg_maps *reg_maps_in,
>          const struct wined3d_shader_signature *output_signature,
> -        const struct wined3d_shader_reg_maps *reg_maps_out, const char *out_array_name)
> +        const struct wined3d_shader_reg_maps *reg_maps_out)
>  {
>      struct wined3d_string_buffer *destination = string_buffer_get(&priv->string_buffers);
>      BOOL legacy_context = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT];
> @@ -5191,7 +5191,7 @@ static void shader_glsl_setup_shader_output(struct shader_glsl_priv *priv,
>          else if (in_idx == in_count + 1)
>              string_buffer_sprintf(destination, "gl_FrontSecondaryColor");
>          else
> -            string_buffer_sprintf(destination, "%s[%u]", out_array_name, in_idx);
> +            string_buffer_sprintf(destination, "%s[%u]", "ps_link", in_idx);
>
>          if (!set[in_idx])
>              set[in_idx] = ~0u;
> @@ -5243,7 +5243,7 @@ static void shader_glsl_setup_shader_output(struct shader_glsl_priv *priv,
>          else if (i == in_count + 1)
>              string_buffer_sprintf(destination, "gl_FrontSecondaryColor");
>          else
> -            string_buffer_sprintf(destination, "%s[%u]", out_array_name, i);
> +            string_buffer_sprintf(destination, "%s[%u]", "ps_link", i);
>
>          if (size == 1)
>              shader_addline(buffer, "%s.%s = 0.0;\n", destination->buffer, reg_mask);
This looks like you should have just kept it the way it was in the
previous patch.



More information about the wine-patches mailing list