Commit 0717d00c authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Don't query FFP lights count on core profile.

parent c6adf8af
...@@ -1730,10 +1730,11 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN ...@@ -1730,10 +1730,11 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
} }
else else
{ {
unsigned int light_count = device->adapter->d3d_info.limits.active_light_count;
unsigned int i; unsigned int i;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
/* Find a free GL light. */ /* Find a free light. */
for (i = 0; i < gl_info->limits.lights; ++i) for (i = 0; i < light_count; ++i)
{ {
if (!device->update_state->lights[i]) if (!device->update_state->lights[i])
{ {
......
...@@ -3361,9 +3361,12 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info) ...@@ -3361,9 +3361,12 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
gl_info->limits.user_clip_distances = min(MAX_CLIP_DISTANCES, gl_max); gl_info->limits.user_clip_distances = min(MAX_CLIP_DISTANCES, gl_max);
TRACE("Clip plane support - max planes %d.\n", gl_max); TRACE("Clip plane support - max planes %d.\n", gl_max);
if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
{
gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_LIGHTS, &gl_max); gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_LIGHTS, &gl_max);
gl_info->limits.lights = gl_max; gl_info->limits.lights = gl_max;
TRACE("Light support - max lights %d.\n", gl_max); TRACE("Light support - max lights %d.\n", gl_max);
}
gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max); gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max);
gl_info->limits.texture_size = gl_max; gl_info->limits.texture_size = gl_max;
...@@ -4003,6 +4006,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, DWORD ...@@ -4003,6 +4006,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, DWORD
adapter->d3d_info.xyzrhw = vertex_caps.xyzrhw; adapter->d3d_info.xyzrhw = vertex_caps.xyzrhw;
adapter->d3d_info.ffp_generic_attributes = vertex_caps.ffp_generic_attributes; adapter->d3d_info.ffp_generic_attributes = vertex_caps.ffp_generic_attributes;
adapter->d3d_info.limits.ffp_vertex_blend_matrices = vertex_caps.max_vertex_blend_matrices; adapter->d3d_info.limits.ffp_vertex_blend_matrices = vertex_caps.max_vertex_blend_matrices;
adapter->d3d_info.limits.active_light_count = vertex_caps.max_active_lights;
adapter->d3d_info.emulated_flatshading = vertex_caps.emulated_flatshading; adapter->d3d_info.emulated_flatshading = vertex_caps.emulated_flatshading;
adapter->fragment_pipe->get_caps(gl_info, &fragment_caps); adapter->fragment_pipe->get_caps(gl_info, &fragment_caps);
......
...@@ -2219,6 +2219,7 @@ struct wined3d_d3d_limits ...@@ -2219,6 +2219,7 @@ struct wined3d_d3d_limits
UINT ffp_textures; UINT ffp_textures;
UINT ffp_blend_stages; UINT ffp_blend_stages;
UINT ffp_vertex_blend_matrices; UINT ffp_vertex_blend_matrices;
unsigned int active_light_count;
}; };
typedef void (WINE_GLAPI *wined3d_ffp_attrib_func)(const void *data); typedef void (WINE_GLAPI *wined3d_ffp_attrib_func)(const void *data);
......
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