[PATCH 5/5] wined3d: Alpha test emulation for core profile contexts.
Henri Verbeet
hverbeet at gmail.com
Thu Mar 31 15:58:28 CDT 2016
On 31 March 2016 at 19:51, Matteo Bruni <mbruni at codeweavers.com> wrote:
> + shader_addline(buffer, "if (alpha_test)\n");
> + if (alpha_func != WINED3D_CMP_NEVER)
> + shader_addline(buffer, " if (!(%s[0].a %s alpha_ref))\n",
> + get_fragment_output(gl_info), comparison_operator[alpha_func - WINED3D_CMP_NEVER]);
> + shader_addline(buffer, " discard;\n");
Is there really an advantage to having the "alpha_test" uniform
instead of just mapping disabled alpha test to WINED3D_CMP_ALWAYS?
> @@ -973,6 +981,7 @@ struct ps_compile_args {
> WORD texcoords_initialized; /* MAX_TEXTURES, 8 */
> BOOL pointsprite;
> BOOL flatshading;
> + enum wined3d_cmp_func alpha_func;
> };
>
> enum fog_src_type {
> @@ -2022,6 +2031,7 @@ struct ffp_frag_settings
> unsigned char pointsprite : 1;
> unsigned char flatshading : 1;
> unsigned char padding : 5;
> + enum wined3d_cmp_func alpha_func;
"alpha_func" only needs 4 bits (3 if you just mask the 4th bit), so
would still fit in the padding. That applies somewhat to struct
ps_compile_args as well, although we may care less there.
More information about the wine-devel
mailing list