Skip to content

Commit bd5eda3

Browse files
committed
Code style cleanup
1 parent 9446e54 commit bd5eda3

26 files changed

+331
-507
lines changed

generator/vk_layer/source/device.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
#include "device.hpp"
3535
#include "instance.hpp"
3636

37+
/**
38+
* @brief The dispatch lookup for all of the created Vulkan instances.
39+
*/
3740
static std::unordered_map<void*, std::unique_ptr<Device>> g_devices;
3841

3942
/* See header for documentation. */
@@ -47,26 +50,26 @@ void Device::store(
4750

4851
/* See header for documentation. */
4952
Device* Device::retrieve(
50-
VkDevice handle)
51-
{
53+
VkDevice handle
54+
) {
5255
void* key = getDispatchKey(handle);
5356
assert(isInMap(key, g_devices));
5457
return g_devices.at(key).get();
5558
}
5659

5760
/* See header for documentation. */
5861
Device* Device::retrieve(
59-
VkQueue handle)
60-
{
62+
VkQueue handle
63+
) {
6164
void* key = getDispatchKey(handle);
6265
assert(isInMap(key, g_devices));
6366
return g_devices.at(key).get();
6467
}
6568

6669
/* See header for documentation. */
6770
Device* Device::retrieve(
68-
VkCommandBuffer handle)
69-
{
71+
VkCommandBuffer handle
72+
) {
7073
void* key = getDispatchKey(handle);
7174
assert(isInMap(key, g_devices));
7275
return g_devices.at(key).get();
@@ -85,15 +88,10 @@ Device::Device(
8588
VkPhysicalDevice _physicalDevice,
8689
VkDevice _device,
8790
PFN_vkGetDeviceProcAddr nlayerGetProcAddress
88-
): instance(_instance),
91+
):
92+
instance(_instance),
8993
physicalDevice(_physicalDevice),
9094
device(_device)
9195
{
9296
initDriverDeviceDispatchTable(device, nlayerGetProcAddress, driver);
9397
}
94-
95-
/* See header for documentation. */
96-
Device::~Device()
97-
{
98-
99-
}

generator/vk_layer/source/device.hpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
*/
2525

2626
/**
27-
* @file
28-
* Declares the root class for layer management of VkDevice objects.
27+
* @file Declares the root class for layer management of VkDevice objects.
2928
*
3029
* Role summary
3130
* ============
@@ -41,10 +40,9 @@
4140
* Key properties
4241
* ==============
4342
*
44-
* Unlike EGL contexts, Vulkan devices are designed to be used concurrently by
45-
* multiple application threads. An application can have multiple concurrent
46-
* devices (although this is less common than with OpenGL ES applications), and
47-
* use each device from multiple threads.
43+
* Vulkan devices are designed to be used concurrently by multiple application
44+
* threads. An application can have multiple concurrent devices, and use each
45+
* device from multiple threads.
4846
*
4947
* Access to the layer driver structures must therefore be kept thread-safe.
5048
* For sake of simplicity, we generally implement this by:
@@ -80,6 +78,8 @@ class Device
8078
* @brief Fetch a device from the global store of dispatchable devices.
8179
*
8280
* @param handle The dispatchable device handle to use as an indirect lookup.
81+
*
82+
* @return The layer device context.
8383
*/
8484
static Device* retrieve(
8585
VkDevice handle);
@@ -88,6 +88,8 @@ class Device
8888
* @brief Fetch a device from the global store of dispatchable devices.
8989
*
9090
* @param handle The dispatchable queue handle to use as an indirect lookup.
91+
*
92+
* @return The layer device context.
9193
*/
9294
static Device* retrieve(
9395
VkQueue handle);
@@ -96,6 +98,8 @@ class Device
9698
* @brief Fetch a device from the global store of dispatchable devices.
9799
*
98100
* @param handle The dispatchable command buffer handle to use as an indirect lookup.
101+
*
102+
* @return The layer device context.
99103
*/
100104
static Device* retrieve(
101105
VkCommandBuffer handle);
@@ -125,7 +129,7 @@ class Device
125129
/**
126130
* @brief Destroy this layer device object.
127131
*/
128-
~Device();
132+
~Device() = default;
129133

130134
public:
131135
/**

generator/vk_layer/source/instance.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929

3030
#include "instance.hpp"
3131

32+
/**
33+
* @brief The dispatch lookup for all of the created Vulkan instances.
34+
*/
3235
static std::unordered_map<void*, std::unique_ptr<Instance>> g_instances;
3336

3437
/* See header for documentation. */
@@ -42,17 +45,17 @@ void Instance::store(
4245

4346
/* See header for documentation. */
4447
Instance* Instance::retrieve(
45-
VkInstance handle)
46-
{
48+
VkInstance handle
49+
) {
4750
void* key = getDispatchKey(handle);
4851
assert(isInMap(key, g_instances));
4952
return g_instances.at(key).get();
5053
}
5154

5255
/* See header for documentation. */
5356
Instance* Instance::retrieve(
54-
VkPhysicalDevice handle)
55-
{
57+
VkPhysicalDevice handle
58+
) {
5659
void* key = getDispatchKey(handle);
5760
assert(isInMap(key, g_instances));
5861
return g_instances.at(key).get();
@@ -68,7 +71,8 @@ void Instance::destroy(
6871
/* See header for documentation. */
6972
Instance::Instance(
7073
VkInstance _instance,
71-
PFN_vkGetInstanceProcAddr _nlayerGetProcAddress) :
74+
PFN_vkGetInstanceProcAddr _nlayerGetProcAddress
75+
) :
7276
instance(_instance),
7377
nlayerGetProcAddress(_nlayerGetProcAddress)
7478
{

generator/vk_layer/source/instance.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@
4242
* Key properties
4343
* ==============
4444
*
45-
* Unlike EGL contexts, Vulkan instances are designed to be used concurrently
46-
* by multiple application threads. An application can have multiple concurrent
47-
* instances (although this is less common than with OpenGL ES applications),
45+
* Vulkan instances are designed to be used concurrently by multiple
46+
* application threads. An application can have multiple concurrent instances,
4847
* and use each instance from multiple threads.
4948
*
5049
* Access to the layer driver structures must therefore be kept thread-safe.
@@ -65,10 +64,6 @@
6564

6665
/**
6766
* @brief This class implements the layer state tracker for a single instance.
68-
*
69-
* These objects are relatively light-weight, as they are rarely used once a VkDevice has been
70-
* created, but we need to track the chain-of-ownership as the instance is the root object that
71-
* the application creates when initializing a rendering context.
7267
*/
7368
class Instance
7469
{
@@ -87,6 +82,8 @@ class Instance
8782
* @brief Fetch an instance from the global store of dispatchable instances.
8883
*
8984
* @param handle The dispatchable instance handle to use as an indirect lookup.
85+
*
86+
* @return The layer instance context.
9087
*/
9188
static Instance* retrieve(
9289
VkInstance handle);
@@ -95,6 +92,8 @@ class Instance
9592
* @brief Fetch an instance from the global store of dispatchable instances.
9693
*
9794
* @param handle The dispatchable physical device handle to use as an indirect lookup.
95+
*
96+
* @return The layer instance context.
9897
*/
9998
static Instance* retrieve(
10099
VkPhysicalDevice handle);

generator/vk_layer/source/version.hpp.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
*/
2525

2626
/**
27-
* @file
28-
* This header implements placeholder templates that are populated by CMake
29-
* during configure.
27+
* @file Placeholder templates that are populated by CMake during configure.
3028
*/
3129

3230
#pragma once

0 commit comments

Comments
 (0)