wined3d: Recompute sampler count before allocating sampler range for compute shaders.

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-03-15 12:00:08 +01:00 committed by Alexandre Julliard
parent 09fa9fbcf1
commit 8ca5577ed1
1 changed files with 3 additions and 1 deletions

View File

@ -3716,7 +3716,9 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
/* A majority of OpenGL implementations allow us to statically partition /* A majority of OpenGL implementations allow us to statically partition
* the set of texture bindings into six separate sets. */ * the set of texture bindings into six separate sets. */
gl_info->limits.graphics_samplers = gl_info->limits.combined_samplers; gl_info->limits.graphics_samplers = gl_info->limits.combined_samplers;
sampler_count += gl_info->limits.samplers[WINED3D_SHADER_TYPE_COMPUTE]; sampler_count = 0;
for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i)
sampler_count += gl_info->limits.samplers[i];
if (gl_info->limits.combined_samplers >= sampler_count) if (gl_info->limits.combined_samplers >= sampler_count)
gl_info->limits.graphics_samplers -= gl_info->limits.samplers[WINED3D_SHADER_TYPE_COMPUTE]; gl_info->limits.graphics_samplers -= gl_info->limits.samplers[WINED3D_SHADER_TYPE_COMPUTE];
} }