Commit 49cef9a5 by Luc Ferron Committed by Commit Bot

Vulkan: Support of A8 textures

Bug:angleproject:2358 Change-Id: I56a86de7cc21dee00a95f1d054d2940262797ca7 Reviewed-on: https://chromium-review.googlesource.com/974305Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
parent d779f6a9
......@@ -271,6 +271,9 @@
}
},
"GL_ALPHA8_EXT": {
"R8_UNORM": {
"GL_UNSIGNED_BYTE": "LoadToNative<GLubyte, 1>"
},
"A8_UNORM": {
"GL_UNSIGNED_BYTE": "LoadToNative<GLubyte, 1>"
},
......
......@@ -148,6 +148,18 @@ LoadImageFunctionInfo ALPHA8_EXT_to_R8G8B8A8_UNORM(GLenum type)
}
}
LoadImageFunctionInfo ALPHA8_EXT_to_R8_UNORM(GLenum type)
{
switch (type)
{
case GL_UNSIGNED_BYTE:
return LoadImageFunctionInfo(LoadToNative<GLubyte, 1>, false);
default:
UNREACHABLE();
return LoadImageFunctionInfo(UnreachableLoadFunction, true);
}
}
LoadImageFunctionInfo BGR565_ANGLEX_to_B5G6R5_UNORM(GLenum type)
{
switch (type)
......@@ -1625,6 +1637,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma
return ALPHA8_EXT_to_A8_UNORM;
case Format::ID::R8G8B8A8_UNORM:
return ALPHA8_EXT_to_R8G8B8A8_UNORM;
case Format::ID::R8_UNORM:
return ALPHA8_EXT_to_R8_UNORM;
default:
break;
}
......
......@@ -59,6 +59,12 @@ void FillComponentsSwizzleParameters(GLenum internalFormat,
componentMapping->b = ConvertSwizzleStateToVkSwizzle(swizzleState.swizzleRed);
componentMapping->a = ConvertSwizzleStateToVkSwizzle(swizzleState.swizzleGreen);
break;
case GL_ALPHA:
componentMapping->r = VK_COMPONENT_SWIZZLE_ZERO;
componentMapping->g = VK_COMPONENT_SWIZZLE_ZERO;
componentMapping->b = VK_COMPONENT_SWIZZLE_ZERO;
componentMapping->a = ConvertSwizzleStateToVkSwizzle(swizzleState.swizzleRed);
break;
default:
componentMapping->r = ConvertSwizzleStateToVkSwizzle(swizzleState.swizzleRed);
componentMapping->g = ConvertSwizzleStateToVkSwizzle(swizzleState.swizzleGreen);
......
......@@ -186,6 +186,10 @@
"ASTC_12x12_SRGB_BLOC": "VK_FORMAT_ASTC_12x12_SRGB_BLOCK"
},
"overrides": {
"A8_UNORM": {
"buffer": "NONE",
"texture": "R8_UNORM"
},
"L8_UNORM": {
"buffer": "NONE",
"texture": "R8_UNORM"
......
......@@ -46,8 +46,15 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
case angle::Format::ID::A8_UNORM:
// This format is not implemented in Vulkan.
{
internalFormat = GL_ALPHA8_EXT;
textureFormatID = angle::Format::ID::R8_UNORM;
vkTextureFormat = VK_FORMAT_R8_UNORM;
bufferFormatID = angle::Format::ID::NONE;
vkBufferFormat = VK_FORMAT_UNDEFINED;
dataInitializerFunction = nullptr;
break;
}
case angle::Format::ID::ASTC_10x10_SRGB_BLOCK:
{
......
......@@ -187,7 +187,7 @@
2161 VULKAN : dEQP-GLES2.functional.buffer.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.light_amount.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.shaders.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.format.a8* = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.format.a8_cube_pot = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.format.l8_cube_pot = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.format.la88_cube_pot = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.format.rgb565_cube_pot = SKIP
......
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