Skip to content

Commit 6eb6fb6

Browse files
committed
Remove isEmulatingExtFrameBoundary
1 parent 3c694f5 commit 6eb6fb6

File tree

4 files changed

+6
-61
lines changed

4 files changed

+6
-61
lines changed

layer_gpu_timeline/source/device.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,6 @@ class Device
185185
*/
186186
static const std::vector<DeviceCreatePatchPtr> createInfoPatches;
187187

188-
/**
189-
* @brief Is this layer emulating VK_EXT_frame_boundary?
190-
*
191-
* Set to @c true if layer is emulating on top of a driver that doesn't
192-
* support it, @c false if layer knows driver supports it.
193-
*/
194-
bool isEmulatingExtFrameBoundary { false };
195-
196188
private:
197189
/**
198190
* @brief State tracker for this device.

layer_gpu_timeline/source/layer_device_functions_queue.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static void emitCommandBufferMetadata(Device& layer,
107107
* @param workloadVisitor Visitor for the protobuf encoder.
108108
*/
109109
static void checkManualFrameBoundary(
110-
Device* layer,
110+
Device& layer,
111111
VkQueue queue,
112112
const void* pNext,
113113
bool isLastSubmit,
@@ -118,10 +118,10 @@ static void checkManualFrameBoundary(
118118
if (ext && (ext->flags & VK_FRAME_BOUNDARY_FRAME_END_BIT_EXT))
119119
{
120120
// Emulate a queue present to indicate end of frame
121-
auto& tracker = layer->getStateTracker();
121+
auto& tracker = layer.getStateTracker();
122122
tracker.queuePresent();
123123

124-
TimelineProtobufEncoder::emitFrame(*layer, tracker.totalStats.getFrameCount(), getClockMonotonicRaw());
124+
TimelineProtobufEncoder::emitFrame(layer, tracker.totalStats.getFrameCount(), getClockMonotonicRaw());
125125

126126
// Emulate a new queue submit if work remains to submit
127127
if (!isLastSubmit)
@@ -148,12 +148,6 @@ VKAPI_ATTR VkResult VKAPI_CALL layer_vkQueuePresentKHR<user_tag>(VkQueue queue,
148148
vku::safe_VkPresentInfoKHR safePresentInfo(pPresentInfo);
149149
auto* newPresentInfo = reinterpret_cast<VkPresentInfoKHR*>(&safePresentInfo);
150150

151-
// Remove emulated frame boundaries
152-
if (layer->isEmulatingExtFrameBoundary)
153-
{
154-
vku::RemoveFromPnext(safePresentInfo, VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT);
155-
}
156-
157151
// Note that we assume QueuePresent is _always_ the end of a frame.
158152
// This is run with the lock held to ensure that all queue submit messages
159153
// are sent sequentially to the host tool
@@ -194,7 +188,7 @@ VKAPI_ATTR VkResult VKAPI_CALL
194188

195189
// Check for end of frame boundary
196190
bool isLast = i == submitCount - 1;
197-
checkManualFrameBoundary(layer, queue, submit.pNext, isLast, workloadVisitor);
191+
checkManualFrameBoundary(*layer, queue, submit.pNext, isLast, workloadVisitor);
198192
}
199193

200194
// Release the lock to call into the driver
@@ -232,7 +226,7 @@ VKAPI_ATTR VkResult VKAPI_CALL
232226

233227
// Check for end of frame boundary
234228
bool isLast = i == submitCount - 1;
235-
checkManualFrameBoundary(layer, queue, submit.pNext, isLast, workloadVisitor);
229+
checkManualFrameBoundary(*layer, queue, submit.pNext, isLast, workloadVisitor);
236230
}
237231

238232
// Release the lock to call into the driver
@@ -270,7 +264,7 @@ VKAPI_ATTR VkResult VKAPI_CALL
270264

271265
// Check for end of frame boundary
272266
bool isLast = i == submitCount - 1;
273-
checkManualFrameBoundary(layer, queue, submit.pNext, isLast, workloadVisitor);
267+
checkManualFrameBoundary(*layer, queue, submit.pNext, isLast, workloadVisitor);
274268
}
275269

276270
// Release the lock to call into the driver

layer_gpu_timeline/source/layer_instance_functions.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,39 +31,6 @@
3131

3232
extern std::mutex g_vulkanLock;
3333

34-
/* See header for documentation. */
35-
template <>
36-
VKAPI_ATTR VkResult VKAPI_CALL layer_vkCreateDevice<user_tag>(
37-
VkPhysicalDevice physicalDevice,
38-
const VkDeviceCreateInfo* pCreateInfo,
39-
const VkAllocationCallbacks* pAllocator,
40-
VkDevice* pDevice
41-
) {
42-
LAYER_TRACE(__func__);
43-
44-
// Use the default function for the heavy-lifting
45-
auto res = layer_vkCreateDevice<default_tag>(physicalDevice, pCreateInfo, pAllocator, pDevice);
46-
if (res != VK_SUCCESS)
47-
{
48-
return res;
49-
}
50-
51-
// Cache flags indicating extension emulation
52-
std::unique_lock<std::mutex> lock {g_vulkanLock};
53-
auto* layer = Device::retrieve(*pDevice);
54-
55-
static const std::string target { VK_EXT_FRAME_BOUNDARY_EXTENSION_NAME };
56-
for (auto& ext : layer->instance->injectedDeviceExtensions)
57-
{
58-
if (ext.first == target)
59-
{
60-
layer->isEmulatingExtFrameBoundary = true;
61-
}
62-
}
63-
64-
return res;
65-
}
66-
6734
/* See Vulkan API for documentation. */
6835
template <>
6936
VKAPI_ATTR void VKAPI_CALL layer_vkGetPhysicalDeviceFeatures2<user_tag>(

layer_gpu_timeline/source/layer_instance_functions.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@
2929

3030
// Functions for devices
3131

32-
/* See Vulkan API for documentation. */
33-
template <>
34-
VKAPI_ATTR VkResult VKAPI_CALL layer_vkCreateDevice<user_tag>(
35-
VkPhysicalDevice physicalDevice,
36-
const VkDeviceCreateInfo* pCreateInfo,
37-
const VkAllocationCallbacks* pAllocator,
38-
VkDevice* pDevice);
39-
4032
/* See Vulkan API for documentation. */
4133
template <>
4234
VKAPI_ATTR void VKAPI_CALL layer_vkGetPhysicalDeviceFeatures2<user_tag>(

0 commit comments

Comments
 (0)