Commit c74c544c authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Store maximum vertex attributes count.

parent afeecfd9
......@@ -2253,6 +2253,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
gl_info->limits.vertex_samplers = 0;
gl_info->limits.combined_samplers = gl_info->limits.fragment_samplers + gl_info->limits.vertex_samplers;
gl_info->limits.sampler_stages = 1;
gl_info->limits.vertex_attribs = 16;
gl_info->limits.glsl_vs_float_constants = 0;
gl_info->limits.glsl_ps_float_constants = 0;
gl_info->limits.arb_vs_float_constants = 0;
......@@ -2446,6 +2447,8 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
gl_info->limits.vertex_samplers = tmp;
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, &tmp);
gl_info->limits.combined_samplers = tmp;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS_ARB, &tmp);
gl_info->limits.vertex_attribs = tmp;
/* Loading GLSL sampler uniforms is much simpler if we can assume that the sampler setup
* is known at shader link time. In a vertex shader + pixel shader combination this isn't
......
......@@ -3999,15 +3999,9 @@ static inline void unload_numbered_array(struct wined3d_context *context, int i)
static void unload_numbered_arrays(struct wined3d_context *context)
{
/* disable any attribs (this is the same for both GLSL and ARB modes) */
GLint maxAttribs = 16;
int i;
/* Leave all the attribs disabled */
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS_ARB, &maxAttribs);
/* MESA does not support it right not */
if (glGetError() != GL_NO_ERROR)
maxAttribs = 16;
for (i = 0; i < maxAttribs; ++i) {
for (i = 0; i < context->gl_info->limits.vertex_attribs; ++i) {
unload_numbered_array(context, i);
}
}
......
......@@ -1456,6 +1456,7 @@ struct wined3d_gl_limits
UINT anisotropy;
float shininess;
UINT samples;
UINT vertex_attribs;
UINT glsl_varyings;
UINT glsl_vs_float_constants;
......
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