-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Impeller] faster descriptor type mapping. (#56351)
This is a dumb performance optimization. because we only use the DescriptorType enum to represent vk descriptor types, lets just make the enum values match. Then we can static cast instead of switch. I do see this function showing up in profiles, though a very small slice.
- Loading branch information
1 parent
2bea694
commit aa3423f
Showing
5 changed files
with
51 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "gtest/gtest.h" // IWYU pragma: keep | ||
#include "impeller/renderer/backend/vulkan/formats_vk.h" | ||
|
||
namespace impeller { | ||
namespace testing { | ||
|
||
TEST(FormatsVKTest, DescriptorMapping) { | ||
EXPECT_EQ(ToVKDescriptorType(DescriptorType::kSampledImage), | ||
vk::DescriptorType::eCombinedImageSampler); | ||
EXPECT_EQ(ToVKDescriptorType(DescriptorType::kUniformBuffer), | ||
vk::DescriptorType::eUniformBuffer); | ||
EXPECT_EQ(ToVKDescriptorType(DescriptorType::kStorageBuffer), | ||
vk::DescriptorType::eStorageBuffer); | ||
EXPECT_EQ(ToVKDescriptorType(DescriptorType::kImage), | ||
vk::DescriptorType::eSampledImage); | ||
EXPECT_EQ(ToVKDescriptorType(DescriptorType::kSampler), | ||
vk::DescriptorType::eSampler); | ||
EXPECT_EQ(ToVKDescriptorType(DescriptorType::kInputAttachment), | ||
vk::DescriptorType::eInputAttachment); | ||
} | ||
|
||
} // namespace testing | ||
} // namespace impeller |