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
macos/master
Marc-André Lureau 10 years ago committed by Dave Airlie
parent dbd90fb682
commit dd954de6e0
  1. 2
      src/vrend_shader.c

@ -511,7 +511,7 @@ iter_declaration(struct tgsi_iterate_context *iter,
case TGSI_FILE_CONSTANT: case TGSI_FILE_CONSTANT:
if (decl->Declaration.Dimension) { if (decl->Declaration.Dimension) {
ctx->ubo_idx[ctx->num_ubo] = decl->Dim.Index2D; 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++; ctx->num_ubo++;
} else { } else {
if (decl->Range.Last) { if (decl->Range.Last) {

Loading…
Cancel
Save