wined3d: Make sure all fields of the shader backend caps are always initialized.

This commit is contained in:
Henri Verbeet 2010-04-29 23:41:30 +02:00 committed by Alexandre Julliard
parent c9e7561b34
commit 0122cee51f
4 changed files with 14 additions and 7 deletions

View file

@ -4667,11 +4667,6 @@ static void shader_arb_get_caps(const struct wined3d_gl_info *gl_info, struct sh
DWORD vs_consts = min(gl_info->limits.arb_vs_float_constants, gl_info->limits.arb_vs_native_constants);
DWORD ps_consts = min(gl_info->limits.arb_ps_float_constants, gl_info->limits.arb_ps_native_constants);
/* We don't have an ARB fixed function pipeline yet, so let the none backend set its caps,
* then overwrite the shader specific ones
*/
none_shader_backend.shader_get_caps(gl_info, pCaps);
if (gl_info->supported[ARB_VERTEX_PROGRAM])
{
if (gl_info->supported[NV_VERTEX_PROGRAM3])
@ -4692,6 +4687,11 @@ static void shader_arb_get_caps(const struct wined3d_gl_info *gl_info, struct sh
}
pCaps->MaxVertexShaderConst = vs_consts;
}
else
{
pCaps->VertexShaderVersion = 0;
pCaps->MaxVertexShaderConst = 0;
}
if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
{
@ -4714,6 +4714,12 @@ static void shader_arb_get_caps(const struct wined3d_gl_info *gl_info, struct sh
pCaps->PixelShader1xMaxValue = 8.0f;
pCaps->MaxPixelShaderConst = ps_consts;
}
else
{
pCaps->PixelShaderVersion = 0;
pCaps->PixelShader1xMaxValue = 0.0f;
pCaps->MaxPixelShaderConst = 0;
}
pCaps->VSClipping = use_nv_clip(gl_info);
}

View file

@ -7086,7 +7086,6 @@ HRESULT device_init(IWineD3DDeviceImpl *device, IWineD3DImpl *wined3d,
select_shader_mode(&adapter->gl_info, &device->ps_selected_mode, &device->vs_selected_mode);
device->shader_backend = adapter->shader_backend;
memset(&shader_caps, 0, sizeof(shader_caps));
device->shader_backend->shader_get_caps(&adapter->gl_info, &shader_caps);
device->d3d_vshader_constantF = shader_caps.MaxVertexShaderConst;
device->d3d_pshader_constantF = shader_caps.MaxPixelShaderConst;

View file

@ -4542,7 +4542,6 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
WINED3DPTFILTERCAPS_MAGFLINEAR;
pCaps->VertexTextureFilterCaps = 0;
memset(&shader_caps, 0, sizeof(shader_caps));
adapter->shader_backend->shader_get_caps(&adapter->gl_info, &shader_caps);
adapter->fragment_pipe->get_caps(&adapter->gl_info, &fragment_caps);

View file

@ -1418,8 +1418,11 @@ static void shader_none_get_caps(const struct wined3d_gl_info *gl_info, struct s
{
/* Set the shader caps to 0 for the none shader backend */
caps->VertexShaderVersion = 0;
caps->MaxVertexShaderConst = 0;
caps->PixelShaderVersion = 0;
caps->PixelShader1xMaxValue = 0.0f;
caps->MaxPixelShaderConst = 0;
caps->VSClipping = FALSE;
}
static BOOL shader_none_color_fixup_supported(struct color_fixup_desc fixup)