Skip to content

Commit 8d32a12

Browse files
committed
Clean up
1 parent dad96ca commit 8d32a12

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

pathfinder/gpu/vk/command_encoder.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,9 @@ CommandEncoderVk::~CommandEncoderVk() {
185185
vk_command_buffer_ = VK_NULL_HANDLE;
186186
}
187187

188-
VkCommandBuffer CommandEncoderVk::get_vk_handle() const {
189-
return vk_command_buffer_;
190-
}
191-
192188
bool CommandEncoderVk::finish() {
193189
if (finished_) {
194-
Logger::error("Attempted to finished an encoder that's been finished previously!");
190+
Logger::error("Attempted to finish an encoder that's been finished previously!");
195191
return false;
196192
}
197193

@@ -207,19 +203,19 @@ bool CommandEncoderVk::finish() {
207203

208204
VK_CHECK_RESULT(vkBeginCommandBuffer(vk_command_buffer_, &begin_info))
209205

210-
// Start a new debug marker region
206+
// Start a new debug marker region.
211207
DebugMarker::get_singleton()->begin_region(vk_command_buffer_, label_, ColorF(1.0f, 0.78f, 0.05f, 1.0f));
212208

213-
for (auto cmd_iter = commands_.begin(); cmd_iter < commands_.end(); cmd_iter++) {
214-
auto &cmd = *cmd_iter;
209+
for (auto cmd_iter = commands_.begin(); cmd_iter < commands_.end(); ++cmd_iter) {
210+
auto const &cmd = *cmd_iter;
215211

216212
switch (cmd.type) {
217213
case CommandType::BeginRenderPass: {
218214
assert(compute_pipeline_ == nullptr);
219215

220216
bool pass_has_draw_call = false;
221217

222-
for (auto pass_cmd_iter = cmd_iter; pass_cmd_iter < commands_.end(); pass_cmd_iter++) {
218+
for (auto pass_cmd_iter = cmd_iter; pass_cmd_iter < commands_.end(); ++pass_cmd_iter) {
223219
if (pass_cmd_iter->type == CommandType::BindDescriptorSet) {
224220
sync_descriptor_set(pass_cmd_iter->args.bind_descriptor_set.descriptor_set);
225221
}
@@ -267,7 +263,7 @@ bool CommandEncoderVk::finish() {
267263
vkCmdBeginRenderPass(vk_command_buffer_, &render_pass_info, VK_SUBPASS_CONTENTS_INLINE);
268264

269265
// In case we need to clear a framebuffer even when nothing is drawn.
270-
// This is to keep consistency with OpgnGL.
266+
// This is to keep consistency with OpenGL.
271267
if (pass_has_draw_call && render_pass_vk->get_attachment_load_op() == AttachmentLoadOp::Clear) {
272268
std::array<VkClearAttachment, 1> clear_attachments{};
273269

@@ -384,7 +380,7 @@ bool CommandEncoderVk::finish() {
384380
case CommandType::BeginComputePass: {
385381
assert(render_pipeline_ == nullptr);
386382

387-
for (auto cmd_iter2 = cmd_iter; cmd_iter2 < commands_.end(); cmd_iter2++) {
383+
for (auto cmd_iter2 = cmd_iter; cmd_iter2 < commands_.end(); ++cmd_iter2) {
388384
if (cmd_iter2->type == CommandType::BindDescriptorSet) {
389385
sync_descriptor_set(cmd_iter2->args.bind_descriptor_set.descriptor_set);
390386
}
@@ -517,7 +513,7 @@ bool CommandEncoderVk::finish() {
517513

518514
// Specify which part of the image we want to copy the pixels.
519515
{
520-
// A VkImageSubresourceLayers used to specify the specific image subresources of the image used
516+
// A VkImageSubresourceLayers used to specify the specific image sub-resources of the image used
521517
// for the source or destination image data.
522518
region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
523519
region.imageSubresource.mipLevel = 0;
@@ -574,7 +570,7 @@ bool CommandEncoderVk::finish() {
574570

575571
// Specify which part of the image we want to copy the pixels.
576572
{
577-
// A VkImageSubresourceLayers used to specify the specific image subresources of the image used
573+
// A VkImageSubresourceLayers used to specify the specific image sub-resources of the image used
578574
// for the source or destination image data.
579575
region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
580576
region.imageSubresource.mipLevel = 0;

pathfinder/gpu/vk/command_encoder.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class CommandEncoderVk : public CommandEncoder {
1414
public:
1515
~CommandEncoderVk() override;
1616

17-
VkCommandBuffer get_vk_handle() const;
18-
1917
private:
2018
CommandEncoderVk(VkCommandBuffer vk_command_buffer, DeviceVk *device);
2119

pathfinder/gpu/vk/fence.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ FenceVk::~FenceVk() {
1111
}
1212

1313
void FenceVk::wait() const {
14-
// Wait indefinitely
14+
// Wait indefinitely.
1515
vkWaitForFences(device->get_device(), 1, &fence, VK_TRUE, UINT64_MAX);
1616
vkResetFences(device->get_device(), 1, &fence);
1717
}

0 commit comments

Comments
 (0)