Skip to content

Commit

Permalink
Make device extensions configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
solidpixel committed Jan 20, 2025
1 parent 6f708e6 commit b814cd1
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 105 deletions.
3 changes: 3 additions & 0 deletions generator/vk_layer/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
*/
static std::unordered_map<void*, std::unique_ptr<Device>> g_devices;

/* See header for documentation. */
const std::vector<std::string> Device::extraExtensions { };

/* See header for documentation. */
void Device::store(
VkDevice handle,
Expand Down
18 changes: 12 additions & 6 deletions generator/vk_layer/source/device.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: MIT
* ----------------------------------------------------------------------------
* Copyright (c) 2024 Arm Limited
* Copyright (c) 2024-2025 Arm Limited
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
Expand Down Expand Up @@ -132,6 +132,17 @@ class Device
~Device() = default;

public:
/**
* @brief The driver function dispatch table.
*/
DeviceDispatchTable driver {};

/**
* @brief The minimum set of device extensions needed by this layer.
*/
static const std::vector<std::string> extraExtensions;

private:
/**
* @brief The instance this device is created with.
*/
Expand All @@ -146,9 +157,4 @@ class Device
* @brief The device handle this device is created with.
*/
const VkDevice device;

/**
* @brief The driver function dispatch table.
*/
DeviceDispatchTable driver {};
};
3 changes: 3 additions & 0 deletions layer_example/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
*/
static std::unordered_map<void*, std::unique_ptr<Device>> g_devices;

/* See header for documentation. */
const std::vector<std::string> Device::extraExtensions { };

/* See header for documentation. */
void Device::store(
VkDevice handle,
Expand Down
18 changes: 12 additions & 6 deletions layer_example/source/device.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: MIT
* ----------------------------------------------------------------------------
* Copyright (c) 2024 Arm Limited
* Copyright (c) 2024-2025 Arm Limited
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
Expand Down Expand Up @@ -132,6 +132,17 @@ class Device
~Device() = default;

public:
/**
* @brief The driver function dispatch table.
*/
DeviceDispatchTable driver {};

/**
* @brief The minimum set of device extensions needed by this layer.
*/
static const std::vector<std::string> extraExtensions;

private:
/**
* @brief The instance this device is created with.
*/
Expand All @@ -146,9 +157,4 @@ class Device
* @brief The device handle this device is created with.
*/
const VkDevice device;

/**
* @brief The driver function dispatch table.
*/
DeviceDispatchTable driver {};
};
5 changes: 5 additions & 0 deletions layer_gpu_support/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
*/
static std::unordered_map<void*, std::unique_ptr<Device>> g_devices;

/* See header for documentation. */
const std::vector<std::string> Device::extraExtensions {
"VK_KHR_timeline_semaphore"
};

/* See header for documentation. */
void Device::store(
VkDevice handle,
Expand Down
16 changes: 11 additions & 5 deletions layer_gpu_support/source/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ class Device
~Device() = default;

public:
/**
* @brief The driver function dispatch table.
*/
DeviceDispatchTable driver {};

/**
* @brief The minimum set of device extensions needed by this layer.
*/
static const std::vector<std::string> extraExtensions;

private:
/**
* @brief The instance this device is created with.
*/
Expand All @@ -146,9 +157,4 @@ class Device
* @brief The device handle this device is created with.
*/
const VkDevice device;

/**
* @brief The driver function dispatch table.
*/
DeviceDispatchTable driver {};
};
3 changes: 3 additions & 0 deletions layer_gpu_timeline/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
*/
static std::unordered_map<void*, std::unique_ptr<Device>> g_devices;

/* See header for documentation. */
const std::vector<std::string> Device::extraExtensions { };

/* See header for documentation. */
std::unique_ptr<Comms::CommsModule> Device::commsModule;

Expand Down
5 changes: 5 additions & 0 deletions layer_gpu_timeline/source/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ class Device
*/
DeviceDispatchTable driver {};

/**
* @brief The minimum set of device extensions needed by this layer.
*/
static const std::vector<std::string> extraExtensions;

private:
/**
* @brief The instance this device is created with.
Expand Down
Loading

0 comments on commit b814cd1

Please sign in to comment.