<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 15.02.2016 22:44, Samuel Pitoiset
wrote:<br>
</div>
<blockquote
cite="mid:1455572679-23161-1-git-send-email-samuel.pitoiset@gmail.com"
type="cite">
<pre wrap="">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 7c79c1e (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 <a class="moz-txt-link-rfc2396E" href="mailto:samuel.pitoiset@gmail.com"><samuel.pitoiset@gmail.com></a>
Reported-by: Tobias Klausmann <a class="moz-txt-link-rfc2396E" href="mailto:tobias.johannes.klausmann@mni.thm.de"><tobias.johannes.klausmann@mni.thm.de></a>
Tested-by: Tobias Klausmann <a class="moz-txt-link-rfc2396E" href="mailto:tobias.johannes.klausmann@mni.thm.de"><tobias.johannes.klausmann@mni.thm.de></a>
---
src/mesa/state_tracker/st_extensions.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index bdfbded..2f5d3f7 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -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,
case PIPE_SHADER_COMPUTE:
pc = &c->Program[MESA_SHADER_COMPUTE];
options = &c->ShaderCompilerOptions[MESA_SHADER_COMPUTE];
+
+ if (!screen->get_param(screen, PIPE_CAP_COMPUTE))
+ continue;
+ supported_irs =
+ screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUPPORTED_IRS);
+ if (!(supported_irs & (1 << PIPE_SHADER_IR_TGSI)))
+ continue;
break;
default:
assert(0);
</pre>
</blockquote>
<br>
<pre wrap="">Reviewed-by: Tobias Klausmann <a class="moz-txt-link-rfc2396E" href="mailto:tobias.johannes.klausmann@mni.thm.de"><tobias.johannes.klausmann@mni.thm.de></a></pre>
</body>
</html>