clang format fix

This commit is contained in:
georgemoralis 2024-07-17 17:57:54 +03:00
parent 1208661d64
commit 439c0be9a6
4 changed files with 13 additions and 17 deletions

View File

@ -165,9 +165,8 @@ void Emulator::LoadSystemModules(const std::filesystem::path& file) {
found_modules.push_back(entry.path()); found_modules.push_back(entry.path());
} }
for (const auto& [module_name, init_func] : ModulesToLoad) { for (const auto& [module_name, init_func] : ModulesToLoad) {
const auto it = std::ranges::find_if(found_modules, [&](const auto& path) { const auto it = std::ranges::find_if(
return path.filename() == module_name; found_modules, [&](const auto& path) { return path.filename() == module_name; });
});
if (it != found_modules.end()) { if (it != found_modules.end()) {
LOG_INFO(Loader, "Loading {}", it->string()); LOG_INFO(Loader, "Loading {}", it->string());
linker->LoadModule(*it); linker->LoadModule(*it);

View File

@ -62,8 +62,7 @@ Id EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst* inst, u32 handle,
spv::ImageOperandsMask::Lod, ctx.ConstF32(0.f)); spv::ImageOperandsMask::Lod, ctx.ConstF32(0.f));
} }
Id EmitImageGather(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id EmitImageGather(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id offset, Id offset2) {
Id offset, Id offset2) {
const auto& texture = ctx.images[handle & 0xFFFF]; const auto& texture = ctx.images[handle & 0xFFFF];
const Id image = ctx.OpLoad(texture.image_type, texture.id); const Id image = ctx.OpLoad(texture.image_type, texture.id);
const Id sampler = ctx.OpLoad(ctx.sampler_type, ctx.samplers[handle >> 16]); const Id sampler = ctx.OpLoad(ctx.sampler_type, ctx.samplers[handle >> 16]);
@ -72,20 +71,20 @@ Id EmitImageGather(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords,
ImageOperands operands; ImageOperands operands;
operands.Add(spv::ImageOperandsMask::Offset, offset); operands.Add(spv::ImageOperandsMask::Offset, offset);
operands.Add(spv::ImageOperandsMask::Lod, ctx.ConstF32(0.f)); operands.Add(spv::ImageOperandsMask::Lod, ctx.ConstF32(0.f));
return ctx.OpImageGather(ctx.F32[4], sampled_image, coords, ctx.ConstU32(comp), return ctx.OpImageGather(ctx.F32[4], sampled_image, coords, ctx.ConstU32(comp), operands.mask,
operands.mask, operands.operands); operands.operands);
} }
Id EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id offset,
Id offset, Id offset2, Id dref) { Id offset2, Id dref) {
const auto& texture = ctx.images[handle & 0xFFFF]; const auto& texture = ctx.images[handle & 0xFFFF];
const Id image = ctx.OpLoad(texture.image_type, texture.id); const Id image = ctx.OpLoad(texture.image_type, texture.id);
const Id sampler = ctx.OpLoad(ctx.sampler_type, ctx.samplers[handle >> 16]); const Id sampler = ctx.OpLoad(ctx.sampler_type, ctx.samplers[handle >> 16]);
const Id sampled_image = ctx.OpSampledImage(texture.sampled_type, image, sampler); const Id sampled_image = ctx.OpSampledImage(texture.sampled_type, image, sampler);
ImageOperands operands; ImageOperands operands;
operands.Add(spv::ImageOperandsMask::Offset, offset); operands.Add(spv::ImageOperandsMask::Offset, offset);
return ctx.OpImageDrefGather(ctx.F32[4], sampled_image, coords, dref, return ctx.OpImageDrefGather(ctx.F32[4], sampled_image, coords, dref, operands.mask,
operands.mask, operands.operands); operands.operands);
} }
Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id offset, Id lod, Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id offset, Id lod,

View File

@ -358,10 +358,9 @@ Id EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst* inst, u32 handle,
Id bias_lc, const IR::Value& offset); Id bias_lc, const IR::Value& offset);
Id EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id dref, Id EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id dref,
Id bias_lc, Id offset); Id bias_lc, Id offset);
Id EmitImageGather(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id EmitImageGather(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id offset, Id offset2);
Id offset, Id offset2); Id EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id offset,
Id EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id offset2, Id dref);
Id offset, Id offset2, Id dref);
Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id offset, Id lod, Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id offset, Id lod,
Id ms); Id ms);
Id EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, u32 handle, Id lod, bool skip_mips); Id EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, u32 handle, Id lod, bool skip_mips);

View File

@ -445,8 +445,7 @@ vk::Format SurfaceFormat(AmdGpu::DataFormat data_format, AmdGpu::NumberFormat nu
num_format == AmdGpu::NumberFormat::Unorm) { num_format == AmdGpu::NumberFormat::Unorm) {
return vk::Format::eR16G16B16A16Unorm; return vk::Format::eR16G16B16A16Unorm;
} }
if (data_format == AmdGpu::DataFormat::Format8 && if (data_format == AmdGpu::DataFormat::Format8 && num_format == AmdGpu::NumberFormat::Uint) {
num_format == AmdGpu::NumberFormat::Uint) {
return vk::Format::eR8Uint; return vk::Format::eR8Uint;
} }
if (data_format == AmdGpu::DataFormat::Format16_16_16_16 && if (data_format == AmdGpu::DataFormat::Format16_16_16_16 &&