[PATCH v5 2/4] wined3d: Add fetch4 to shader FFP generate texture stage

Stefan Dösinger stefandoesinger at gmail.com
Thu Feb 14 10:03:24 CST 2019



> Am 11.02.2019 um 14:48 schrieb Daniel Ansorregui <mailszeros at gmail.com>:
> 
> @@ -9879,6 +9883,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";
> @@ -9887,6 +9892,9 @@ 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";
> +                if (fetch4)
> +                    FIXME("Unsupported Fetch4 and texture3D sampling");
> +                fetch4 = FALSE;
>                 break;
>             case WINED3D_GL_RES_TYPE_TEX_CUBE:
>                 texture_function = "textureCube";
> @@ -9901,11 +9909,24 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
>                 texture_function = "";
>                 coord_mask = "xyzw";
>                 proj = FALSE;
> +                fetch4 = FALSE;
I think this is dead code, now that you are filtering for WINED3D_GL_RES_TYPE_TEX_2D or WINED3D_GL_RES_TYPE_TEX_RECT in gen_ffp_frag_op?

>         else if (settings->op[stage].projected == WINED3D_PROJECTION_COUNT3)
>         {
> -            shader_addline(buffer, "tex%u = %s%s(ps_sampler%u, ffp_texcoord[%u].xyz);\n",
> -                    stage, texture_function, proj ? "Proj" : "", stage, stage);
> +            shader_addline(buffer, "tex%u = %s%s(ps_sampler%u, ffp_texcoord[%u].xyz%s);\n", stage,
> +                    texture_function, proj ? "Proj" : "", stage, stage, offset.buffer);
>         }
>         else
>         {
> -            shader_addline(buffer, "tex%u = %s%s(ps_sampler%u, ffp_texcoord[%u].%s%s);\n",
> -                    stage, texture_function, proj ? "Proj" : "", stage, stage, coord_mask, proj ? "w" : "");
> +            shader_addline(buffer, "tex%u = %s%s(ps_sampler%u, ffp_texcoord[%u].%s%s", stage,
> +                    texture_function, proj ? "Proj" : "", stage, stage, coord_mask, proj ? "w" : "");
> +            if (fetch4_proj)
> +                shader_addline(buffer, " / ffp_texcoord[%u].w", stage);
> +            shader_addline(buffer, "%s);\n", offset.buffer);
Why don't you have to do the manual divide in the WINED3D_PROJECTION_COUNT3 case too? (in that case, divide by /z)? Your code may be right, I am not 100% sure about it.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20190214/0d209f75/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20190214/0d209f75/attachment-0001.sig>


More information about the wine-devel mailing list