From a729c15e9dce9f5116a38afc66329ab2ca4cea54 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 29 Oct 2024 13:59:28 +0800 Subject: preparation for clang format (#5422) * Clang-format excludes * Add .clang-format * Don't clang-format in external * Missing includes and forward declarations * Replace wonky include-once macro name * neaten include naming * Add clang-format to formatting script * Add xargs and diff to required binaries * add clang-format to ci formatting check * Add max version check to formatting script * temporarily disable checking formatting for cpp files --- tools/gfx/open-gl/render-gl.cpp | 8 +++++--- tools/gfx/simple-transient-resource-heap.h | 1 + tools/gfx/vulkan/vk-api.h | 3 ++- tools/render-test/shader-input-layout.cpp | 2 ++ 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/gfx/open-gl/render-gl.cpp b/tools/gfx/open-gl/render-gl.cpp index abb178375..4b2acd094 100644 --- a/tools/gfx/open-gl/render-gl.cpp +++ b/tools/gfx/open-gl/render-gl.cpp @@ -34,9 +34,11 @@ #pragma comment(lib, "opengl32") -#include -#include "external/glext.h" -#include "external/wglext.h" +// clang-format off +# include +# include "external/glext.h" +# include "external/wglext.h" +// clang-format on // We define an "X-macro" for mapping over loadable OpenGL // extension entry point that we will use, so that we can diff --git a/tools/gfx/simple-transient-resource-heap.h b/tools/gfx/simple-transient-resource-heap.h index c94fe2a7b..4e3a04094 100644 --- a/tools/gfx/simple-transient-resource-heap.h +++ b/tools/gfx/simple-transient-resource-heap.h @@ -4,6 +4,7 @@ // Provide a simple no-op implementation for `ITransientResourceHeap` for targets that // already support version management. +#include "renderer-shared.h" #include "slang-gfx.h" namespace gfx diff --git a/tools/gfx/vulkan/vk-api.h b/tools/gfx/vulkan/vk-api.h index 70af62ed1..04744369a 100644 --- a/tools/gfx/vulkan/vk-api.h +++ b/tools/gfx/vulkan/vk-api.h @@ -5,6 +5,7 @@ namespace gfx { +// clang-format off #define VK_API_GLOBAL_PROCS(x) \ x(vkGetInstanceProcAddr) \ x(vkCreateInstance) \ @@ -235,7 +236,7 @@ namespace gfx { /* */ #define VK_API_DECLARE_PROC(NAME) PFN_##NAME NAME = nullptr; - +// clang-format on struct VulkanExtendedFeatureProperties { diff --git a/tools/render-test/shader-input-layout.cpp b/tools/render-test/shader-input-layout.cpp index 07711d712..013e86c37 100644 --- a/tools/render-test/shader-input-layout.cpp +++ b/tools/render-test/shader-input-layout.cpp @@ -11,10 +11,12 @@ namespace renderer_test { using namespace Slang; +// clang-format off #define SLANG_SCALAR_TYPES(x) \ x("int", INT32) \ x("uint", UINT32) \ x("float", FLOAT32) +// clang-format on Format _getFormatFromName(const UnownedStringSlice& slice) -- cgit v1.2.3