From 3f3b3e1772b36868caf7ee3bdba5de04b00ae9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 21 Feb 2017 13:24:46 +0100 Subject: [PATCH] wined3d: Store actual GL_MAX_TEXTURE_IMAGE_UNITS in "fragment_samplers". MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/directx.c | 2 +- dlls/wined3d/state.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 56193da27c8..83423251df1 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -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 { diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 83a6cae29d2..07f1263fd66 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -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;