Skip to content

Commit 5e09077

Browse files
committed
Code style cleanup
1 parent f33c4da commit 5e09077

File tree

7 files changed

+57
-55
lines changed

7 files changed

+57
-55
lines changed

layer_gpu_timeline/source/layer_device_functions_debug.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* SPDX-License-Identifier: MIT
33
* ----------------------------------------------------------------------------
4-
* Copyright (c) 2024 Arm Limited
4+
* Copyright (c) 2024-2025 Arm Limited
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to
@@ -44,7 +44,7 @@ VKAPI_ATTR void VKAPI_CALL layer_vkCmdDebugMarkerBeginEXT<user_tag>(VkCommandBuf
4444
auto& tracker = layer->getStateTracker();
4545
auto& cb = tracker.getCommandBuffer(commandBuffer);
4646

47-
// Increment the render pass counter in the tracker
47+
// Push the label scope to the tracker
4848
cb.debugMarkerBegin(pMarkerInfo->pMarkerName);
4949

5050
// Note that we do not call the driver for user labels - they are
@@ -65,7 +65,7 @@ VKAPI_ATTR void VKAPI_CALL layer_vkCmdDebugMarkerEndEXT<user_tag>(VkCommandBuffe
6565
auto& tracker = layer->getStateTracker();
6666
auto& cb = tracker.getCommandBuffer(commandBuffer);
6767

68-
// Increment the render pass counter in the tracker
68+
// Pop the label scope in the tracker
6969
cb.debugMarkerEnd();
7070

7171
// Note that we do not call the driver for user labels - they are
@@ -87,7 +87,7 @@ VKAPI_ATTR void VKAPI_CALL layer_vkCmdBeginDebugUtilsLabelEXT<user_tag>(VkComman
8787
auto& tracker = layer->getStateTracker();
8888
auto& cb = tracker.getCommandBuffer(commandBuffer);
8989

90-
// Increment the render pass counter in the tracker
90+
// Push the label scope to the tracker
9191
cb.debugMarkerBegin(pLabelInfo->pLabelName);
9292

9393
// Note that we do not call the driver for user labels - they are
@@ -108,7 +108,7 @@ VKAPI_ATTR void VKAPI_CALL layer_vkCmdEndDebugUtilsLabelEXT<user_tag>(VkCommandB
108108
auto& tracker = layer->getStateTracker();
109109
auto& cb = tracker.getCommandBuffer(commandBuffer);
110110

111-
// Increment the render pass counter in the tracker
111+
// Pop the label scope in the tracker
112112
cb.debugMarkerEnd();
113113

114114
// Note that we do not call the driver for user labels - they are

layer_gpu_timeline/source/timeline_protobuf_encoder.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ using Submit = pp::message<
8787
/* The VkQueue the frame belongs to */
8888
pp::uint64_field<"queue", 3>>;
8989

90-
/* Enumerates the possible attachment types a renderpass can have */
90+
/* Enumerates the possible attachment types a render pass can have */
9191
enum class RenderpassAttachmentType
9292
{
9393
undefined = 0,
@@ -96,7 +96,7 @@ enum class RenderpassAttachmentType
9696
stencil = 3,
9797
};
9898

99-
/* Describe an attachment to a renderpass */
99+
/* Describe an attachment to a render pass */
100100
using RenderpassAttachment = pp::message<
101101
/* The attachment type */
102102
pp::enum_field<"type", 1, RenderpassAttachmentType>,
@@ -112,29 +112,29 @@ using RenderpassAttachment = pp::message<
112112
things are not resolved, so this saves a field in the data) */
113113
pp::bool_field<"resolved", 5>>;
114114

115-
/* Start a new renderpass */
115+
/* Start a new render pass */
116116
using BeginRenderpass = pp::message<
117-
/* The unique identifier for this new renderpass */
117+
/* The unique identifier for this new render pass */
118118
pp::uint64_field<"tag_id", 1>,
119-
/* The dimensions of the renderpass' attachments */
119+
/* The dimensions of the render pass' attachments */
120120
pp::uint32_field<"width", 2>,
121121
pp::uint32_field<"height", 3>,
122-
/* The number of drawcalls in the renderpass */
122+
/* The number of drawcalls in the render pass */
123123
pp::uint32_field<"draw_call_count", 4>,
124124
/* The subpass count */
125125
pp::uint32_field<"subpass_count", 5>,
126-
/* Any user defined debug labels associated with the renderpass */
126+
/* Any user defined debug labels associated with the render pass */
127127
pp::string_field<"debug_label", 6, pp::repeated>,
128-
/* Any attachments associated with the renderpass */
128+
/* Any attachments associated with the render pass */
129129
pp::message_field<"attachments", 7, RenderpassAttachment, pp::repeated>>;
130130

131-
/* Continue a split renderpass */
131+
/* Continue a split render pass */
132132
using ContinueRenderpass = pp::message<
133-
/* The unique identifier for the renderpass that is being continued */
133+
/* The unique identifier for the render pass that is being continued */
134134
pp::uint64_field<"tag_id", 1>,
135-
/* The number of drawcalls to add to the total in the renderpass */
135+
/* The number of drawcalls to add to the total in the render pass */
136136
pp::uint32_field<"draw_call_count", 2>,
137-
/* Any user defined debug labels to add to the renderpass */
137+
/* Any user defined debug labels to add to the render pass */
138138
pp::string_field<"debug_label", 3, pp::repeated>>;
139139

140140
/* A dispatch object submission */
@@ -295,7 +295,7 @@ Comms::MessageData packBuffer(pp::constant<F> c, T&& f)
295295
* @return A pair, where the first value is the corresponding attachment type, and the second value is
296296
* the corresponding attachment index (or nullopt in the case the index is not relevant).
297297
*/
298-
constexpr std::pair<RenderpassAttachmentType, std::optional<uint32_t>> mapRenderpassAttachmentName(
298+
constexpr std::pair<RenderpassAttachmentType, std::optional<uint32_t>> mapRenderPassAttachmentName(
299299
Tracker::RenderPassAttachName name)
300300
{
301301
switch (name)
@@ -443,29 +443,29 @@ constexpr AccelerationStructureTransferType mapASTransferType(Tracker::LCSAccele
443443
/**
444444
* @brief Serialize the metadata for this render pass workload.
445445
*
446-
* @param renderpass The render pass to serialize
446+
* @param renderPass The render pass to serialize
447447
* @param debugLabel The debug label stack of the VkQueue at submit time.
448448
*/
449-
Comms::MessageData serialize(const Tracker::LCSRenderPass& renderpass, const std::vector<std::string>& debugLabel)
449+
Comms::MessageData serialize(const Tracker::LCSRenderPass& renderPass, const std::vector<std::string>& debugLabel)
450450
{
451451
using namespace pp;
452452

453453
// Draw count for a multi-submit command buffer cannot be reliably
454454
// associated with a single tagID if restartable across command buffer
455455
// boundaries because different command buffer submit combinations can
456456
// result in different draw counts for the same starting tagID.
457-
const auto drawCount = (!renderpass.isOneTimeSubmit() && renderpass.isSuspending()
457+
const auto drawCount = (!renderPass.isOneTimeSubmit() && renderPass.isSuspending()
458458
? -1
459-
: static_cast<int64_t>(renderpass.getDrawCallCount()));
459+
: static_cast<int64_t>(renderPass.getDrawCallCount()));
460460

461461
// Make the attachments array
462-
const auto& attachments = renderpass.getAttachments();
462+
const auto& attachments = renderPass.getAttachments();
463463
std::vector<RenderpassAttachment> attachmentsMsg {};
464464
attachmentsMsg.reserve(attachments.size());
465465

466466
for (const auto& attachment : attachments)
467467
{
468-
const auto [type, index] = mapRenderpassAttachmentName(attachment.getAttachmentName());
468+
const auto [type, index] = mapRenderPassAttachmentName(attachment.getAttachmentName());
469469

470470
attachmentsMsg.emplace_back(type,
471471
index,
@@ -479,11 +479,11 @@ Comms::MessageData serialize(const Tracker::LCSRenderPass& renderpass, const std
479479

480480
return packBuffer("renderpass"_f,
481481
BeginRenderpass {
482-
renderpass.getTagID(),
483-
renderpass.getWidth(),
484-
renderpass.getHeight(),
482+
renderPass.getTagID(),
483+
renderPass.getWidth(),
484+
renderPass.getHeight(),
485485
drawCount,
486-
renderpass.getSubpassCount(),
486+
renderPass.getSubpassCount(),
487487
debugLabel,
488488
std::move(attachmentsMsg),
489489
});
@@ -492,7 +492,7 @@ Comms::MessageData serialize(const Tracker::LCSRenderPass& renderpass, const std
492492
/**
493493
* @brief Serialize the metadata for this render pass continuation workload.
494494
*
495-
* @param continuation The renderpass continuation to serialize
495+
* @param continuation The render pass continuation to serialize
496496
* @param tagIDContinuation The ID of the workload if this is a continuation of it.
497497
*/
498498
Comms::MessageData serialize(const Tracker::LCSRenderPassContinuation& continuation, uint64_t tagIDContinuation)
@@ -681,19 +681,19 @@ void TimelineProtobufEncoder::emitSubmit(VkQueue queue, uint64_t timestamp)
681681
}));
682682
}
683683

684-
void TimelineProtobufEncoder::operator()(const Tracker::LCSRenderPass& renderpass,
684+
void TimelineProtobufEncoder::operator()(const Tracker::LCSRenderPass& renderPass,
685685
const std::vector<std::string>& debugStack)
686686
{
687-
device.txMessage(serialize(renderpass, debugStack));
687+
device.txMessage(serialize(renderPass, debugStack));
688688
}
689689

690690
void TimelineProtobufEncoder::operator()(const Tracker::LCSRenderPassContinuation& continuation,
691691
const std::vector<std::string>& debugStack,
692-
uint64_t renderpassTagID)
692+
uint64_t renderPassTagID)
693693
{
694694
UNUSED(debugStack);
695695

696-
device.txMessage(serialize(continuation, renderpassTagID));
696+
device.txMessage(serialize(continuation, renderPassTagID));
697697
}
698698

699699
void TimelineProtobufEncoder::operator()(const Tracker::LCSDispatch& dispatch,

layer_gpu_timeline/source/timeline_protobuf_encoder.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class TimelineProtobufEncoder : public Tracker::SubmitCommandWorkloadVisitor
9090
static void emitFrame(Device& device, uint64_t frameNumber, uint64_t timestamp);
9191

9292
/**
93-
* Construct a new workload metadata emitter that will output paylaods for the provided device
93+
* Construct a new workload metadata emitter that will output payloads for the provided device
9494
*
9595
* @param _device The device object that the payloads are produced for, and to which they are passed for
9696
* transmission
@@ -100,17 +100,17 @@ class TimelineProtobufEncoder : public Tracker::SubmitCommandWorkloadVisitor
100100
{
101101
}
102102

103-
// visitor should not be copied or moved from
103+
// Visitor should not be copied or moved from
104104
TimelineProtobufEncoder(const TimelineProtobufEncoder&) = delete;
105105
TimelineProtobufEncoder(TimelineProtobufEncoder&&) noexcept = delete;
106106
TimelineProtobufEncoder& operator=(const TimelineProtobufEncoder&) = delete;
107107
TimelineProtobufEncoder& operator=(TimelineProtobufEncoder&&) noexcept = delete;
108108

109-
// methods from the visitor interface
110-
void operator()(const Tracker::LCSRenderPass& renderpass, const std::vector<std::string>& debugStack) override;
109+
// Methods from the visitor interface
110+
void operator()(const Tracker::LCSRenderPass& renderPass, const std::vector<std::string>& debugStack) override;
111111
void operator()(const Tracker::LCSRenderPassContinuation& continuation,
112112
const std::vector<std::string>& debugStack,
113-
uint64_t renderpassTagID) override;
113+
uint64_t renderPassTagID) override;
114114
void operator()(const Tracker::LCSDispatch& dispatch, const std::vector<std::string>& debugStack) override;
115115
void operator()(const Tracker::LCSTraceRays& traceRays, const std::vector<std::string>& debugStack) override;
116116
void operator()(const Tracker::LCSImageTransfer& imageTransfer,

source_common/comms/comms_interface.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* SPDX-License-Identifier: MIT
33
* ----------------------------------------------------------------------------
4-
* Copyright (c) 2024 Arm Limited
4+
* Copyright (c) 2024-2025 Arm Limited
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to
@@ -63,7 +63,7 @@ static const EndpointID NO_ENDPOINT {0};
6363
class CommsInterface
6464
{
6565
public:
66-
virtual ~CommsInterface() { }
66+
virtual ~CommsInterface() = default;
6767

6868
/**
6969
* @brief Is this comms module connected to a host server?

source_common/trackers/queue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace
8080
}
8181

8282
/**
83-
* @brief Visit a renderpass workload instruction
83+
* @brief Visit a render pass workload instruction
8484
*
8585
* @param instruction The workload instruction
8686
*/
@@ -99,7 +99,7 @@ namespace
9999
}
100100

101101
/**
102-
* @brief Visit a renderpass continuation workload instruction
102+
* @brief Visit a render pass continuation workload instruction
103103
*
104104
* @param instruction The workload instruction
105105
*/

source_common/trackers/queue.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,23 @@ class SubmitCommandWorkloadVisitor
6262
virtual ~SubmitCommandWorkloadVisitor() noexcept = default;
6363

6464
/**
65-
* @brief Visit a renderpass workload object
65+
* @brief Visit a render pass workload object
6666
*
67-
* @param renderpass The renderpass
68-
* @param debugStack The stack of debug labels that are associated with this renderpass
67+
* @param renderPass The render pass
68+
* @param debugStack The stack of debug labels that are associated with this render pass
6969
*/
70-
virtual void operator()(const LCSRenderPass& renderpass, const std::vector<std::string>& debugStack) = 0;
70+
virtual void operator()(const LCSRenderPass& renderPass, const std::vector<std::string>& debugStack) = 0;
7171

7272
/**
73-
* @brief Visit a renderpass continuation workload object
73+
* @brief Visit a render pass continuation workload object
7474
*
75-
* @param continuation The renderpass continuation
76-
* @param debugStack The stack of debug labels that are associated with this renderpass
77-
* @param renderpassTagID The renderpass tag that the continuation was associated with
75+
* @param continuation The render pass continuation
76+
* @param debugStack The stack of debug labels that are associated with this render pass
77+
* @param renderPassTagID The render pass tag that the continuation was associated with
7878
*/
7979
virtual void operator()(const LCSRenderPassContinuation& continuation,
8080
const std::vector<std::string>& debugStack,
81-
uint64_t renderpassTagID) = 0;
81+
uint64_t renderPassTagID) = 0;
8282

8383
/**
8484
* @brief Visit a dispatch workload object

source_common/utils/queue.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* SPDX-License-Identifier: MIT
33
* ----------------------------------------------------------------------------
4-
* Copyright (c) 2024 Arm Limited
4+
* Copyright (c) 2024-2025 Arm Limited
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to
@@ -44,20 +44,22 @@ class Task
4444
/**
4545
* @brief Destroy the task.
4646
*/
47-
virtual ~Task() { }
47+
virtual ~Task() = default;
4848

4949
/**
5050
* @brief Wait for the task to be complete.
5151
*/
52-
void wait() {
52+
void wait()
53+
{
5354
std::unique_lock<std::mutex> lock(condition_lock);
5455
complete_condition.wait(lock, [this]{ return complete.load(); });
5556
}
5657

5758
/**
5859
* @brief Notify that the task is complete.
5960
*/
60-
void notify() {
61+
void notify()
62+
{
6163
std::unique_lock<std::mutex> lock(condition_lock);
6264
complete = true;
6365
lock.unlock();

0 commit comments

Comments
 (0)