From 77594e86248510e2cb90e567dd36bf661b9fb73b Mon Sep 17 00:00:00 2001 From: Young Kim Date: Mon, 20 Nov 2017 20:04:54 -0800 Subject: [PATCH] Change rangeID parameter for CreateHandle to const (#833) --- include/dxc/HLSL/DxilInstructions.h | 2 ++ utils/hct/hctdb.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/dxc/HLSL/DxilInstructions.h b/include/dxc/HLSL/DxilInstructions.h index 6760c59eb..e35774bff 100644 --- a/include/dxc/HLSL/DxilInstructions.h +++ b/include/dxc/HLSL/DxilInstructions.h @@ -2190,6 +2190,8 @@ struct DxilInst_CreateHandle { void set_resourceClass_val(int8_t val) { Instr->setOperand(1, llvm::Constant::getIntegerValue(llvm::IntegerType::get(Instr->getContext(), 8), llvm::APInt(8, (uint64_t)val))); } llvm::Value *get_rangeId() const { return Instr->getOperand(2); } void set_rangeId(llvm::Value *val) { Instr->setOperand(2, val); } + int32_t get_rangeId_val() const { return (int32_t)(llvm::dyn_cast(Instr->getOperand(2))->getZExtValue()); } + void set_rangeId_val(int32_t val) { Instr->setOperand(2, llvm::Constant::getIntegerValue(llvm::IntegerType::get(Instr->getContext(), 32), llvm::APInt(32, (uint64_t)val))); } llvm::Value *get_index() const { return Instr->getOperand(3); } void set_index(llvm::Value *val) { Instr->setOperand(3, val); } llvm::Value *get_nonUniformIndex() const { return Instr->getOperand(4); } diff --git a/utils/hct/hctdb.py b/utils/hct/hctdb.py index 71e567d79..e804a3a58 100644 --- a/utils/hct/hctdb.py +++ b/utils/hct/hctdb.py @@ -547,7 +547,7 @@ class db_dxil(object): self.add_dxil_op("CreateHandle", next_op_idx, "CreateHandle", "creates the handle to a resource", "v", "ro", [ db_dxil_param(0, "res", "", "the handle to the resource"), db_dxil_param(2, "i8", "resourceClass", "the class of resource to create (SRV, UAV, CBuffer, Sampler)", is_const=True), # maps to DxilResourceBase::Class - db_dxil_param(3, "i32", "rangeId", "range identifier for resource"), + db_dxil_param(3, "i32", "rangeId", "range identifier for resource", is_const=True), db_dxil_param(4, "i32", "index", "zero-based index into range"), db_dxil_param(5, "i1", "nonUniformIndex", "non-uniform resource index", is_const=True)]) next_op_idx += 1