[1/5] wined3d: Make d3d_level_from_gl_info return an enum instead of a plain int
Henri Verbeet
hverbeet at gmail.com
Mon Aug 4 09:24:19 CDT 2014
On 1 August 2014 20:25, Andrei Slăvoiu <andrei.slavoiu at gmail.com> wrote:
> -static UINT d3d_level_from_gl_info(const struct wined3d_gl_info *gl_info)
> +static enum wined3d_d3d_level d3d_level_from_gl_info(const struct wined3d_gl_info *gl_info)
> {
> - UINT level = 0;
> + enum wined3d_d3d_level level = WINED3D_D3D_LEVEL_5;
>
> if (gl_info->supported[ARB_MULTITEXTURE])
> - level = 6;
> + level = WINED3D_D3D_LEVEL_6;
> if (gl_info->supported[ARB_TEXTURE_COMPRESSION]
> && gl_info->supported[ARB_TEXTURE_CUBE_MAP]
> && gl_info->supported[ARB_TEXTURE_ENV_DOT3])
> - level = 7;
> - if (level == 7 && gl_info->supported[ARB_MULTISAMPLE]
> + level = WINED3D_D3D_LEVEL_7;
> + if (level == WINED3D_D3D_LEVEL_7 && gl_info->supported[ARB_MULTISAMPLE]
> && gl_info->supported[ARB_TEXTURE_BORDER_CLAMP])
> - level = 8;
> - if (level == 8 && gl_info->supported[ARB_FRAGMENT_PROGRAM]
> + level = WINED3D_D3D_LEVEL_8;
> + if (level == WINED3D_D3D_LEVEL_8 && gl_info->supported[ARB_FRAGMENT_PROGRAM]
> && gl_info->supported[ARB_VERTEX_SHADER])
> - level = 9;
> - if (level == 9 && (gl_info->supported[EXT_GPU_SHADER4]
> + level = WINED3D_D3D_LEVEL_9_SM2;
> + if (level == WINED3D_D3D_LEVEL_9_SM2 && (gl_info->supported[EXT_GPU_SHADER4]
> || gl_info->glsl_version >= MAKEDWORD_VERSION(1, 30)))
> - level = 10;
> + level = WINED3D_D3D_LEVEL_10;
>
> return level;
> }
...
> - if (d3d_level >= 9 && gl_info->supported[NV_VERTEX_PROGRAM3])
> + if (d3d_level >= WINED3D_D3D_LEVEL_9_SM3)
You never return WINED3D_D3D_LEVEL_9_SM3 from
d3d_level_from_gl_info(). I'd recommend to just introduce
WINED3D_D3D_LEVEL_9 in this patch, and split it up in _SM2 and _SM3 in
a separate patch.
More information about the wine-devel
mailing list