wined3d: Store actual GL_MAX_TEXTURE_IMAGE_UNITS in "fragment_samplers".

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-02-21 13:24:46 +01:00 committed by Alexandre Julliard
parent 9acc780aad
commit 3f3b3e1772
2 changed files with 2 additions and 2 deletions

View File

@ -3419,7 +3419,7 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, &gl_max);
gl_info->limits.texture_coords = min(MAX_TEXTURES, gl_max);
gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &gl_max);
gl_info->limits.fragment_samplers = min(MAX_FRAGMENT_SAMPLERS, gl_max);
gl_info->limits.fragment_samplers = gl_max;
}
else
{

View File

@ -3323,7 +3323,7 @@ static void tex_coordindex(struct wined3d_context *context, const struct wined3d
return;
}
if (mapped_stage >= gl_info->limits.fragment_samplers)
if (mapped_stage >= min(gl_info->limits.fragment_samplers, MAX_FRAGMENT_SAMPLERS))
{
WARN("stage %u not mapped to a valid texture unit (%u)\n", stage, mapped_stage);
return;