mirror of
https://github.com/yuzu-emu/sirit.git
synced 2024-12-23 00:25:34 +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,
|
Ref Module::Decorate(Ref target, spv::Decoration decoration,
|
||||||
const std::vector<Operand*>& literals) {
|
const std::vector<Operand*>& literals) {
|
||||||
auto const op{new Op(spv::Op::OpDecorate)};
|
auto op{new Op(spv::Op::OpDecorate)};
|
||||||
op->Add(target);
|
op->Add(target);
|
||||||
AddEnum(op, decoration);
|
AddEnum(op, decoration);
|
||||||
op->Sink(literals);
|
op->Sink(literals);
|
||||||
|
|
|
@ -19,13 +19,13 @@ Ref Module::ConstantFalse(Ref result_type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref Module::Constant(Ref result_type, Operand* literal) {
|
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);
|
op->Add(literal);
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref Module::ConstantComposite(Ref result_type, const std::vector<Ref>& constituents) {
|
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);
|
op->Add(constituents);
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ Ref Module::ConstantSampler(Ref result_type, spv::SamplerAddressingMode addressi
|
||||||
bool normalized, spv::SamplerFilterMode filter_mode) {
|
bool normalized, spv::SamplerFilterMode filter_mode) {
|
||||||
AddCapability(spv::Capability::LiteralSampler);
|
AddCapability(spv::Capability::LiteralSampler);
|
||||||
AddCapability(spv::Capability::Kernel);
|
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);
|
AddEnum(op, addressing_mode);
|
||||||
op->Add(normalized ? 1 : 0);
|
op->Add(normalized ? 1 : 0);
|
||||||
AddEnum(op, filter_mode);
|
AddEnum(op, filter_mode);
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
namespace Sirit {
|
namespace Sirit {
|
||||||
|
|
||||||
Ref Module::Name(Ref target, const std::string& name) {
|
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(target);
|
||||||
op->Add(name);
|
op->Add(name);
|
||||||
debug.push_back(std::unique_ptr<Op>(op));
|
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,
|
Ref Module::LoopMerge(Ref merge_block, Ref continue_target, spv::LoopControlMask loop_control,
|
||||||
const std::vector<Ref>& literals) {
|
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(merge_block);
|
||||||
op->Add(continue_target);
|
op->Add(continue_target);
|
||||||
AddEnum(op, loop_control);
|
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) {
|
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);
|
op->Add(merge_block);
|
||||||
AddEnum(op, selection_control);
|
AddEnum(op, selection_control);
|
||||||
return AddCode(op);
|
return AddCode(op);
|
||||||
|
@ -31,14 +31,14 @@ Ref Module::Label() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref Module::Branch(Ref target_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);
|
op->Add(target_label);
|
||||||
return AddCode(op);
|
return AddCode(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref Module::BranchConditional(Ref condition, Ref true_label, Ref false_label,
|
Ref Module::BranchConditional(Ref condition, Ref true_label, Ref false_label,
|
||||||
std::uint32_t true_weight, std::uint32_t false_weight) {
|
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(condition);
|
||||||
op->Add(true_label);
|
op->Add(true_label);
|
||||||
op->Add(false_label);
|
op->Add(false_label);
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
namespace Sirit {
|
namespace Sirit {
|
||||||
|
|
||||||
Ref Module::Function(Ref result_type, spv::FunctionControlMask function_control, Ref function_type) {
|
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(static_cast<u32>(function_control));
|
||||||
op->Add(function_type);
|
op->Add(function_type);
|
||||||
return AddCode(op);
|
return AddCode(op);
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace Sirit {
|
||||||
|
|
||||||
Ref Module::Variable(Ref result_type, spv::StorageClass storage_class,
|
Ref Module::Variable(Ref result_type, spv::StorageClass storage_class,
|
||||||
Ref initializer) {
|
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);
|
AddEnum(op, storage_class);
|
||||||
if (initializer) {
|
if (initializer) {
|
||||||
op->Add(initializer);
|
op->Add(initializer);
|
||||||
|
|
|
@ -28,7 +28,7 @@ Ref Module::TypeInt(int width, bool is_signed) {
|
||||||
} else if (width == 64) {
|
} else if (width == 64) {
|
||||||
AddCapability(spv::Capability::Int64);
|
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(width);
|
||||||
op->Add(is_signed ? 1 : 0);
|
op->Add(is_signed ? 1 : 0);
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
|
@ -40,14 +40,14 @@ Ref Module::TypeFloat(int width) {
|
||||||
} else if (width == 64) {
|
} else if (width == 64) {
|
||||||
AddCapability(spv::Capability::Float64);
|
AddCapability(spv::Capability::Float64);
|
||||||
}
|
}
|
||||||
auto const op{new Op(spv::Op::OpTypeFloat, bound)};
|
auto op{new Op(spv::Op::OpTypeFloat, bound)};
|
||||||
op->Add(width);
|
op->Add(width);
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref Module::TypeVector(Ref component_type, int component_count) {
|
Ref Module::TypeVector(Ref component_type, int component_count) {
|
||||||
assert(component_count >= 2);
|
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_type);
|
||||||
op->Add(component_count);
|
op->Add(component_count);
|
||||||
return AddDeclaration(op);
|
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);
|
AddCapability(spv::Capability::StorageImageExtendedFormats);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
auto const op{new Op(spv::Op::OpTypeImage, bound)};
|
auto op{new Op(spv::Op::OpTypeImage, bound)};
|
||||||
op->Add(sampled_type);
|
op->Add(sampled_type);
|
||||||
op->Add(static_cast<u32>(dim));
|
op->Add(static_cast<u32>(dim));
|
||||||
op->Add(depth);
|
op->Add(depth);
|
||||||
|
@ -145,13 +145,13 @@ Ref Module::TypeSampler() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref Module::TypeSampledImage(Ref image_type) {
|
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);
|
op->Add(image_type);
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref Module::TypeArray(Ref element_type, Ref length) {
|
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(element_type);
|
||||||
op->Add(length);
|
op->Add(length);
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
|
@ -159,20 +159,20 @@ Ref Module::TypeArray(Ref element_type, Ref length) {
|
||||||
|
|
||||||
Ref Module::TypeRuntimeArray(Ref element_type) {
|
Ref Module::TypeRuntimeArray(Ref element_type) {
|
||||||
AddCapability(spv::Capability::Shader);
|
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);
|
op->Add(element_type);
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref Module::TypeStruct(const std::vector<Ref>& members) {
|
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);
|
op->Add(members);
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref Module::TypeOpaque(const std::string& name) {
|
Ref Module::TypeOpaque(const std::string& name) {
|
||||||
AddCapability(spv::Capability::Kernel);
|
AddCapability(spv::Capability::Kernel);
|
||||||
auto const op{new Op(spv::Op::OpTypeOpaque, bound)};
|
auto op{new Op(spv::Op::OpTypeOpaque, bound)};
|
||||||
op->Add(name);
|
op->Add(name);
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
}
|
}
|
||||||
|
@ -193,14 +193,14 @@ Ref Module::TypePointer(spv::StorageClass storage_class, Ref type) {
|
||||||
AddCapability(spv::Capability::AtomicStorage);
|
AddCapability(spv::Capability::AtomicStorage);
|
||||||
break;
|
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(static_cast<u32>(storage_class));
|
||||||
op->Add(type);
|
op->Add(type);
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref Module::TypeFunction(Ref return_type, const std::vector<Ref>& arguments) {
|
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(return_type);
|
||||||
op->Add(arguments);
|
op->Add(arguments);
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
|
@ -228,7 +228,7 @@ Ref Module::TypeQueue() {
|
||||||
|
|
||||||
Ref Module::TypePipe(spv::AccessQualifier access_qualifier) {
|
Ref Module::TypePipe(spv::AccessQualifier access_qualifier) {
|
||||||
AddCapability(spv::Capability::Pipes);
|
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));
|
op->Add(static_cast<u32>(access_qualifier));
|
||||||
return AddDeclaration(op);
|
return AddDeclaration(op);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue