Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ jobs:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j4

- name: Build layer_gpu_profile
run: |
export CC=clang
export CXX=clang++
mkdir layer_gpu_profile/build_rel
cd layer_gpu_profile/build_rel
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j4

- name: Build and run unit tests
run: |
export CC=clang
Expand Down Expand Up @@ -126,6 +135,15 @@ jobs:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j4

- name: Build layer_gpu_profile
run: |
export CC=gcc
export CXX=g++
mkdir layer_gpu_profile/build_rel
cd layer_gpu_profile/build_rel
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j4

build-android:
name: Android
runs-on: ubuntu-22.04
Expand All @@ -150,6 +168,11 @@ jobs:
cd layer_gpu_timeline
bash ./android_build.sh Release

- name: Build layer_gpu_profile
run: |
cd layer_gpu_profile
bash ./android_build.sh Release

build-ubuntu-x64-clang-new-common:
name: Ubuntu x64 generate common
runs-on: ubuntu-22.04
Expand Down
11 changes: 8 additions & 3 deletions generator/vk_layer/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,15 @@ Device* Device::retrieve(
}

/* See header for documentation. */
void Device::destroy(
Device* device
std::unique_ptr<Device> Device::destroy(
VkDevice handle
) {
g_devices.erase(getDispatchKey(device));
void* key = getDispatchKey(handle);
assert(isInMap(key, g_devices));

auto device = std::move(g_devices.at(key));
g_devices.erase(key);
return device;
}

/* See header for documentation. */
Expand Down
13 changes: 9 additions & 4 deletions generator/vk_layer/source/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,17 @@ class Device
VkCommandBuffer handle);

/**
* @brief Drop a device from the global store of dispatchable devices.
* \brief Drop a device from the global store of dispatchable devices.
*
* @param device The device to drop.
* This must be called before the driver VkDevice has been destroyed, as
* we deference the native device handle to get the dispatch key.
*
* \param handle The dispatchable device handle to use as an indirect lookup.
*
* \return Returns the ownership of the Device object to the caller.
*/
static void destroy(
Device* device);
static std::unique_ptr<Device> destroy(
VkDevice handle);

/**
* @brief Create a new layer device object.
Expand Down
11 changes: 8 additions & 3 deletions generator/vk_layer/source/instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ Instance* Instance::retrieve(
}

/* See header for documentation. */
void Instance::destroy(
Instance* instance
std::unique_ptr<Instance> Instance::destroy(
VkInstance handle
) {
g_instances.erase(getDispatchKey(instance->instance));
void* key = getDispatchKey(handle);
assert(isInMap(key, g_instances));

auto instance = std::move(g_instances.at(key));
g_instances.erase(key);
return instance;
}

/* See header for documentation. */
Expand Down
13 changes: 9 additions & 4 deletions generator/vk_layer/source/instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,17 @@ class Instance
VkPhysicalDevice handle);

/**
* @brief Drop an instance from the global store of dispatchable instances.
* \brief Drop an instance from the global store of dispatchable instances.
*
* @param instance The instance to drop.
* This must be called before the driver VkInstance has been destroyed, as
* we deference the native instance handle to get the dispatch key.
*
* \param handle The dispatchable instance handle to use as an indirect lookup.
*
* \return Returns the ownership of the Instance object to the caller.
*/
static void destroy(
Instance* instance);
static std::unique_ptr<Instance> destroy(
VkInstance handle);

/**
* @brief Create a new layer instance object.
Expand Down
12 changes: 9 additions & 3 deletions layer_example/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,15 @@ Device* Device::retrieve(VkCommandBuffer handle)
}

/* See header for documentation. */
void Device::destroy(Device* device)
{
g_devices.erase(getDispatchKey(device));
std::unique_ptr<Device> Device::destroy(
VkDevice handle
) {
void* key = getDispatchKey(handle);
assert(isInMap(key, g_devices));

auto device = std::move(g_devices.at(key));
g_devices.erase(key);
return device;
}

/* See header for documentation. */
Expand Down
12 changes: 9 additions & 3 deletions layer_example/source/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,17 @@ class Device
static Device* retrieve(VkCommandBuffer handle);

/**
* @brief Drop a device from the global store of dispatchable devices.
* \brief Drop a device from the global store of dispatchable devices.
*
* @param device The device to drop.
* This must be called before the driver VkDevice has been destroyed, as
* we deference the native device handle to get the dispatch key.
*
* \param handle The dispatchable device handle to use as an indirect lookup.
*
* \return Returns the ownership of the Device object to the caller.
*/
static void destroy(Device* device);
static std::unique_ptr<Device> destroy(
VkDevice handle);

/**
* @brief Create a new layer device object.
Expand Down
12 changes: 9 additions & 3 deletions layer_example/source/instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ Instance* Instance::retrieve(VkPhysicalDevice handle)
}

/* See header for documentation. */
void Instance::destroy(Instance* instance)
{
g_instances.erase(getDispatchKey(instance->instance));
std::unique_ptr<Instance> Instance::destroy(
VkInstance handle
) {
void* key = getDispatchKey(handle);
assert(isInMap(key, g_instances));

auto instance = std::move(g_instances.at(key));
g_instances.erase(key);
return instance;
}

/* See header for documentation. */
Expand Down
12 changes: 9 additions & 3 deletions layer_example/source/instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,17 @@ class Instance
static Instance* retrieve(VkPhysicalDevice handle);

/**
* @brief Drop an instance from the global store of dispatchable instances.
* \brief Drop an instance from the global store of dispatchable instances.
*
* @param instance The instance to drop.
* This must be called before the driver VkInstance has been destroyed, as
* we deference the native instance handle to get the dispatch key.
*
* \param handle The dispatchable instance handle to use as an indirect lookup.
*
* \return Returns the ownership of the Instance object to the caller.
*/
static void destroy(Instance* instance);
static std::unique_ptr<Instance> destroy(
VkInstance handle);

/**
* @brief Create a new layer instance object.
Expand Down
12 changes: 9 additions & 3 deletions layer_gpu_profile/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,15 @@ Device* Device::retrieve(VkCommandBuffer handle)
}

/* See header for documentation. */
void Device::destroy(Device* device)
{
g_devices.erase(getDispatchKey(device));
std::unique_ptr<Device> Device::destroy(
VkDevice handle
) {
void* key = getDispatchKey(handle);
assert(isInMap(key, g_devices));

auto device = std::move(g_devices.at(key));
g_devices.erase(key);
return device;
}

/* See header for documentation. */
Expand Down
12 changes: 9 additions & 3 deletions layer_gpu_profile/source/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,17 @@ class Device
static Device* retrieve(VkCommandBuffer handle);

/**
* @brief Drop a device from the global store of dispatchable devices.
* \brief Drop a device from the global store of dispatchable devices.
*
* @param device The device to drop.
* This must be called before the driver VkDevice has been destroyed, as
* we deference the native device handle to get the dispatch key.
*
* \param handle The dispatchable device handle to use as an indirect lookup.
*
* \return Returns the ownership of the Device object to the caller.
*/
static void destroy(Device* device);
static std::unique_ptr<Device> destroy(
VkDevice handle);

/**
* @brief Create a new layer device object.
Expand Down
12 changes: 9 additions & 3 deletions layer_gpu_profile/source/instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ Instance* Instance::retrieve(VkPhysicalDevice handle)
}

/* See header for documentation. */
void Instance::destroy(Instance* instance)
{
g_instances.erase(getDispatchKey(instance->instance));
std::unique_ptr<Instance> Instance::destroy(
VkInstance handle
) {
void* key = getDispatchKey(handle);
assert(isInMap(key, g_instances));

auto instance = std::move(g_instances.at(key));
g_instances.erase(key);
return instance;
}

/* See header for documentation. */
Expand Down
12 changes: 9 additions & 3 deletions layer_gpu_profile/source/instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,17 @@ class Instance
static Instance* retrieve(VkPhysicalDevice handle);

/**
* @brief Drop an instance from the global store of dispatchable instances.
* \brief Drop an instance from the global store of dispatchable instances.
*
* @param instance The instance to drop.
* This must be called before the driver VkInstance has been destroyed, as
* we deference the native instance handle to get the dispatch key.
*
* \param handle The dispatchable instance handle to use as an indirect lookup.
*
* \return Returns the ownership of the Instance object to the caller.
*/
static void destroy(Instance* instance);
static std::unique_ptr<Instance> destroy(
VkInstance handle);

/**
* @brief Create a new layer instance object.
Expand Down
12 changes: 9 additions & 3 deletions layer_gpu_support/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,15 @@ Device* Device::retrieve(VkCommandBuffer handle)
}

/* See header for documentation. */
void Device::destroy(Device* device)
{
g_devices.erase(getDispatchKey(device));
std::unique_ptr<Device> Device::destroy(
VkDevice handle
) {
void* key = getDispatchKey(handle);
assert(isInMap(key, g_devices));

auto device = std::move(g_devices.at(key));
g_devices.erase(key);
return device;
}

/* See header for documentation. */
Expand Down
12 changes: 9 additions & 3 deletions layer_gpu_support/source/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,17 @@ class Device
static Device* retrieve(VkCommandBuffer handle);

/**
* @brief Drop a device from the global store of dispatchable devices.
* \brief Drop a device from the global store of dispatchable devices.
*
* @param device The device to drop.
* This must be called before the driver VkDevice has been destroyed, as
* we deference the native device handle to get the dispatch key.
*
* \param handle The dispatchable device handle to use as an indirect lookup.
*
* \return Returns the ownership of the Device object to the caller.
*/
static void destroy(Device* device);
static std::unique_ptr<Device> destroy(
VkDevice handle);

/**
* @brief Create a new layer device object.
Expand Down
12 changes: 9 additions & 3 deletions layer_gpu_support/source/instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ Instance* Instance::retrieve(VkPhysicalDevice handle)
}

/* See header for documentation. */
void Instance::destroy(Instance* instance)
{
g_instances.erase(getDispatchKey(instance->instance));
std::unique_ptr<Instance> Instance::destroy(
VkInstance handle
) {
void* key = getDispatchKey(handle);
assert(isInMap(key, g_instances));

auto instance = std::move(g_instances.at(key));
g_instances.erase(key);
return instance;
}

/* See header for documentation. */
Expand Down
12 changes: 9 additions & 3 deletions layer_gpu_support/source/instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,17 @@ class Instance
static Instance* retrieve(VkPhysicalDevice handle);

/**
* @brief Drop an instance from the global store of dispatchable instances.
* \brief Drop an instance from the global store of dispatchable instances.
*
* @param instance The instance to drop.
* This must be called before the driver VkInstance has been destroyed, as
* we deference the native instance handle to get the dispatch key.
*
* \param handle The dispatchable instance handle to use as an indirect lookup.
*
* \return Returns the ownership of the Instance object to the caller.
*/
static void destroy(Instance* instance);
static std::unique_ptr<Instance> destroy(
VkInstance handle);

/**
* @brief Create a new layer instance object.
Expand Down
12 changes: 9 additions & 3 deletions layer_gpu_timeline/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ Device* Device::retrieve(VkCommandBuffer handle)
}

/* See header for documentation. */
void Device::destroy(Device* device)
{
g_devices.erase(getDispatchKey(device));
std::unique_ptr<Device> Device::destroy(
VkDevice handle
) {
void* key = getDispatchKey(handle);
assert(isInMap(key, g_devices));

auto device = std::move(g_devices.at(key));
g_devices.erase(key);
return device;
}

/* See header for documentation. */
Expand Down
Loading