Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test functions to use consistent naming #8616

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/framework/barrier_queue_family.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void BarrierQueueFamilyTestHelper::Init(std::vector<uint32_t> *families, bool im
image_.Layout(), image_.subresource_range(VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1));

VkMemoryPropertyFlags mem_prop = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
auto buffer_ci = vkt::Buffer::create_info(256, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, families);
auto buffer_ci = vkt::Buffer::CreateInfo(256, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, families);
if (buffer_memory) {
buffer_.init(*device_obj, buffer_ci, mem_prop);
} else {
Expand All @@ -92,7 +92,7 @@ void Barrier2QueueFamilyTestHelper::Init(std::vector<uint32_t> *families, bool i
image_.Layout(), image_.subresource_range(VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1));

VkMemoryPropertyFlags mem_prop = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
auto buffer_ci = vkt::Buffer::create_info(256, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, families);
auto buffer_ci = vkt::Buffer::CreateInfo(256, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, families);
if (buffer_memory) {
buffer_.init(*device_obj, buffer_ci, mem_prop);
} else {
Expand Down
32 changes: 13 additions & 19 deletions tests/framework/binding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@

namespace vkt {

VkPhysicalDeviceProperties PhysicalDevice::properties() const {
VkPhysicalDeviceProperties PhysicalDevice::Properties() const {
VkPhysicalDeviceProperties info;
vk::GetPhysicalDeviceProperties(handle(), &info);
return info;
}

std::vector<VkQueueFamilyProperties> PhysicalDevice::queue_properties() const {
std::vector<VkQueueFamilyProperties> PhysicalDevice::QueueProperties() const {
uint32_t count = 0;
vk::GetPhysicalDeviceQueueFamilyProperties(handle(), &count, nullptr);
std::vector<VkQueueFamilyProperties> info(count);
vk::GetPhysicalDeviceQueueFamilyProperties(handle(), &count, info.data());
return info;
}

VkPhysicalDeviceMemoryProperties PhysicalDevice::memory_properties() const {
VkPhysicalDeviceMemoryProperties PhysicalDevice::MemoryProperties() const {
VkPhysicalDeviceMemoryProperties info;
vk::GetPhysicalDeviceMemoryProperties(handle(), &info);
return info;
Expand Down Expand Up @@ -146,8 +146,8 @@ std::vector<VkExtensionProperties> PhysicalDevice::extensions(const char *pLayer
}
}

bool PhysicalDevice::set_memory_type(const uint32_t type_bits, VkMemoryAllocateInfo *info, const VkFlags properties,
const VkFlags forbid) const {
bool PhysicalDevice::SetMemoryType(const uint32_t type_bits, VkMemoryAllocateInfo *info, const VkFlags properties,
const VkFlags forbid) const {
uint32_t type_mask = type_bits;
// Search memtypes to find first index with those properties
for (uint32_t i = 0; i < memory_properties_.memoryTypeCount; i++) {
Expand Down Expand Up @@ -264,10 +264,10 @@ void Device::init(const VkDeviceCreateInfo &info) {
ASSERT_EQ(VK_SUCCESS, vk::CreateDevice(phy_.handle(), &info, NULL, &dev));
Handle::init(dev);

init_queues(info);
InitQueues(info);
}

void Device::init_queues(const VkDeviceCreateInfo &info) {
void Device::InitQueues(const VkDeviceCreateInfo &info) {
uint32_t queue_node_count = phy_.queue_properties_.size();

queue_families_.resize(queue_node_count);
Expand Down Expand Up @@ -426,12 +426,6 @@ VkResult Device::Wait(const std::vector<const Fence *> &fences, bool wait_all, u
return err;
}

void Device::update_descriptor_sets(const std::vector<VkWriteDescriptorSet> &writes,
const std::vector<VkCopyDescriptorSet> &copies) {
vk::UpdateDescriptorSets(handle(), static_cast<uint32_t>(writes.size()), writes.data(), static_cast<uint32_t>(copies.size()),
copies.data());
}

VkResult Queue::Submit(const CommandBuffer &cmd, const Fence &fence) {
VkSubmitInfo submit = vku::InitStructHelper();
submit.commandBufferCount = cmd.initialized() ? 1 : 0;
Expand Down Expand Up @@ -794,7 +788,7 @@ VkMemoryAllocateInfo DeviceMemory::get_resource_alloc_info(const Device &dev, co
VkMemoryPropertyFlags mem_props, void *alloc_info_pnext) {
VkMemoryAllocateInfo alloc_info = vku::InitStructHelper(alloc_info_pnext);
alloc_info.allocationSize = reqs.size;
EXPECT_TRUE(dev.phy().set_memory_type(reqs.memoryTypeBits, &alloc_info, mem_props));
EXPECT_TRUE(dev.phy().SetMemoryType(reqs.memoryTypeBits, &alloc_info, mem_props));
return alloc_info;
}

Expand Down Expand Up @@ -1161,7 +1155,7 @@ bool Image::IsCompatible(const Device &dev, const VkImageUsageFlags usages, cons
VkImageCreateInfo Image::ImageCreateInfo2D(uint32_t const width, uint32_t const height, uint32_t const mip_levels,
uint32_t const layers, VkFormat const format, VkFlags const usage,
VkImageTiling const requested_tiling, const std::vector<uint32_t> *queue_families) {
VkImageCreateInfo imageCreateInfo = create_info();
VkImageCreateInfo imageCreateInfo = CreateInfo();
imageCreateInfo.imageType = VK_IMAGE_TYPE_2D;
imageCreateInfo.format = format;
imageCreateInfo.extent.width = width;
Expand Down Expand Up @@ -1694,7 +1688,7 @@ void CommandBuffer::init(const Device &dev, const VkCommandBufferAllocateInfo &i
}

void CommandBuffer::Init(const Device &dev, const CommandPool &pool, VkCommandBufferLevel level) {
auto create_info = CommandBuffer::create_info(pool.handle());
auto create_info = CommandBuffer::CreateInfo(pool.handle());
create_info.level = level;
init(dev, create_info);
}
Expand All @@ -1720,7 +1714,7 @@ void CommandBuffer::end() { ASSERT_EQ(VK_SUCCESS, vk::EndCommandBuffer(handle())

void CommandBuffer::reset(VkCommandBufferResetFlags flags) { ASSERT_EQ(VK_SUCCESS, vk::ResetCommandBuffer(handle(), flags)); }

VkCommandBufferAllocateInfo CommandBuffer::create_info(VkCommandPool const &pool) {
VkCommandBufferAllocateInfo CommandBuffer::CreateInfo(VkCommandPool const &pool) {
VkCommandBufferAllocateInfo info = vku::InitStructHelper();
info.commandPool = pool;
info.commandBufferCount = 1;
Expand Down Expand Up @@ -1832,8 +1826,8 @@ void CommandBuffer::EndVideoCoding(const VkVideoEndCodingInfoKHR &endInfo) {
}

void CommandBuffer::Copy(const Buffer &src, const Buffer &dst) {
assert(src.create_info().size == dst.create_info().size);
const VkBufferCopy region = {0, 0, src.create_info().size};
assert(src.CreateInfo().size == dst.CreateInfo().size);
const VkBufferCopy region = {0, 0, src.CreateInfo().size};
vk::CmdCopyBuffer(handle(), src.handle(), dst.handle(), 1, &region);
}

Expand Down
Loading
Loading