@@ -3325,9 +3325,9 @@ bool SemaHLSL::initGlobalResourceDecl(VarDecl *VD) {
33253325 ASTContext &AST = SemaRef.getASTContext ();
33263326 uint64_t UIntTySize = AST.getTypeSize (AST.UnsignedIntTy );
33273327 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 (
33313331 AST, llvm::APInt (UIntTySize, 0 ), AST.UnsignedIntTy , SourceLocation ());
33323332 IntegerLiteral *Space =
33333333 IntegerLiteral::Create (AST, llvm::APInt (UIntTySize, SpaceNo),
@@ -3338,15 +3338,15 @@ bool SemaHLSL::initGlobalResourceDecl(VarDecl *VD) {
33383338 IntegerLiteral *RegSlot = IntegerLiteral::Create (
33393339 AST, llvm::APInt (UIntTySize, RegisterSlot.value ()), AST.UnsignedIntTy ,
33403340 SourceLocation ());
3341- Expr *Args[] = {RegSlot, Space, One, Zero };
3341+ Expr *Args[] = {RegSlot, Space, RangeSize, Index };
33423342 return initVarDeclWithCtor (SemaRef, VD, Args);
33433343 }
33443344
33453345 // resource with implicit binding
33463346 IntegerLiteral *OrderId = IntegerLiteral::Create (
33473347 AST, llvm::APInt (UIntTySize, getNextImplicitBindingOrderID ()),
33483348 AST.UnsignedIntTy , SourceLocation ());
3349- Expr *Args[] = {Space, One, Zero , OrderId};
3349+ Expr *Args[] = {Space, RangeSize, Index , OrderId};
33503350 return initVarDeclWithCtor (SemaRef, VD, Args);
33513351}
33523352
0 commit comments