Commit efc18d79 authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

wined3d: Detect vertex shader 2.0 support using a pixel shader 2.0 limit.

Without this vertex shader 3.0 is reported on non-Nvidia cards that only support vertex shader 2.0. Reporting 3.0 would result in slow software rendering as it is much more advanced than 2.0.
parent 6760ce83
...@@ -2367,10 +2367,13 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, ...@@ -2367,10 +2367,13 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
if (vs_selected_mode == SHADER_GLSL) { if (vs_selected_mode == SHADER_GLSL) {
/* Nvidia Geforce6/7 or Ati R4xx/R5xx cards with GLSL support, support VS 3.0 but older Nvidia/Ati /* Nvidia Geforce6/7 or Ati R4xx/R5xx cards with GLSL support, support VS 3.0 but older Nvidia/Ati
models with GLSL support only support 2.0. In case of nvidia we can detect VS 2.0 support using * models with GLSL support only support 2.0. In case of nvidia we can detect VS 2.0 support using
vs_nv_version which is based on NV_vertex_program. For Ati cards there's no easy way, so for * vs_nv_version which is based on NV_vertex_program.
now only support 2.0/3.0 detection on Nvidia GeforceFX cards and default to 3.0 for everything else */ * For Ati cards there's no way using glsl (it abstracts the lowlevel info away) and also not
if(GLINFO_LOCATION.vs_nv_version == VS_VERSION_20) * using ARB_vertex_program. It is safe to assume that when a card supports pixel shader 2.0 it
* supports vertex shader 2.0 too and the way around. We can detect ps2.0 using the maximum number
* of native instructions, so use that here. For more info see the pixel shader versioning code below. */
if((GLINFO_LOCATION.vs_nv_version == VS_VERSION_20) || (GLINFO_LOCATION.ps_arb_max_instructions <= 512))
*pCaps->VertexShaderVersion = WINED3DVS_VERSION(2,0); *pCaps->VertexShaderVersion = WINED3DVS_VERSION(2,0);
else else
*pCaps->VertexShaderVersion = WINED3DVS_VERSION(3,0); *pCaps->VertexShaderVersion = WINED3DVS_VERSION(3,0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment