mirror of
https://github.com/yuzu-emu/sirit.git
synced 2024-12-22 19:05:31 +00:00
Replace "auto const" with "auto"
This commit is contained in:
parent
f581df0935
commit
6a2d1da742
|
@ -11,7 +11,7 @@ namespace Sirit {
|
|||
|
||||
Ref Module::Decorate(Ref target, spv::Decoration decoration,
|
||||
const std::vector<Operand*>& literals) {
|
||||
auto const op{new Op(spv::Op::OpDecorate)};
|
||||
auto op{new Op(spv::Op::OpDecorate)};
|
||||
op->Add(target);
|
||||
AddEnum(op, decoration);
|
||||
op->Sink(literals);
|
||||
|
|
|
@ -19,13 +19,13 @@ Ref Module::ConstantFalse(Ref result_type) {
|
|||
}
|
||||
|
||||
Ref Module::Constant(Ref result_type, Operand* literal) {
|
||||
auto const op{new Op(spv::Op::OpConstant, bound, result_type)};
|
||||
auto op{new Op(spv::Op::OpConstant, bound, result_type)};
|
||||
op->Add(literal);
|
||||
return AddDeclaration(op);
|
||||
}
|
||||
|
||||
Ref Module::ConstantComposite(Ref result_type, const std::vector<Ref>& constituents) {
|
||||
auto const op{new Op(spv::Op::OpConstantComposite, bound, result_type)};
|
||||
auto op{new Op(spv::Op::OpConstantComposite, bound, result_type)};
|
||||
op->Add(constituents);
|
||||
return AddDeclaration(op);
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ Ref Module::ConstantSampler(Ref result_type, spv::SamplerAddressingMode addressi
|
|||
bool normalized, spv::SamplerFilterMode filter_mode) {
|
||||
AddCapability(spv::Capability::LiteralSampler);
|
||||
AddCapability(spv::Capability::Kernel);
|
||||
auto const op{new Op(spv::Op::OpConstantSampler, bound, result_type)};
|
||||
auto op{new Op(spv::Op::OpConstantSampler, bound, result_type)};
|
||||
AddEnum(op, addressing_mode);
|
||||
op->Add(normalized ? 1 : 0);
|
||||
AddEnum(op, filter_mode);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
namespace Sirit {
|
||||
|
||||
Ref Module::Name(Ref target, const std::string& name) {
|
||||
auto const op{new Op(spv::Op::OpName)};
|
||||
auto op{new Op(spv::Op::OpName)};
|
||||
op->Add(target);
|
||||
op->Add(name);
|
||||
debug.push_back(std::unique_ptr<Op>(op));
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Sirit {
|
|||
|
||||
Ref Module::LoopMerge(Ref merge_block, Ref continue_target, spv::LoopControlMask loop_control,
|
||||
const std::vector<Ref>& literals) {
|
||||
auto const op{new Op(spv::Op::OpLoopMerge)};
|
||||
auto op{new Op(spv::Op::OpLoopMerge)};
|
||||
op->Add(merge_block);
|
||||
op->Add(continue_target);
|
||||
AddEnum(op, loop_control);
|
||||
|
@ -20,7 +20,7 @@ Ref Module::LoopMerge(Ref merge_block, Ref continue_target, spv::LoopControlMask
|
|||
}
|
||||
|
||||
Ref Module::SelectionMerge(Ref merge_block, spv::SelectionControlMask selection_control) {
|
||||
auto const op{new Op(spv::Op::OpSelectionMerge)};
|
||||
auto op{new Op(spv::Op::OpSelectionMerge)};
|
||||
op->Add(merge_block);
|
||||
AddEnum(op, selection_control);
|
||||
return AddCode(op);
|
||||
|
@ -31,14 +31,14 @@ Ref Module::Label() {
|
|||
}
|
||||
|
||||
Ref Module::Branch(Ref target_label) {
|
||||
auto const op{new Op(spv::Op::OpBranch)};
|
||||
auto op{new Op(spv::Op::OpBranch)};
|
||||
op->Add(target_label);
|
||||
return AddCode(op);
|
||||
}
|
||||
|
||||
Ref Module::BranchConditional(Ref condition, Ref true_label, Ref false_label,
|
||||
std::uint32_t true_weight, std::uint32_t false_weight) {
|
||||
auto const op{new Op(spv::Op::OpBranchConditional)};
|
||||
auto op{new Op(spv::Op::OpBranchConditional)};
|
||||
op->Add(condition);
|
||||
op->Add(true_label);
|
||||
op->Add(false_label);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
namespace Sirit {
|
||||
|
||||
Ref Module::Function(Ref result_type, spv::FunctionControlMask function_control, Ref function_type) {
|
||||
auto const op{new Op{spv::Op::OpFunction, bound++, result_type}};
|
||||
auto op{new Op{spv::Op::OpFunction, bound++, result_type}};
|
||||
op->Add(static_cast<u32>(function_control));
|
||||
op->Add(function_type);
|
||||
return AddCode(op);
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Sirit {
|
|||
|
||||
Ref Module::Variable(Ref result_type, spv::StorageClass storage_class,
|
||||
Ref initializer) {
|
||||
auto const op{new Op(spv::Op::OpVariable, bound++, result_type)};
|
||||
auto op{new Op(spv::Op::OpVariable, bound++, result_type)};
|
||||
AddEnum(op, storage_class);
|
||||
if (initializer) {
|
||||
op->Add(initializer);
|
||||
|
|
|
@ -28,7 +28,7 @@ Ref Module::TypeInt(int width, bool is_signed) {
|
|||
} else if (width == 64) {
|
||||
AddCapability(spv::Capability::Int64);
|
||||
}
|
||||
auto const op{new Op(spv::Op::OpTypeInt, bound)};
|
||||
auto op{new Op(spv::Op::OpTypeInt, bound)};
|
||||
op->Add(width);
|
||||
op->Add(is_signed ? 1 : 0);
|
||||
return AddDeclaration(op);
|
||||
|
@ -40,14 +40,14 @@ Ref Module::TypeFloat(int width) {
|
|||
} else if (width == 64) {
|
||||
AddCapability(spv::Capability::Float64);
|
||||
}
|
||||
auto const op{new Op(spv::Op::OpTypeFloat, bound)};
|
||||
auto op{new Op(spv::Op::OpTypeFloat, bound)};
|
||||
op->Add(width);
|
||||
return AddDeclaration(op);
|
||||
}
|
||||
|
||||
Ref Module::TypeVector(Ref component_type, int component_count) {
|
||||
assert(component_count >= 2);
|
||||
auto const op{new Op(spv::Op::OpTypeVector, bound)};
|
||||
auto op{new Op(spv::Op::OpTypeVector, bound)};
|
||||
op->Add(component_type);
|
||||
op->Add(component_count);
|
||||
return AddDeclaration(op);
|
||||
|
@ -125,7 +125,7 @@ Ref Module::TypeImage(Ref sampled_type, spv::Dim dim, int depth, bool arrayed, b
|
|||
AddCapability(spv::Capability::StorageImageExtendedFormats);
|
||||
break;
|
||||
}
|
||||
auto const op{new Op(spv::Op::OpTypeImage, bound)};
|
||||
auto op{new Op(spv::Op::OpTypeImage, bound)};
|
||||
op->Add(sampled_type);
|
||||
op->Add(static_cast<u32>(dim));
|
||||
op->Add(depth);
|
||||
|
@ -145,13 +145,13 @@ Ref Module::TypeSampler() {
|
|||
}
|
||||
|
||||
Ref Module::TypeSampledImage(Ref image_type) {
|
||||
auto const op{new Op(spv::Op::OpTypeSampledImage, bound)};
|
||||
auto op{new Op(spv::Op::OpTypeSampledImage, bound)};
|
||||
op->Add(image_type);
|
||||
return AddDeclaration(op);
|
||||
}
|
||||
|
||||
Ref Module::TypeArray(Ref element_type, Ref length) {
|
||||
auto const op{new Op(spv::Op::OpTypeArray, bound)};
|
||||
auto op{new Op(spv::Op::OpTypeArray, bound)};
|
||||
op->Add(element_type);
|
||||
op->Add(length);
|
||||
return AddDeclaration(op);
|
||||
|
@ -159,20 +159,20 @@ Ref Module::TypeArray(Ref element_type, Ref length) {
|
|||
|
||||
Ref Module::TypeRuntimeArray(Ref element_type) {
|
||||
AddCapability(spv::Capability::Shader);
|
||||
auto const op{new Op(spv::Op::OpTypeRuntimeArray, bound)};
|
||||
auto op{new Op(spv::Op::OpTypeRuntimeArray, bound)};
|
||||
op->Add(element_type);
|
||||
return AddDeclaration(op);
|
||||
}
|
||||
|
||||
Ref Module::TypeStruct(const std::vector<Ref>& members) {
|
||||
auto const op{new Op(spv::Op::OpTypeStruct, bound)};
|
||||
auto op{new Op(spv::Op::OpTypeStruct, bound)};
|
||||
op->Add(members);
|
||||
return AddDeclaration(op);
|
||||
}
|
||||
|
||||
Ref Module::TypeOpaque(const std::string& name) {
|
||||
AddCapability(spv::Capability::Kernel);
|
||||
auto const op{new Op(spv::Op::OpTypeOpaque, bound)};
|
||||
auto op{new Op(spv::Op::OpTypeOpaque, bound)};
|
||||
op->Add(name);
|
||||
return AddDeclaration(op);
|
||||
}
|
||||
|
@ -193,14 +193,14 @@ Ref Module::TypePointer(spv::StorageClass storage_class, Ref type) {
|
|||
AddCapability(spv::Capability::AtomicStorage);
|
||||
break;
|
||||
}
|
||||
auto const op{new Op(spv::Op::OpTypePointer, bound)};
|
||||
auto op{new Op(spv::Op::OpTypePointer, bound)};
|
||||
op->Add(static_cast<u32>(storage_class));
|
||||
op->Add(type);
|
||||
return AddDeclaration(op);
|
||||
}
|
||||
|
||||
Ref Module::TypeFunction(Ref return_type, const std::vector<Ref>& arguments) {
|
||||
auto const op{new Op(spv::Op::OpTypeFunction, bound)};
|
||||
auto op{new Op(spv::Op::OpTypeFunction, bound)};
|
||||
op->Add(return_type);
|
||||
op->Add(arguments);
|
||||
return AddDeclaration(op);
|
||||
|
@ -228,7 +228,7 @@ Ref Module::TypeQueue() {
|
|||
|
||||
Ref Module::TypePipe(spv::AccessQualifier access_qualifier) {
|
||||
AddCapability(spv::Capability::Pipes);
|
||||
auto const op{new Op(spv::Op::OpTypePipe, bound)};
|
||||
auto op{new Op(spv::Op::OpTypePipe, bound)};
|
||||
op->Add(static_cast<u32>(access_qualifier));
|
||||
return AddDeclaration(op);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue