Fixed MAXINT array size limitation
This commit is contained in:
9
expr.cpp
9
expr.cpp
@@ -4620,10 +4620,11 @@ IndexExpr::TypeCheck() {
|
|||||||
// 64-bit target with 64-bit addressing, convert the index to an int32
|
// 64-bit target with 64-bit addressing, convert the index to an int32
|
||||||
// type.
|
// type.
|
||||||
// The range of varying index is limited to [0,2^31) as a result.
|
// The range of varying index is limited to [0,2^31) as a result.
|
||||||
if (Type::EqualIgnoringConst(indexType->GetAsUniformType(),
|
if (!(Type::EqualIgnoringConst(indexType->GetAsUniformType(),
|
||||||
AtomicType::UniformInt64) == false ||
|
AtomicType::UniformUInt64) ||
|
||||||
g->target->is32Bit() ||
|
Type::EqualIgnoringConst(indexType->GetAsUniformType(),
|
||||||
g->opt.force32BitAddressing) {
|
AtomicType::UniformInt64)) ||
|
||||||
|
g->target->is32Bit() || g->opt.force32BitAddressing) {
|
||||||
const Type *indexType = AtomicType::VaryingInt32;
|
const Type *indexType = AtomicType::VaryingInt32;
|
||||||
index = TypeConvertExpr(index, indexType, "array index");
|
index = TypeConvertExpr(index, indexType, "array index");
|
||||||
if (index == NULL)
|
if (index == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user