Re: [PATCH 4/8] wined3d: Allow using more than MAX_COMBINED_SAMPLERS texture image units.
2017-03-14 13:15 GMT+01:00 Józef Kucia <jkucia(a)codeweavers.com>:
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index b1cda46..6fe96e4 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -5994,40 +5994,28 @@ void wined3d_gl_limits_get_uniform_block_range(const struct wined3d_gl_limits *g void wined3d_gl_limits_get_texture_unit_range(const struct wined3d_gl_limits *gl_limits, enum wined3d_shader_type shader_type, unsigned int *base, unsigned int *count) { - static const struct + if (shader_type == WINED3D_SHADER_TYPE_COMPUTE) { - enum wined3d_shader_type type; - unsigned int base_idx; - unsigned int count; + if (gl_limits->combined_samplers == gl_limits->graphics_samplers) + *base = 0; + else + *base = gl_limits->graphics_samplers - 1; + *count = gl_limits->compute_samplers; + return; }
Late to the party and not really important but shouldn't *base in the else case be set to gl_limits->graphics_samplers (i.e. without the "- 1")?
On Wed, Mar 15, 2017 at 11:48 PM, Matteo Bruni <matteo.mystral(a)gmail.com> wrote:
2017-03-14 13:15 GMT+01:00 Józef Kucia <jkucia(a)codeweavers.com>:
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index b1cda46..6fe96e4 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -5994,40 +5994,28 @@ void wined3d_gl_limits_get_uniform_block_range(const struct wined3d_gl_limits *g void wined3d_gl_limits_get_texture_unit_range(const struct wined3d_gl_limits *gl_limits, enum wined3d_shader_type shader_type, unsigned int *base, unsigned int *count) { - static const struct + if (shader_type == WINED3D_SHADER_TYPE_COMPUTE) { - enum wined3d_shader_type type; - unsigned int base_idx; - unsigned int count; + if (gl_limits->combined_samplers == gl_limits->graphics_samplers) + *base = 0; + else + *base = gl_limits->graphics_samplers - 1; + *count = gl_limits->compute_samplers; + return; }
Late to the party and not really important but shouldn't *base in the else case be set to gl_limits->graphics_samplers (i.e. without the "- 1")?
You're right. Thanks for catching that.
participants (2)
-
Józef Kucia -
Matteo Bruni