From 0925d58924a6abde8f5167c40db7f0c4e73ae18a Mon Sep 17 00:00:00 2001 From: IndecisiveTurtle <47210458+raphaelthegreat@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:51:35 +0200 Subject: [PATCH] clang format --- .../backend/spirv/emit_spirv_quad_rect.cpp | 10 +++++---- .../backend/spirv/emit_spirv_quad_rect.h | 6 +++--- .../renderer_vulkan/vk_graphics_pipeline.cpp | 21 ++++++++++--------- .../renderer_vulkan/vk_pipeline_cache.cpp | 6 +++--- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.cpp index 549dcc1f..0969b91d 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.cpp @@ -65,7 +65,8 @@ struct QuadRectListEmitter : public Sirit::Module { std::array point_coord_equal; for (int i = 0; i < 3; i++) { - // point_coord_equal[i] = equal(gl_in[i].gl_Position.xy, gl_in[(i + 1) % 3].gl_Position.xy); + // point_coord_equal[i] = equal(gl_in[i].gl_Position.xy, gl_in[(i + 1) % + // 3].gl_Position.xy); const Id pos_l_xy{OpVectorShuffle(vec2_id, pos[i], pos[i], 0, 1)}; const Id pos_r_xy{OpVectorShuffle(vec2_id, pos[(i + 1) % 3], pos[(i + 1) % 3], 0, 1)}; point_coord_equal[i] = OpFOrdEqual(bvec2_id, pos_l_xy, pos_r_xy); @@ -104,7 +105,8 @@ struct QuadRectListEmitter : public Sirit::Module { const Id invocation_3{OpIEqual(bool_id, invocation_id, Int(3))}; const Id index{OpSMod(int_id, OpIAdd(int_id, vertex_index, invocation_id), Int(3))}; - // gl_out[gl_InvocationID].gl_Position = gl_InvocationID == 3 ? pos3 : gl_in[index].gl_Position; + // gl_out[gl_InvocationID].gl_Position = gl_InvocationID == 3 ? pos3 : + // gl_in[index].gl_Position; const Id pos3{interpolate(pos[0], pos[1], pos[2])}; const Id in_ptr{OpAccessChain(input_vec4, gl_in, index, Int(0))}; const Id position{OpSelect(vec4_id, invocation_3, pos3, OpLoad(vec4_id, in_ptr))}; @@ -136,7 +138,8 @@ struct QuadRectListEmitter : public Sirit::Module { const Id invocation_id{OpLoad(int_id, gl_invocation_id)}; // gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; - const Id in_position{OpLoad(vec4_id, OpAccessChain(input_vec4, gl_in, invocation_id, Int(0)))}; + const Id in_position{ + OpLoad(vec4_id, OpAccessChain(input_vec4, gl_in, invocation_id, Int(0)))}; OpStore(OpAccessChain(output_vec4, gl_out, invocation_id, Int(0)), in_position); for (int i = 0; i < num_attribs; i++) { @@ -303,5 +306,4 @@ std::vector EmitAuxilaryTessShader(AuxShaderType type, size_t num_attribs) return ctx.Assemble(); } - } // namespace Shader::Backend::SPIRV \ No newline at end of file diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.h b/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.h index ab863702..4723a798 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.h @@ -9,9 +9,9 @@ namespace Shader::Backend::SPIRV { enum class AuxShaderType : u32 { - RectListTCS, - PassthoughTCS, - PassthroughTES, + RectListTCS, + PassthoughTCS, + PassthroughTES, }; [[nodiscard]] std::vector EmitAuxilaryTessShader(AuxShaderType type, size_t num_attribs); diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 00678d34..18e41ed9 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -7,30 +7,30 @@ #include #include "common/assert.h" -#include "common/scope_exit.h" #include "common/io_file.h" +#include "common/scope_exit.h" #include "shader_recompiler/backend/spirv/emit_spirv_quad_rect.h" #include "shader_recompiler/frontend/fetch_shader.h" #include "shader_recompiler/runtime_info.h" #include "video_core/amdgpu/resource.h" #include "video_core/buffer_cache/buffer_cache.h" #include "video_core/renderer_vulkan/vk_graphics_pipeline.h" -#include "video_core/renderer_vulkan/vk_shader_util.h" #include "video_core/renderer_vulkan/vk_instance.h" #include "video_core/renderer_vulkan/vk_scheduler.h" +#include "video_core/renderer_vulkan/vk_shader_util.h" #include "video_core/texture_cache/texture_cache.h" namespace Vulkan { using Shader::Backend::SPIRV::AuxShaderType; -GraphicsPipeline::GraphicsPipeline(const Instance& instance_, Scheduler& scheduler_, - DescriptorHeap& desc_heap_, const GraphicsPipelineKey& key_, - vk::PipelineCache pipeline_cache, - std::span infos, - std::span runtime_infos, - std::optional fetch_shader_, - std::span modules) +GraphicsPipeline::GraphicsPipeline( + const Instance& instance_, Scheduler& scheduler_, DescriptorHeap& desc_heap_, + const GraphicsPipelineKey& key_, vk::PipelineCache pipeline_cache, + std::span infos, + std::span runtime_infos, + std::optional fetch_shader_, + std::span modules) : Pipeline{instance_, scheduler_, desc_heap_, pipeline_cache}, key{key_}, fetch_shader{std::move(fetch_shader_)} { const vk::Device device = instance.GetDevice(); @@ -251,7 +251,8 @@ GraphicsPipeline::GraphicsPipeline(const Instance& instance_, Scheduler& schedul .pName = "main", }); } else if (is_rect_list) { - auto tes = Shader::Backend::SPIRV::EmitAuxilaryTessShader(AuxShaderType::PassthroughTES, num_fs_inputs); + auto tes = Shader::Backend::SPIRV::EmitAuxilaryTessShader(AuxShaderType::PassthroughTES, + num_fs_inputs); shader_stages.emplace_back(vk::PipelineShaderStageCreateInfo{ .stage = vk::ShaderStageFlagBits::eTessellationEvaluation, .module = CompileSPV(tes, instance.GetDevice()), diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 1363eaef..a7d78668 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -221,9 +221,9 @@ const GraphicsPipeline* PipelineCache::GetGraphicsPipeline() { } const auto [it, is_new] = graphics_pipelines.try_emplace(graphics_key); if (is_new) { - it.value() = - std::make_unique(instance, scheduler, desc_heap, graphics_key, - *pipeline_cache, infos, runtime_infos, fetch_shader, modules); + it.value() = std::make_unique(instance, scheduler, desc_heap, + graphics_key, *pipeline_cache, infos, + runtime_infos, fetch_shader, modules); if (Config::collectShadersForDebug()) { for (auto stage = 0; stage < MaxShaderStages; ++stage) { if (infos[stage]) {