Commit 71c49f8e by Antonio Maiorano

Run clang-format on renamed headers

Our script, src/clang-format-all.sh, applies only to .hpp, not .h files. Ran it again after renaming the Vulkan-source .h to .hpp. Bug: b/144825072 Change-Id: I2c6d11ec2285567155f207830bdf560431b927f4 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44390 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 42fd159c
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
#define REVISION_STRING MACRO_STRINGIFY(BUILD_REVISION) #define REVISION_STRING MACRO_STRINGIFY(BUILD_REVISION)
#define VERSION_STRING MACRO_STRINGIFY(MAJOR_VERSION) "." MACRO_STRINGIFY(MINOR_VERSION) "." MACRO_STRINGIFY(PATCH_VERSION) #define VERSION_STRING \
MACRO_STRINGIFY(MAJOR_VERSION) \
"." MACRO_STRINGIFY(MINOR_VERSION) "." MACRO_STRINGIFY(PATCH_VERSION)
#endif // Version_h #endif // Version_h
...@@ -84,8 +84,8 @@ constexpr int SUBPIXEL_PRECISION_MASK = 0xFFFFFFFF >> (32 - SUBPIXEL_PRECISION_B ...@@ -84,8 +84,8 @@ constexpr int SUBPIXEL_PRECISION_MASK = 0xFFFFFFFF >> (32 - SUBPIXEL_PRECISION_B
} // namespace vk } // namespace vk
#if defined(__linux__) || defined(__ANDROID__) #if defined(__linux__) || defined(__ANDROID__)
#define SWIFTSHADER_EXTERNAL_MEMORY_OPAQUE_FD 1 # define SWIFTSHADER_EXTERNAL_MEMORY_OPAQUE_FD 1
#define SWIFTSHADER_EXTERNAL_SEMAPHORE_OPAQUE_FD 1 # define SWIFTSHADER_EXTERNAL_SEMAPHORE_OPAQUE_FD 1
#endif #endif
constexpr VkDeviceSize MAX_MEMORY_ALLOCATION_SIZE = 0x40000000ull; // 0x40000000 = 1 GiB constexpr VkDeviceSize MAX_MEMORY_ALLOCATION_SIZE = 0x40000000ull; // 0x40000000 = 1 GiB
......
...@@ -24,16 +24,16 @@ ...@@ -24,16 +24,16 @@
#include "VkImage.hpp" #include "VkImage.hpp"
#include "VkImageView.hpp" #include "VkImageView.hpp"
#include "VkInstance.hpp" #include "VkInstance.hpp"
#include "VkPhysicalDevice.hpp"
#include "VkPipeline.hpp" #include "VkPipeline.hpp"
#include "VkPipelineCache.hpp" #include "VkPipelineCache.hpp"
#include "VkPipelineLayout.hpp" #include "VkPipelineLayout.hpp"
#include "VkPhysicalDevice.hpp"
#include "VkQueryPool.hpp" #include "VkQueryPool.hpp"
#include "VkQueue.hpp" #include "VkQueue.hpp"
#include "VkRenderPass.hpp"
#include "VkSampler.hpp" #include "VkSampler.hpp"
#include "VkSemaphore.hpp" #include "VkSemaphore.hpp"
#include "VkShaderModule.hpp" #include "VkShaderModule.hpp"
#include "VkRenderPass.hpp"
#include "WSI/VkSurfaceKHR.hpp" #include "WSI/VkSurfaceKHR.hpp"
#include "WSI/VkSwapchainKHR.hpp" #include "WSI/VkSwapchainKHR.hpp"
...@@ -50,7 +50,7 @@ namespace vk { ...@@ -50,7 +50,7 @@ namespace vk {
// destructor prior to releasing the object (by default, // destructor prior to releasing the object (by default,
// VkObjectBase::destroy does nothing). // VkObjectBase::destroy does nothing).
template<typename VkT> template<typename VkT>
inline void destroy(VkT vkObject, const VkAllocationCallbacks* pAllocator) inline void destroy(VkT vkObject, const VkAllocationCallbacks *pAllocator)
{ {
auto object = Cast(vkObject); auto object = Cast(vkObject);
if(object) if(object)
......
...@@ -22,8 +22,8 @@ namespace vk { ...@@ -22,8 +22,8 @@ namespace vk {
class Device; class Device;
class Instance; class Instance;
PFN_vkVoidFunction GetInstanceProcAddr(Instance* instance, const char* pName); PFN_vkVoidFunction GetInstanceProcAddr(Instance *instance, const char *pName);
PFN_vkVoidFunction GetDeviceProcAddr(Device* device, const char* pName); PFN_vkVoidFunction GetDeviceProcAddr(Device *device, const char *pName);
} // namespace vk } // namespace vk
...@@ -32,7 +32,7 @@ PFN_vkVoidFunction GetDeviceProcAddr(Device* device, const char* pName); ...@@ -32,7 +32,7 @@ PFN_vkVoidFunction GetDeviceProcAddr(Device* device, const char* pName);
// about this global pointer. Since this is a private implementation detail // about this global pointer. Since this is a private implementation detail
// between the Vulkan loader and the ICDs, this type will never be part of // between the Vulkan loader and the ICDs, this type will never be part of
// the <vulkan/vulkan_fuchsia.h> headers, so define the type here. // the <vulkan/vulkan_fuchsia.h> headers, so define the type here.
typedef VkResult(VKAPI_PTR* PFN_vkConnectToService)(const char* pName, uint32_t handle); typedef VkResult(VKAPI_PTR *PFN_vkConnectToService)(const char *pName, uint32_t handle);
namespace vk { namespace vk {
extern PFN_vkConnectToService icdFuchsiaServiceConnectCallback; extern PFN_vkConnectToService icdFuchsiaServiceConnectCallback;
......
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
namespace vk { namespace vk {
void* allocate(size_t count, size_t alignment, const VkAllocationCallbacks* pAllocator, void *allocate(size_t count, size_t alignment, const VkAllocationCallbacks *pAllocator,
VkSystemAllocationScope allocationScope = VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); VkSystemAllocationScope allocationScope = VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
void deallocate(void* ptr, const VkAllocationCallbacks* pAllocator); void deallocate(void *ptr, const VkAllocationCallbacks *pAllocator);
template <typename T> template<typename T>
T* allocate(size_t count, const VkAllocationCallbacks* pAllocator) T *allocate(size_t count, const VkAllocationCallbacks *pAllocator)
{ {
return static_cast<T*>(allocate(count, alignof(T), pAllocator, T::GetAllocationScope())); return static_cast<T *>(allocate(count, alignof(T), pAllocator, T::GetAllocationScope()));
} }
} // namespace vk } // namespace vk
......
...@@ -19,10 +19,11 @@ ...@@ -19,10 +19,11 @@
#include <cstdint> #include <cstdint>
#include <type_traits> #include <type_traits>
template<typename T> class VkNonDispatchableHandle template<typename T>
class VkNonDispatchableHandle
{ {
public: public:
operator void*() const operator void *() const
{ {
static_assert(sizeof(VkNonDispatchableHandle) == sizeof(uint64_t), "Size is not 64 bits!"); static_assert(sizeof(VkNonDispatchableHandle) == sizeof(uint64_t), "Size is not 64 bits!");
...@@ -32,7 +33,7 @@ public: ...@@ -32,7 +33,7 @@ public:
static_assert(std::is_trivial<VkNonDispatchableHandle<T>>::value, "VkNonDispatchableHandle<T> is not trivial!"); static_assert(std::is_trivial<VkNonDispatchableHandle<T>>::value, "VkNonDispatchableHandle<T> is not trivial!");
static_assert(std::is_standard_layout<VkNonDispatchableHandle<T>>::value, "VkNonDispatchableHandle<T> is not standard layout!"); static_assert(std::is_standard_layout<VkNonDispatchableHandle<T>>::value, "VkNonDispatchableHandle<T> is not standard layout!");
return reinterpret_cast<void*>(static_cast<uintptr_t>(handle)); return reinterpret_cast<void *>(static_cast<uintptr_t>(handle));
} }
void operator=(uint64_t h) void operator=(uint64_t h)
...@@ -48,12 +49,12 @@ public: ...@@ -48,12 +49,12 @@ public:
typedef VkNonDispatchableHandle<object##Ptr> object; \ typedef VkNonDispatchableHandle<object##Ptr> object; \
template class VkNonDispatchableHandle<object##Ptr>; template class VkNonDispatchableHandle<object##Ptr>;
#include <vulkan/vulkan.h>
#include <vulkan/vk_ext_provoking_vertex.h> #include <vulkan/vk_ext_provoking_vertex.h>
#include <vulkan/vulkan.h>
#ifdef Bool #ifdef Bool
#undef Bool // b/127920555 # undef Bool // b/127920555
#undef None # undef None
#endif #endif
#endif // VULKAN_PLATFORM #endif // VULKAN_PLATFORM
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#ifndef SWIFTSHADER_METALSURFACE_HPP #ifndef SWIFTSHADER_METALSURFACE_HPP
#define SWIFTSHADER_METALSURFACE_HPP #define SWIFTSHADER_METALSURFACE_HPP
#include "Vulkan/VkObject.hpp"
#include "VkSurfaceKHR.hpp" #include "VkSurfaceKHR.hpp"
#include "Vulkan/VkObject.hpp"
#ifdef VK_USE_PLATFORM_MACOS_MVK #ifdef VK_USE_PLATFORM_MACOS_MVK
# include "vulkan/vulkan_macos.h" # include "vulkan/vulkan_macos.h"
#endif #endif
...@@ -28,7 +28,8 @@ namespace vk { ...@@ -28,7 +28,8 @@ namespace vk {
class MetalLayer; class MetalLayer;
class MetalSurface : public SurfaceKHR { class MetalSurface : public SurfaceKHR
{
public: public:
MetalSurface(const void *pCreateInfo, void *mem); MetalSurface(const void *pCreateInfo, void *mem);
...@@ -38,27 +39,29 @@ public: ...@@ -38,27 +39,29 @@ public:
void getSurfaceCapabilities(VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) const override; void getSurfaceCapabilities(VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) const override;
virtual void attachImage(PresentImage* image) override {} virtual void attachImage(PresentImage *image) override {}
virtual void detachImage(PresentImage* image) override {} virtual void detachImage(PresentImage *image) override {}
VkResult present(PresentImage* image) override; VkResult present(PresentImage *image) override;
protected: protected:
MetalLayer* metalLayer = nullptr; MetalLayer *metalLayer = nullptr;
}; };
#ifdef VK_USE_PLATFORM_METAL_EXT #ifdef VK_USE_PLATFORM_METAL_EXT
class MetalSurfaceEXT : public MetalSurface, public ObjectBase<MetalSurfaceEXT, VkSurfaceKHR> { class MetalSurfaceEXT : public MetalSurface, public ObjectBase<MetalSurfaceEXT, VkSurfaceKHR>
{
public: public:
MetalSurfaceEXT(const VkMetalSurfaceCreateInfoEXT *pCreateInfo, void *mem); MetalSurfaceEXT(const VkMetalSurfaceCreateInfoEXT *pCreateInfo, void *mem);
}; };
#endif #endif
#ifdef VK_USE_PLATFORM_MACOS_MVK #ifdef VK_USE_PLATFORM_MACOS_MVK
class MacOSSurfaceMVK : public MetalSurface, public ObjectBase<MacOSSurfaceMVK, VkSurfaceKHR> { class MacOSSurfaceMVK : public MetalSurface, public ObjectBase<MacOSSurfaceMVK, VkSurfaceKHR>
{
public: public:
MacOSSurfaceMVK(const VkMacOSSurfaceCreateInfoMVK *pCreateInfo, void *mem); MacOSSurfaceMVK(const VkMacOSSurfaceCreateInfoMVK *pCreateInfo, void *mem);
}; };
#endif #endif
} } // namespace vk
#endif //SWIFTSHADER_METALSURFACE_HPP #endif //SWIFTSHADER_METALSURFACE_HPP
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment