From dd954de6e077fa76aab7a284659cf9275ef1f275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 5 Mar 2015 17:08:34 +0100 Subject: [PATCH] shader: fix uniform buffer object size Size of array is Range.Last+1, like other declarations Fixes piglit spec/glsl-1.40/uniform_buffer/fs-basic --- src/vrend_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 10bdd48..a53ee2d 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -511,7 +511,7 @@ iter_declaration(struct tgsi_iterate_context *iter, case TGSI_FILE_CONSTANT: if (decl->Declaration.Dimension) { ctx->ubo_idx[ctx->num_ubo] = decl->Dim.Index2D; - ctx->ubo_sizes[ctx->num_ubo] = decl->Range.Last; + ctx->ubo_sizes[ctx->num_ubo] = decl->Range.Last + 1; ctx->num_ubo++; } else { if (decl->Range.Last) {