Skip to content

Commit

Permalink
vulkan: Fix clang-format failures
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkY-LunarG committed Mar 13, 2024
1 parent da21984 commit 8253c30
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 173 deletions.
60 changes: 30 additions & 30 deletions framework/encode/vulkan_capture_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/*
** Copyright (c) 2018-2021 Valve Corporation
** Copyright (c) 2018-2023 LunarG, Inc.
** Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and associated documentation files (the "Software"),
** to deal in the Software without restriction, including without limitation
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
** and/or sell copies of the Software, and to permit persons to whom the
** Software is furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
** DEALINGS IN THE SOFTWARE.
*/
** Copyright (c) 2018-2021 Valve Corporation
** Copyright (c) 2018-2023 LunarG, Inc.
** Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and associated documentation files (the "Software"),
** to deal in the Software without restriction, including without limitation
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
** and/or sell copies of the Software, and to permit persons to whom the
** Software is furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
** DEALINGS IN THE SOFTWARE.
*/

#include "project_version.h"

Expand Down Expand Up @@ -420,8 +420,8 @@ void VulkanCaptureManager::SetDescriptorUpdateTemplateInfo(VkDescriptorUpdateTem

if (create_info->descriptorUpdateEntryCount > 0)
{
auto wrapper = GetVulkanWrapper<vulkan_wrappers::DescriptorUpdateTemplateWrapper>(update_template);
UpdateTemplateInfo* info = &wrapper->info;
auto wrapper = GetVulkanWrapper<vulkan_wrappers::DescriptorUpdateTemplateWrapper>(update_template);
UpdateTemplateInfo* info = &wrapper->info;

for (size_t i = 0; i < create_info->descriptorUpdateEntryCount; ++i)
{
Expand Down Expand Up @@ -637,7 +637,7 @@ VkResult VulkanCaptureManager::OverrideCreateDevice(VkPhysicalDevice

assert(pCreateInfo_unwrapped != nullptr);

const VulkanInstanceTable* instance_table = GetVulkanInstanceTable(physicalDevice);
const VulkanInstanceTable* instance_table = GetVulkanInstanceTable(physicalDevice);
auto physical_device_wrapper = GetVulkanWrapper<vulkan_wrappers::PhysicalDeviceWrapper>(physicalDevice);

graphics::VulkanDeviceUtil device_util;
Expand Down Expand Up @@ -1361,7 +1361,7 @@ void VulkanCaptureManager::DeferredOperationPostProcess(VkDevice d
VkResult result = VK_SUCCESS;
auto deferred_operation_wrapper = GetVulkanWrapper<vulkan_wrappers::DeferredOperationKHRWrapper>(deferredOperation);
auto device_wrapper = GetVulkanWrapper<vulkan_wrappers::DeviceWrapper>(device);
const VulkanDeviceTable* device_table = GetVulkanDeviceTable(device);
const VulkanDeviceTable* device_table = GetVulkanDeviceTable(device);

GFXRECON_ASSERT(device_table != nullptr);

Expand Down Expand Up @@ -1588,9 +1588,9 @@ void VulkanCaptureManager::ProcessEnumeratePhysicalDevices(VkResult res

auto physical_device_wrapper =
GetVulkanWrapper<vulkan_wrappers::PhysicalDeviceWrapper>(physical_device);
format::HandleId physical_device_id = physical_device_wrapper->handle_id;
VkPhysicalDevice physical_device_handle = physical_device_wrapper->handle;
uint32_t count = 0;
format::HandleId physical_device_id = physical_device_wrapper->handle_id;
VkPhysicalDevice physical_device_handle = physical_device_wrapper->handle;
uint32_t count = 0;

VkPhysicalDeviceProperties properties;
VkPhysicalDeviceMemoryProperties memory_properties;
Expand Down Expand Up @@ -2103,7 +2103,7 @@ void VulkanCaptureManager::PreProcess_vkFlushMappedMemoryRanges(VkDevice
if (GetMemoryTrackingMode() == CaptureSettings::MemoryTrackingMode::kPageGuard)
{
const vulkan_wrappers::DeviceMemoryWrapper* current_memory_wrapper = nullptr;
util::PageGuardManager* manager = util::PageGuardManager::Get();
util::PageGuardManager* manager = util::PageGuardManager::Get();
assert(manager != nullptr);

for (uint32_t i = 0; i < memoryRangeCount; ++i)
Expand Down
54 changes: 27 additions & 27 deletions framework/encode/vulkan_capture_manager.h
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/*
** Copyright (c) 2018-2021 Valve Corporation
** Copyright (c) 2018-2023 LunarG, Inc.
** Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and associated documentation files (the "Software"),
** to deal in the Software without restriction, including without limitation
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
** and/or sell copies of the Software, and to permit persons to whom the
** Software is furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
** DEALINGS IN THE SOFTWARE.
*/
** Copyright (c) 2018-2021 Valve Corporation
** Copyright (c) 2018-2023 LunarG, Inc.
** Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and associated documentation files (the "Software"),
** to deal in the Software without restriction, including without limitation
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
** and/or sell copies of the Software, and to permit persons to whom the
** Software is furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
** DEALINGS IN THE SOFTWARE.
*/

#ifndef GFXRECON_ENCODE_VULKAN_CAPTURE_MANAGER_H
#define GFXRECON_ENCODE_VULKAN_CAPTURE_MANAGER_H
Expand Down Expand Up @@ -1335,12 +1335,12 @@ class VulkanCaptureManager : public CaptureManager
private:
void QueueSubmitWriteFillMemoryCmd();

static VulkanCaptureManager* instance_;
static VulkanLayerTable vulkan_layer_table_;
static VulkanCaptureManager* instance_;
static VulkanLayerTable vulkan_layer_table_;
std::set<vulkan_wrappers::DeviceMemoryWrapper*> mapped_memory_; // Track mapped memory for unassisted tracking mode.
std::unique_ptr<VulkanStateTracker> state_tracker_;
HardwareBufferMap hardware_buffers_;
std::mutex deferred_operation_mutex;
std::unique_ptr<VulkanStateTracker> state_tracker_;
HardwareBufferMap hardware_buffers_;
std::mutex deferred_operation_mutex;
};

GFXRECON_END_NAMESPACE(encode)
Expand Down
114 changes: 57 additions & 57 deletions framework/encode/vulkan_handle_wrappers.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/*
** Copyright (c) 2019-2020 LunarG, Inc.
** Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and associated documentation files (the "Software"),
** to deal in the Software without restriction, including without limitation
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
** and/or sell copies of the Software, and to permit persons to whom the
** Software is furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
** DEALINGS IN THE SOFTWARE.
*/
** Copyright (c) 2019-2020 LunarG, Inc.
** Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and associated documentation files (the "Software"),
** to deal in the Software without restriction, including without limitation
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
** and/or sell copies of the Software, and to permit persons to whom the
** Software is furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
** DEALINGS IN THE SOFTWARE.
*/

#ifndef GFXRECON_ENCODE_VULKAN_HANDLE_WRAPPERS_H
#define GFXRECON_ENCODE_VULKAN_HANDLE_WRAPPERS_H
Expand Down Expand Up @@ -108,9 +108,9 @@ struct DisplayKHRWrapper : public HandleWrapper<VkDisplayKHR>
// handle wrapper, which will filter duplicate handle retrievals and ensure that the wrapper is destroyed.
struct PhysicalDeviceWrapper : public HandleWrapper<VkPhysicalDevice>
{
VulkanInstanceTable* layer_table_ref{ nullptr };
std::vector<DisplayKHRWrapper*> child_displays;
uint32_t instance_api_version{ 0 };
VulkanInstanceTable* layer_table_ref{ nullptr };
std::vector<DisplayKHRWrapper*> child_displays;
uint32_t instance_api_version{ 0 };

// Track memory types for use when creating snapshots of buffer and image resource memory content.
VkPhysicalDeviceMemoryProperties memory_properties{};
Expand All @@ -126,10 +126,10 @@ struct PhysicalDeviceWrapper : public HandleWrapper<VkPhysicalDevice>

struct InstanceWrapper : public HandleWrapper<VkInstance>
{
VulkanInstanceTable layer_table;
std::vector<PhysicalDeviceWrapper*> child_physical_devices;
bool have_device_properties{ false };
uint32_t api_version{ VK_MAKE_VERSION(1, 0, 0) };
VulkanInstanceTable layer_table;
std::vector<PhysicalDeviceWrapper*> child_physical_devices;
bool have_device_properties{ false };
uint32_t api_version{ VK_MAKE_VERSION(1, 0, 0) };
};

struct QueueWrapper : public HandleWrapper<VkQueue>
Expand All @@ -139,9 +139,9 @@ struct QueueWrapper : public HandleWrapper<VkQueue>

struct DeviceWrapper : public HandleWrapper<VkDevice>
{
VulkanDeviceTable layer_table;
PhysicalDeviceWrapper* physical_device{ nullptr };
std::vector<QueueWrapper*> child_queues;
VulkanDeviceTable layer_table;
PhysicalDeviceWrapper* physical_device{ nullptr };
std::vector<QueueWrapper*> child_queues;

// Physical device property & feature state at device creation
graphics::VulkanDevicePropertyFeatureInfo property_feature_info;
Expand All @@ -152,8 +152,8 @@ struct FenceWrapper : public HandleWrapper<VkFence>
{
// Signaled state at creation to be compared with signaled state at snapshot write. If states are different, the
// create parameters will need to be modified to reflect the state at snapshot write.
bool created_signaled{ false };
DeviceWrapper* device{ nullptr };
bool created_signaled{ false };
DeviceWrapper* device{ nullptr };
};

struct EventWrapper : public HandleWrapper<VkEvent>
Expand All @@ -170,15 +170,15 @@ struct DeviceMemoryWrapper : public HandleWrapper<VkDeviceMemory>
// The device wrapper will be initialized when allocating the memory. Some handling
// like StateTracker::TrackTlasToBlasDependencies may use it before mapping
// the memory.
DeviceWrapper* parent_device{ nullptr };
const void* mapped_data{ nullptr };
VkDeviceSize mapped_offset{ 0 };
VkDeviceSize mapped_size{ 0 };
VkMemoryMapFlags mapped_flags{ 0 };
void* external_allocation{ nullptr };
uintptr_t shadow_allocation{ util::PageGuardManager::kNullShadowHandle };
AHardwareBuffer* hardware_buffer{ nullptr };
format::HandleId hardware_buffer_memory_id{ format::kNullHandleId };
DeviceWrapper* parent_device{ nullptr };
const void* mapped_data{ nullptr };
VkDeviceSize mapped_offset{ 0 };
VkDeviceSize mapped_size{ 0 };
VkMemoryMapFlags mapped_flags{ 0 };
void* external_allocation{ nullptr };
uintptr_t shadow_allocation{ util::PageGuardManager::kNullShadowHandle };
AHardwareBuffer* hardware_buffer{ nullptr };
format::HandleId hardware_buffer_memory_id{ format::kNullHandleId };

// State tracking info for memory with device addresses.
format::HandleId device_id{ format::kNullHandleId };
Expand All @@ -187,8 +187,8 @@ struct DeviceMemoryWrapper : public HandleWrapper<VkDeviceMemory>

struct BufferWrapper : public HandleWrapper<VkBuffer>
{
DeviceWrapper* bind_device{ nullptr };
const void* bind_pnext{ nullptr };
DeviceWrapper* bind_device{ nullptr };
const void* bind_pnext{ nullptr };
HandleUnwrapMemory bind_pnext_memory; // Global HandleUnwrapMemory could be reset anytime, so it should have its own
// HandleUnwrapMemory.
format::HandleId bind_memory_id{ format::kNullHandleId };
Expand All @@ -203,8 +203,8 @@ struct BufferWrapper : public HandleWrapper<VkBuffer>

struct ImageWrapper : public HandleWrapper<VkImage>
{
DeviceWrapper* bind_device{ nullptr };
const void* bind_pnext{ nullptr };
DeviceWrapper* bind_device{ nullptr };
const void* bind_pnext{ nullptr };
HandleUnwrapMemory bind_pnext_memory; // Global HandleUnwrapMemory could be reset anytime, so it should have its own
// HandleUnwrapMemory.
format::HandleId bind_memory_id{ format::kNullHandleId };
Expand All @@ -229,8 +229,8 @@ struct BufferViewWrapper : public HandleWrapper<VkBufferView>

struct ImageViewWrapper : public HandleWrapper<VkImageView>
{
format::HandleId image_id{ format::kNullHandleId };
ImageWrapper* image{ nullptr };
format::HandleId image_id{ format::kNullHandleId };
ImageWrapper* image{ nullptr };
};

struct FramebufferWrapper : public HandleWrapper<VkFramebuffer>
Expand All @@ -252,9 +252,9 @@ struct SemaphoreWrapper : public HandleWrapper<VkSemaphore>
// AcquireNextImageKHR, or AcquireNextImage2KHR as a signal semaphore. State is not signaled when a semaphore is
// submitted to QueueSubmit, QueueBindSparse, or QueuePresentKHR as a wait semaphore. Initial state after creation
// is not signaled.
bool signaled{ false };
VkSemaphoreType type{ VK_SEMAPHORE_TYPE_BINARY_KHR };
DeviceWrapper* device{ nullptr };
bool signaled{ false };
VkSemaphoreType type{ VK_SEMAPHORE_TYPE_BINARY_KHR };
DeviceWrapper* device{ nullptr };
};

struct QueryPoolWrapper : public HandleWrapper<VkQueryPool>
Expand Down Expand Up @@ -406,8 +406,8 @@ struct CommandPoolWrapper : public HandleWrapper<VkCommandPool>
// Members for trimming state tracking.
uint32_t queue_family_index{ 0 };

DeviceWrapper* device{ nullptr };
bool trim_command_pool{ false };
DeviceWrapper* device{ nullptr };
bool trim_command_pool{ false };
};

// For vkGetPhysicalDeviceSurfaceCapabilitiesKHR
Expand Down Expand Up @@ -498,10 +498,10 @@ struct AccelerationStructureNVWrapper : public HandleWrapper<VkAccelerationStruc

struct PrivateDataSlotWrapper : public HandleWrapper<VkPrivateDataSlot>
{
DeviceWrapper* device{ nullptr };
VkObjectType object_type{ VK_OBJECT_TYPE_UNKNOWN };
uint64_t object_handle{ 0 };
uint64_t data{ 0 };
DeviceWrapper* device{ nullptr };
VkObjectType object_type{ VK_OBJECT_TYPE_UNKNOWN };
uint64_t object_handle{ 0 };
uint64_t data{ 0 };
};

// Handle alias types for extension handle types that have been promoted to core types.
Expand Down
Loading

0 comments on commit 8253c30

Please sign in to comment.