Commit 09446cf5 authored by Samuel Pitoiset's avatar Samuel Pitoiset

st/mesa: do not init limits when compute shaders are not supported

When the number of uniform blocks is less than 12,
ARB_uniform_buffer_object can't be enabled and the maximum GL version
is not even 3.1...

This fixes a regression introduced in 7c79c1e3 (st/mesa: add compute
shader state) if the maximum number of uniform blocks allowed for
compute shaders is less than 12. This happens on Kepler but this might
also affect other Gallium drivers.
Signed-off-by: Samuel Pitoiset's avatarSamuel Pitoiset <>
Reported-by: default avatarTobias Klausmann <>
Tested-by: default avatarTobias Klausmann <>
Reviewed-by: Ilia Mirkin's avatarIlia Mirkin <>
Reviewed-by: default avatarTobias Klausmann <>
parent f28d80fa
......@@ -75,6 +75,7 @@ static int _clamp(int a, int min, int max)
void st_init_limits(struct pipe_screen *screen,
struct gl_constants *c, struct gl_extensions *extensions)
int supported_irs;
unsigned sh;
boolean can_ubo = TRUE;
......@@ -177,6 +178,13 @@ void st_init_limits(struct pipe_screen *screen,
pc = &c->Program[MESA_SHADER_COMPUTE];
options = &c->ShaderCompilerOptions[MESA_SHADER_COMPUTE];
if (!screen->get_param(screen, PIPE_CAP_COMPUTE))
supported_irs =
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUPPORTED_IRS);
if (!(supported_irs & (1 << PIPE_SHADER_IR_TGSI)))
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