Re: [1/5] wined3d: Make d3d_level_from_gl_info return an enum instead of a plain int
On 1 August 2014 20:25, Andrei Slăvoiu <andrei.slavoiu(a)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.
On Monday 04 August 2014 16:24:19 Henri Verbeet wrote:
- 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.
WINED3D_D3D_LEVEL_9_SM3 is checked by select_card_fallback_nvidia. More likely I should add a check for gl_info->supported[NV_VERTEX_PROGRAM3] in d3d_level_from_gl_info to keep the old behavior.
On 4 August 2014 16:41, Andrei Slavoiu <andrei.slavoiu(a)gmail.com> wrote:
WINED3D_D3D_LEVEL_9_SM3 is checked by select_card_fallback_nvidia. More likely I should add a check for gl_info->supported[NV_VERTEX_PROGRAM3] in d3d_level_from_gl_info to keep the old behavior. Yes, but in a separate patch. The point is that you want to only change a single thing at a time as much as possible.
participants (2)
-
Andrei Slavoiu -
Henri Verbeet