浏览代码

linker: Fix off-by-one error implicit array sizing

Arrays are zero based.  If the highest element accessed is 6, the
array needs to have 7 elements.

Fixes piglit test glsl-fs-implicit-array-size-03 and bugzilla #34198.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
tags/android-x86-2.2-r2
Ian Romanick 14 年前
父节点
当前提交
25b36e8ff8
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      src/glsl/linker.cpp

+ 1
- 1
src/glsl/linker.cpp 查看文件

@@ -926,7 +926,7 @@ link_intrastage_shaders(void *mem_ctx,
if (var->type->is_array() && (var->type->length == 0)) {
const glsl_type *type =
glsl_type::get_array_instance(var->type->fields.array,
var->max_array_access);
var->max_array_access + 1);

assert(type != NULL);
var->type = type;

正在加载...
取消
保存