Skip to content

Commit

Permalink
Remove CommandQueueType enum type completely
Browse files Browse the repository at this point in the history
Reviewed By: EricGriffith, corporateshark

Differential Revision: D66826402

fbshipit-source-id: 313ff95051a73abb1f17ac65354580d88edb85d4
  • Loading branch information
Yijie Wang (FRLR) authored and facebook-github-bot committed Dec 6, 2024
1 parent 3274884 commit c55dd18
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 43 deletions.
6 changes: 0 additions & 6 deletions src/igl/CommandQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ namespace igl {
struct CommandBufferDesc;
class ICommandBuffer;

enum class CommandQueueType {
Compute, /// Supports Compute commands
Graphics, /// Supports Graphics commands
MemoryTransfer, /// Supports Memory commands
};

/**
* This is a placeholder for future use
*/
Expand Down
2 changes: 0 additions & 2 deletions src/igl/vulkan/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ struct VulkanContextConfig {
igl::ColorSpace swapChainColorSpace = igl::ColorSpace::SRGB_NONLINEAR;
igl::TextureFormat requestedSwapChainTextureFormat = igl::TextureFormat::RGBA_UNorm8;

std::vector<CommandQueueType> userQueues;

// the number of resources to support BufferAPIHintBits::Ring
uint32_t maxResourceCount = 3u;

Expand Down
34 changes: 0 additions & 34 deletions src/igl/vulkan/VulkanContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,6 @@ std::vector<VkFormat> getCompatibleDepthStencilFormats(igl::TextureFormat format
}
}

VkQueueFlagBits getQueueTypeFlag(igl::CommandQueueType type) {
switch (type) {
case igl::CommandQueueType::Compute:
return VK_QUEUE_COMPUTE_BIT;
case igl::CommandQueueType::Graphics:
return VK_QUEUE_GRAPHICS_BIT;
case igl::CommandQueueType::MemoryTransfer:
return VK_QUEUE_TRANSFER_BIT;
}
IGL_UNREACHABLE_RETURN(VK_QUEUE_GRAPHICS_BIT)
}

bool validateImageLimits(VkImageType imageType,
VkSampleCountFlagBits samples,
const VkExtent3D& extent,
Expand Down Expand Up @@ -775,28 +763,6 @@ igl::Result VulkanContext::initContext(const HWDeviceDesc& desc,
queuePool.reserveQueue(graphicsQueueDescriptor);
queuePool.reserveQueue(computeQueueDescriptor);

// Reserve queues requested by user
// Reserve transfer types at the end, since those can fallback to compute and graphics queues.
// This reduces the risk of failing reservation due to saturation of compute and graphics queues
auto sortedUserQueues = config_.userQueues;
sort(sortedUserQueues.begin(), sortedUserQueues.end(), [](const auto& /*q1*/, const auto& q2) {
return q2 == CommandQueueType::MemoryTransfer;
});

for (const auto& userQueue : sortedUserQueues) {
auto userQueueDescriptor = queuePool.findQueueDescriptor(getQueueTypeFlag(userQueue));
if (userQueueDescriptor.isValid()) {
userQueues_[userQueue] = userQueueDescriptor;
} else {
IGL_LOG_ERROR("User requested queue is not supported");
return Result(Result::Code::Unsupported, "User requested queue is not supported");
}
}

for (const auto& [_, descriptor] : userQueues_) {
queuePool.reserveQueue(descriptor);
}

const auto qcis = queuePool.getQueueCreationInfos();

VkDevice device;
Expand Down
1 change: 0 additions & 1 deletion src/igl/vulkan/VulkanContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ class VulkanContext final {
public:
const VulkanFunctionTable& vf_;
DeviceQueues deviceQueues_;
std::unordered_map<CommandQueueType, VulkanQueueDescriptor> userQueues_;
std::unique_ptr<igl::vulkan::VulkanDevice> device_;
std::unique_ptr<igl::vulkan::VulkanSwapchain> swapchain_;
std::unique_ptr<igl::vulkan::VulkanImmediateCommands> immediate_;
Expand Down

0 comments on commit c55dd18

Please sign in to comment.