[PATCH v3 3/6] wined3d: Add fetch4 to shader FFP generate texture stage

Henri Verbeet hverbeet at gmail.com
Tue Nov 27 13:32:20 CST 2018


On Sat, 24 Nov 2018 at 23:44, Daniel Ansorregui <mailszeros at gmail.com> wrote:
> - Tested under W10, when Fetch4 is enabled, projection is ignored
> - Untested what happens when Fetch4 is used on
>   unsupported textures. Disabling Fetch4 fttb.
> - The swizzle fix has been checked against windows
>   since it does not match with gather4
>
Could you submit those tests?

> @@ -9865,6 +9865,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
>              case WINED3D_GL_RES_TYPE_TEX_1D:
>                  texture_function = "texture1D";
>                  coord_mask = "x";
> +                fetch4 = FALSE;
>                  break;
>              case WINED3D_GL_RES_TYPE_TEX_2D:
>                  texture_function = "texture2D";
> @@ -9873,6 +9874,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
>              case WINED3D_GL_RES_TYPE_TEX_3D:
>                  texture_function = "texture3D";
>                  coord_mask = "xyz";
> +                fetch4 = FALSE;
>                  break;
>              case WINED3D_GL_RES_TYPE_TEX_CUBE:
>                  texture_function = "textureCube";
> @@ -9881,17 +9883,28 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
>              case WINED3D_GL_RES_TYPE_TEX_RECT:
>                  texture_function = "texture2DRect";
>                  coord_mask = "xy";
> +                if (fetch4)
> +                    FIXME("Unsupported Fetch4 and texture2DRect sampling");
> +                fetch4 = FALSE;
>                  break;
>              default:
>                  FIXME("Unhandled texture type %#x.\n", settings->op[stage].tex_type);
>                  texture_function = "";
>                  coord_mask = "xyzw";
>                  proj = FALSE;
> +                fetch4 = FALSE;
>                  break;
It may be nicer to just not set "fetch4" in gen_ffp_frag_op() for
those texture types.

>          if (!legacy_syntax)
>              texture_function = "texture";
>
> +        if (fetch4)
> +        {
> +            texture_function = "textureGather";
Does that work with a GL 3.2 context? Or without core contexts?

> @@ -5938,6 +5939,9 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
>          settings->op[i].aarg1 = aarg1;
>          settings->op[i].aarg2 = aarg2;
>          settings->op[i].tmp_dst = state->texture_states[i][WINED3D_TSS_RESULT_ARG] == WINED3DTA_TEMP;
> +        settings->op[i].fetch4 = state->textures[i] &&
> +                state->textures[i]->resource.format_flags & WINED3DFMT_FLAG_ALLOW_FETCH4 &&
> +                state->sampler_states[i][WINED3D_SAMP_MIPMAP_LOD_BIAS] == MAKEFOURCC('G','E','T','4');
Formatting.



More information about the wine-devel mailing list