Commit ee0a9a34 by Jamie Madill Committed by Commit Bot

Vulkan: Clean up ImageLayout enum.

Remove the redundant manual numbering. Also rename AllGraphicsShadersReadWrite to AllGraphicsShadersWrite for consistency. Refactoring change only. Bug: angleproject:4959 Change-Id: I2e7ca00993f192897bbf88f4bdc3f1610bcb345f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2354279 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarCharlie Lao <cclao@google.com>
parent c4a82aaa
...@@ -1365,7 +1365,7 @@ ANGLE_INLINE angle::Result ContextVk::handleDirtyTexturesImpl( ...@@ -1365,7 +1365,7 @@ ANGLE_INLINE angle::Result ContextVk::handleDirtyTexturesImpl(
if (textureVk->isBoundAsImageTexture(mState.getContextID())) if (textureVk->isBoundAsImageTexture(mState.getContextID()))
{ {
textureLayout = executable->isCompute() ? vk::ImageLayout::ComputeShaderWrite textureLayout = executable->isCompute() ? vk::ImageLayout::ComputeShaderWrite
: vk::ImageLayout::AllGraphicsShadersReadWrite; : vk::ImageLayout::AllGraphicsShadersWrite;
} }
else else
{ {
...@@ -3924,7 +3924,7 @@ angle::Result ContextVk::updateActiveImages(const gl::Context *context, ...@@ -3924,7 +3924,7 @@ angle::Result ContextVk::updateActiveImages(const gl::Context *context,
// This is accessed by multiple shaders // This is accessed by multiple shaders
if (shaderBits.any()) if (shaderBits.any())
{ {
imageLayout = vk::ImageLayout::AllGraphicsShadersReadWrite; imageLayout = vk::ImageLayout::AllGraphicsShadersWrite;
} }
else else
{ {
...@@ -3933,7 +3933,7 @@ angle::Result ContextVk::updateActiveImages(const gl::Context *context, ...@@ -3933,7 +3933,7 @@ angle::Result ContextVk::updateActiveImages(const gl::Context *context,
} }
else else
{ {
imageLayout = vk::ImageLayout::AllGraphicsShadersReadWrite; imageLayout = vk::ImageLayout::AllGraphicsShadersWrite;
} }
VkImageAspectFlags aspectFlags = image->getAspectFlags(); VkImageAspectFlags aspectFlags = image->getAspectFlags();
......
...@@ -1108,7 +1108,7 @@ angle::Result TextureVk::setEGLImageTarget(const gl::Context *context, ...@@ -1108,7 +1108,7 @@ angle::Result TextureVk::setEGLImageTarget(const gl::Context *context,
uint32_t rendererQueueFamilyIndex = renderer->getQueueFamilyIndex(); uint32_t rendererQueueFamilyIndex = renderer->getQueueFamilyIndex();
if (mImage->isQueueChangeNeccesary(rendererQueueFamilyIndex)) if (mImage->isQueueChangeNeccesary(rendererQueueFamilyIndex))
{ {
vk::ImageLayout newLayout = vk::ImageLayout::AllGraphicsShadersReadWrite; vk::ImageLayout newLayout = vk::ImageLayout::AllGraphicsShadersWrite;
if (mImage->getUsage() & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) if (mImage->getUsage() & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
{ {
newLayout = vk::ImageLayout::ColorAttachment; newLayout = vk::ImageLayout::ColorAttachment;
......
...@@ -315,7 +315,7 @@ constexpr angle::PackedEnumMap<ImageLayout, ImageMemoryBarrierData> kImageMemory ...@@ -315,7 +315,7 @@ constexpr angle::PackedEnumMap<ImageLayout, ImageMemoryBarrierData> kImageMemory
}, },
}, },
{ {
ImageLayout::AllGraphicsShadersReadWrite, ImageLayout::AllGraphicsShadersWrite,
{ {
VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_GENERAL,
kAllShadersPipelineStageFlags, kAllShadersPipelineStageFlags,
......
...@@ -1057,28 +1057,28 @@ static constexpr uint32_t kInvalidAttachmentIndex = -1; ...@@ -1057,28 +1057,28 @@ static constexpr uint32_t kInvalidAttachmentIndex = -1;
// are the same, they may occasionally be BOTTOM_OF_PIPE and TOP_OF_PIPE respectively. // are the same, they may occasionally be BOTTOM_OF_PIPE and TOP_OF_PIPE respectively.
enum class ImageLayout enum class ImageLayout
{ {
Undefined = 0, Undefined = 0,
ExternalPreInitialized = 1, ExternalPreInitialized,
ExternalShadersReadOnly = 2, ExternalShadersReadOnly,
ExternalShadersWrite = 3, ExternalShadersWrite,
TransferSrc = 4, TransferSrc,
TransferDst = 5, TransferDst,
VertexShaderReadOnly = 6, VertexShaderReadOnly,
VertexShaderWrite = 7, VertexShaderWrite,
GeometryShaderReadOnly = 8, GeometryShaderReadOnly,
GeometryShaderWrite = 9, GeometryShaderWrite,
FragmentShaderReadOnly = 10, FragmentShaderReadOnly,
FragmentShaderWrite = 11, FragmentShaderWrite,
ComputeShaderReadOnly = 12, ComputeShaderReadOnly,
ComputeShaderWrite = 13, ComputeShaderWrite,
AllGraphicsShadersReadOnly = 14, AllGraphicsShadersReadOnly,
AllGraphicsShadersReadWrite = 15, AllGraphicsShadersWrite,
ColorAttachment = 16, ColorAttachment,
DepthStencilAttachment = 17, DepthStencilAttachment,
Present = 18, Present,
InvalidEnum = 19, InvalidEnum,
EnumCount = 19, EnumCount = InvalidEnum,
}; };
VkImageLayout ConvertImageLayoutToVkImageLayout(ImageLayout imageLayout); VkImageLayout ConvertImageLayoutToVkImageLayout(ImageLayout imageLayout);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment