Vulkan: Upgrade RGB8 textures to RGBA8.
It's unlikely any real hardware supports this format. Hack in a fixed
fallback format for RGB8. We could consider implementing conditional
support by checking the VkPhysicalDevice properties.
This extends the Vulkan format support info in the RendererVk class
to distinguish between a Buffer and Texture format. This is closely
related to how Vulkan has separate format support bits for Linear
Textures, Optimal Textures, and Buffers. We probably won't need to
keep separate caps for Linear/Optimal, but it makes sense for Buffers
to eventually use the same format tables.
BUG=angleproject:2207
Change-Id: I8d427a99db15b314b13dd99f31aa1ac5055f0881
Reviewed-on: https://chromium-review.googlesource.com/742376
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
index 1e697b5..b4a6c98 100644
--- a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
+++ b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
@@ -38,7 +38,7 @@
RenderTargetVk *renderTarget = nullptr;
ANGLE_TRY(readAttachment->getRenderTarget(context, &renderTarget));
- GLenum implFormat = renderTarget->format->format().fboImplementationInternalFormat;
+ GLenum implFormat = renderTarget->format->textureFormat().fboImplementationInternalFormat;
return &gl::GetSizedInternalFormatInfo(implFormat);
}
@@ -316,7 +316,7 @@
ANGLE_TRY(
stagingImage.getDeviceMemory().map(device, 0, stagingImage.getSize(), 0, &mapPointer));
- const auto &angleFormat = renderTarget->format->format();
+ const auto &angleFormat = renderTarget->format->textureFormat();
// TODO(jmadill): Use pixel bytes from the ANGLE format directly.
const auto &glFormat = gl::GetSizedInternalFormatInfo(angleFormat.glInternalFormat);
@@ -395,7 +395,7 @@
// TODO(jmadill): We would only need this flag for duplicated attachments.
colorDesc.flags = VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT;
- colorDesc.format = renderTarget->format->native;
+ colorDesc.format = renderTarget->format->vkTextureFormat;
colorDesc.samples = ConvertSamples(colorAttachment.getSamples());
// The load op controls the prior existing depth/color attachment data.
@@ -429,7 +429,7 @@
ANGLE_TRY(depthStencilAttachment->getRenderTarget(context, &renderTarget));
depthStencilDesc.flags = 0;
- depthStencilDesc.format = renderTarget->format->native;
+ depthStencilDesc.format = renderTarget->format->vkTextureFormat;
depthStencilDesc.samples = ConvertSamples(depthStencilAttachment->getSamples());
depthStencilDesc.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
depthStencilDesc.storeOp = VK_ATTACHMENT_STORE_OP_STORE;