@@ -3325,9 +3325,9 @@ bool SemaHLSL::initGlobalResourceDecl(VarDecl *VD) {
3325
3325
ASTContext &AST = SemaRef.getASTContext ();
3326
3326
uint64_t UIntTySize = AST.getTypeSize (AST.UnsignedIntTy );
3327
3327
uint64_t IntTySize = AST.getTypeSize (AST.IntTy );
3328
- IntegerLiteral *One = IntegerLiteral::Create (AST, llvm::APInt (IntTySize, 1 ),
3329
- AST.IntTy , SourceLocation ());
3330
- IntegerLiteral *Zero = IntegerLiteral::Create (
3328
+ IntegerLiteral *RangeSize = IntegerLiteral::Create (
3329
+ AST, llvm::APInt (IntTySize, 1 ), AST.IntTy , SourceLocation ());
3330
+ IntegerLiteral *Index = IntegerLiteral::Create (
3331
3331
AST, llvm::APInt (UIntTySize, 0 ), AST.UnsignedIntTy , SourceLocation ());
3332
3332
IntegerLiteral *Space =
3333
3333
IntegerLiteral::Create (AST, llvm::APInt (UIntTySize, SpaceNo),
@@ -3338,15 +3338,15 @@ bool SemaHLSL::initGlobalResourceDecl(VarDecl *VD) {
3338
3338
IntegerLiteral *RegSlot = IntegerLiteral::Create (
3339
3339
AST, llvm::APInt (UIntTySize, RegisterSlot.value ()), AST.UnsignedIntTy ,
3340
3340
SourceLocation ());
3341
- Expr *Args[] = {RegSlot, Space, One, Zero };
3341
+ Expr *Args[] = {RegSlot, Space, RangeSize, Index };
3342
3342
return initVarDeclWithCtor (SemaRef, VD, Args);
3343
3343
}
3344
3344
3345
3345
// resource with implicit binding
3346
3346
IntegerLiteral *OrderId = IntegerLiteral::Create (
3347
3347
AST, llvm::APInt (UIntTySize, getNextImplicitBindingOrderID ()),
3348
3348
AST.UnsignedIntTy , SourceLocation ());
3349
- Expr *Args[] = {Space, One, Zero , OrderId};
3349
+ Expr *Args[] = {Space, RangeSize, Index , OrderId};
3350
3350
return initVarDeclWithCtor (SemaRef, VD, Args);
3351
3351
}
3352
3352
0 commit comments