Commit 7828506a by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Cleanup buffer format fallbacks

- Fallbacks for formats that have required vertex attribute support are removed. - Fallbacks are changed to ones with smaller sizes - A bug is fixed where CopyNativeVertexData wasn't initializing the alpha channel appropriately, which was not exercised due to fallback to 32-bit float formats. Bug: b/184163871 Change-Id: Icd9afa49d94c65545d1f3fcf521881726d64529d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2809441Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent 730bbcbb
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"src/libANGLE/renderer/Format_table_autogen.cpp": "src/libANGLE/renderer/Format_table_autogen.cpp":
"b28fd3a6ed2ff60197dbb40c4b122d31", "b28fd3a6ed2ff60197dbb40c4b122d31",
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"35b819b32d3259961da75f5c971baba4", "74d6c9842128293118ccf128aeae896a",
"src/libANGLE/renderer/angle_format_data.json": "src/libANGLE/renderer/angle_format_data.json":
"10e2ee1ed8ee54226edb644de30f512d", "10e2ee1ed8ee54226edb644de30f512d",
"src/libANGLE/renderer/angle_format_map.json": "src/libANGLE/renderer/angle_format_map.json":
......
{ {
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"35b819b32d3259961da75f5c971baba4", "74d6c9842128293118ccf128aeae896a",
"src/libANGLE/renderer/gen_load_functions_table.py": "src/libANGLE/renderer/gen_load_functions_table.py":
"c131c494e7e0b35b65a8a097b4b8e5ce", "c131c494e7e0b35b65a8a097b4b8e5ce",
"src/libANGLE/renderer/load_functions_data.json": "src/libANGLE/renderer/load_functions_data.json":
......
{ {
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"35b819b32d3259961da75f5c971baba4", "74d6c9842128293118ccf128aeae896a",
"src/libANGLE/renderer/d3d/d3d11/gen_texture_format_table.py": "src/libANGLE/renderer/d3d/d3d11/gen_texture_format_table.py":
"bbb56f0a35bb2506524654444c8210d3", "bbb56f0a35bb2506524654444c8210d3",
"src/libANGLE/renderer/d3d/d3d11/texture_format_data.json": "src/libANGLE/renderer/d3d/d3d11/texture_format_data.json":
......
{ {
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"35b819b32d3259961da75f5c971baba4", "74d6c9842128293118ccf128aeae896a",
"src/libANGLE/renderer/angle_format_map.json": "src/libANGLE/renderer/angle_format_map.json":
"5cfbdcad0391a5d70dca1466c5361ee4", "5cfbdcad0391a5d70dca1466c5361ee4",
"src/libANGLE/renderer/dxgi_format_data.json": "src/libANGLE/renderer/dxgi_format_data.json":
......
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
"src/libANGLE/gen_copy_conversion_table.py": "src/libANGLE/gen_copy_conversion_table.py":
"0a73b7580342b9e27d4c71ade3af55e5", "0a73b7580342b9e27d4c71ade3af55e5",
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"35b819b32d3259961da75f5c971baba4" "74d6c9842128293118ccf128aeae896a"
} }
\ No newline at end of file
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
"src/libANGLE/gen_format_map.py": "src/libANGLE/gen_format_map.py":
"2421e2cfb4e074ae3fa6baa031c6394e", "2421e2cfb4e074ae3fa6baa031c6394e",
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"35b819b32d3259961da75f5c971baba4" "74d6c9842128293118ccf128aeae896a"
} }
\ No newline at end of file
{ {
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"35b819b32d3259961da75f5c971baba4", "74d6c9842128293118ccf128aeae896a",
"src/libANGLE/renderer/angle_format_map.json": "src/libANGLE/renderer/angle_format_map.json":
"5cfbdcad0391a5d70dca1466c5361ee4", "5cfbdcad0391a5d70dca1466c5361ee4",
"src/libANGLE/renderer/gen_angle_format_table.py": "src/libANGLE/renderer/gen_angle_format_table.py":
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"src/libANGLE/renderer/metal/shaders/gen_mtl_internal_shaders.py": "src/libANGLE/renderer/metal/shaders/gen_mtl_internal_shaders.py":
"ba74ebbfa2ceb825f36e84f2985b3d3d", "ba74ebbfa2ceb825f36e84f2985b3d3d",
"src/libANGLE/renderer/metal/shaders/mtl_default_shaders_src_autogen.inc": "src/libANGLE/renderer/metal/shaders/mtl_default_shaders_src_autogen.inc":
"12c9d71bde88dd305c2b1088ecd2d1c4", "c9dbe9e35cd7e84104687bb04730a3c4",
"src/libANGLE/renderer/metal/shaders/visibility.metal": "src/libANGLE/renderer/metal/shaders/visibility.metal":
"b82aa740cf4b0aed606aacef1024beea" "b82aa740cf4b0aed606aacef1024beea"
} }
\ No newline at end of file
{ {
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"35b819b32d3259961da75f5c971baba4", "74d6c9842128293118ccf128aeae896a",
"src/libANGLE/renderer/angle_format_map.json": "src/libANGLE/renderer/angle_format_map.json":
"5cfbdcad0391a5d70dca1466c5361ee4", "5cfbdcad0391a5d70dca1466c5361ee4",
"src/libANGLE/renderer/metal/gen_mtl_format_table.py": "src/libANGLE/renderer/metal/gen_mtl_format_table.py":
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"scripts/gl.xml": "scripts/gl.xml":
"2a73a58a7e26d8676a2c0af6d528cae6", "2a73a58a7e26d8676a2c0af6d528cae6",
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"35b819b32d3259961da75f5c971baba4", "74d6c9842128293118ccf128aeae896a",
"src/libANGLE/renderer/gl/DispatchTableGL_autogen.cpp": "src/libANGLE/renderer/gl/DispatchTableGL_autogen.cpp":
"54a5c8b87d54114ee61a4c535931ea48", "54a5c8b87d54114ee61a4c535931ea48",
"src/libANGLE/renderer/gl/DispatchTableGL_autogen.h": "src/libANGLE/renderer/gl/DispatchTableGL_autogen.h":
......
{ {
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"35b819b32d3259961da75f5c971baba4", "74d6c9842128293118ccf128aeae896a",
"src/libANGLE/renderer/angle_format_map.json": "src/libANGLE/renderer/angle_format_map.json":
"5cfbdcad0391a5d70dca1466c5361ee4", "5cfbdcad0391a5d70dca1466c5361ee4",
"src/libANGLE/renderer/vulkan/gen_vk_format_table.py": "src/libANGLE/renderer/vulkan/gen_vk_format_table.py":
"ffeebc0e8ec8db860e472c7cf04cd880", "ffeebc0e8ec8db860e472c7cf04cd880",
"src/libANGLE/renderer/vulkan/vk_format_map.json": "src/libANGLE/renderer/vulkan/vk_format_map.json":
"62dfb5531d601d774ce4729c0daac896", "e95cc5c7cdeec22369acb5dfb811303e",
"src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp": "src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp":
"043dfad0df3e00e759ba8959f4178714" "559bf794dcccf632481864189b1469ab"
} }
\ No newline at end of file
{ {
"src/libANGLE/renderer/angle_format.py": "src/libANGLE/renderer/angle_format.py":
"35b819b32d3259961da75f5c971baba4", "74d6c9842128293118ccf128aeae896a",
"src/libANGLE/renderer/vulkan/gen_vk_mandatory_format_support_table.py": "src/libANGLE/renderer/vulkan/gen_vk_mandatory_format_support_table.py":
"3e2b8cd80373275e862bb7c8ba20a745", "3e2b8cd80373275e862bb7c8ba20a745",
"src/libANGLE/renderer/vulkan/vk_format_map.json": "src/libANGLE/renderer/vulkan/vk_format_map.json":
"62dfb5531d601d774ce4729c0daac896", "e95cc5c7cdeec22369acb5dfb811303e",
"src/libANGLE/renderer/vulkan/vk_mandatory_format_support_data.json": "src/libANGLE/renderer/vulkan/vk_mandatory_format_support_data.json":
"fa2bd54c1bb0ab2cf1d386061a4bc5c5", "fa2bd54c1bb0ab2cf1d386061a4bc5c5",
"src/libANGLE/renderer/vulkan/vk_mandatory_format_support_table_autogen.cpp": "src/libANGLE/renderer/vulkan/vk_mandatory_format_support_table_autogen.cpp":
......
...@@ -242,8 +242,9 @@ def get_vertex_copy_function(src_format, dst_format): ...@@ -242,8 +242,9 @@ def get_vertex_copy_function(src_format, dst_format):
if dst_format == "NONE": if dst_format == "NONE":
return "nullptr" return "nullptr"
num_channel = len(get_channel_tokens(src_format)) src_num_channel = len(get_channel_tokens(src_format))
if num_channel < 1 or num_channel > 4: dst_num_channel = len(get_channel_tokens(dst_format))
if src_num_channel < 1 or src_num_channel > 4:
return "nullptr" return "nullptr"
if src_format.endswith('_VERTEX'): if src_format.endswith('_VERTEX'):
...@@ -259,7 +260,7 @@ def get_vertex_copy_function(src_format, dst_format): ...@@ -259,7 +260,7 @@ def get_vertex_copy_function(src_format, dst_format):
if 'FIXED' in src_format: if 'FIXED' in src_format:
assert 'FLOAT' in dst_format, ( assert 'FLOAT' in dst_format, (
'get_vertex_copy_function: can only convert fixed to float,' + ' not to ' + dst_format) 'get_vertex_copy_function: can only convert fixed to float,' + ' not to ' + dst_format)
return 'Copy32FixedTo32FVertexData<%d, %d>' % (num_channel, num_channel) return 'Copy32FixedTo32FVertexData<%d, %d>' % (src_num_channel, dst_num_channel)
src_gl_type = get_format_gl_type(src_format) src_gl_type = get_format_gl_type(src_format)
dst_gl_type = get_format_gl_type(dst_format) dst_gl_type = get_format_gl_type(dst_format)
...@@ -268,13 +269,24 @@ def get_vertex_copy_function(src_format, dst_format): ...@@ -268,13 +269,24 @@ def get_vertex_copy_function(src_format, dst_format):
return "nullptr" return "nullptr"
if src_gl_type == dst_gl_type: if src_gl_type == dst_gl_type:
dst_num_channel = len(get_channel_tokens(dst_format)) default_alpha = '1'
return 'CopyNativeVertexData<%s, %d, %d, 0>' % (src_gl_type, num_channel, dst_num_channel)
if src_num_channel == dst_num_channel or dst_num_channel < 4:
default_alpha = '0'
elif 'A16_FLOAT' in dst_format:
default_alpha = 'gl::Float16One'
elif 'A32_FLOAT' in dst_format:
default_alpha = 'gl::Float32One'
elif 'NORM' in dst_format:
default_alpha = 'std::numeric_limits<%s>::max()' % (src_gl_type)
return 'CopyNativeVertexData<%s, %d, %d, %s>' % (src_gl_type, src_num_channel,
dst_num_channel, default_alpha)
assert 'FLOAT' in dst_format, ( assert 'FLOAT' in dst_format, (
'get_vertex_copy_function: can only convert to float,' + ' not to ' + dst_format) 'get_vertex_copy_function: can only convert to float,' + ' not to ' + dst_format)
normalized = 'true' if 'NORM' in src_format else 'false' normalized = 'true' if 'NORM' in src_format else 'false'
dst_is_half = 'true' if dst_gl_type == 'GLhalf' else 'false' dst_is_half = 'true' if dst_gl_type == 'GLhalf' else 'false'
return "CopyToFloatVertexData<%s, %d, %d, %s, %s>" % (src_gl_type, num_channel, num_channel, return "CopyToFloatVertexData<%s, %d, %d, %s, %s>" % (src_gl_type, src_num_channel,
normalized, dst_is_half) dst_num_channel, normalized, dst_is_half)
...@@ -227,15 +227,22 @@ inline void CopyToFloatVertexData(const uint8_t *input, ...@@ -227,15 +227,22 @@ inline void CopyToFloatVertexData(const uint8_t *input,
} }
} }
// This would require special padding.
static_assert(!(inputComponentCount < 4 && outputComponentCount == 4),
"An inputComponentCount less than 4 and an outputComponentCount equal to 4 "
"is not supported.");
for (size_t j = inputComponentCount; j < outputComponentCount; j++) for (size_t j = inputComponentCount; j < outputComponentCount; j++)
{ {
offsetOutput[j] = 0; offsetOutput[j] = 0;
} }
if (inputComponentCount < 4 && outputComponentCount == 4)
{
if (toHalf)
{
offsetOutput[3] = gl::Float16One;
}
else
{
offsetOutput[3] = static_cast<outputType>(gl::Float32One);
}
}
} }
} }
......
...@@ -14,7 +14,7 @@ static char gDefaultMetallibSrc[] = R"( ...@@ -14,7 +14,7 @@ static char gDefaultMetallibSrc[] = R"(
# 1 "temp_master_source.metal" # 1 "temp_master_source.metal"
# 1 "<built-in>" 1 # 1 "<built-in>" 1
# 1 "<built-in>" 3 # 1 "<built-in>" 3
# 369 "<built-in>" 3 # 386 "<built-in>" 3
# 1 "<command line>" 1 # 1 "<command line>" 1
# 1 "<built-in>" 2 # 1 "<built-in>" 2
# 1 "temp_master_source.metal" 2 # 1 "temp_master_source.metal" 2
......
...@@ -63,8 +63,6 @@ constexpr uint32_t kOverlayDrawFontBinding = 4; ...@@ -63,8 +63,6 @@ constexpr uint32_t kOverlayDrawFontBinding = 4;
constexpr uint32_t kGenerateMipmapDestinationBinding = 0; constexpr uint32_t kGenerateMipmapDestinationBinding = 0;
constexpr uint32_t kGenerateMipmapSourceBinding = 1; constexpr uint32_t kGenerateMipmapSourceBinding = 1;
constexpr uint32_t kFloatOneAsUint = 0x3F80'0000u;
bool ValidateFloatOneAsUint() bool ValidateFloatOneAsUint()
{ {
union union
...@@ -72,7 +70,7 @@ bool ValidateFloatOneAsUint() ...@@ -72,7 +70,7 @@ bool ValidateFloatOneAsUint()
uint32_t asUint; uint32_t asUint;
float asFloat; float asFloat;
} one; } one;
one.asUint = kFloatOneAsUint; one.asUint = gl::Float32One;
return one.asFloat == 1.0f; return one.asFloat == 1.0f;
} }
...@@ -88,6 +86,8 @@ uint32_t GetConvertVertexFlags(const UtilsVk::ConvertVertexParameters &params) ...@@ -88,6 +86,8 @@ uint32_t GetConvertVertexFlags(const UtilsVk::ConvertVertexParameters &params)
bool destIsSint = params.destFormat->isSint(); bool destIsSint = params.destFormat->isSint();
bool destIsUint = params.destFormat->isUint(); bool destIsUint = params.destFormat->isUint();
bool destIsSnorm = params.destFormat->isSnorm();
bool destIsUnorm = params.destFormat->isUnorm();
bool destIsFloat = params.destFormat->isFloat(); bool destIsFloat = params.destFormat->isFloat();
bool destIsHalfFloat = params.destFormat->isVertexTypeHalfFloat(); bool destIsHalfFloat = params.destFormat->isVertexTypeHalfFloat();
...@@ -99,7 +99,8 @@ uint32_t GetConvertVertexFlags(const UtilsVk::ConvertVertexParameters &params) ...@@ -99,7 +99,8 @@ uint32_t GetConvertVertexFlags(const UtilsVk::ConvertVertexParameters &params)
// One of each bool set must be true // One of each bool set must be true
ASSERT(srcIsSint || srcIsUint || srcIsSnorm || srcIsUnorm || srcIsFixed || srcIsFloat); ASSERT(srcIsSint || srcIsUint || srcIsSnorm || srcIsUnorm || srcIsFixed || srcIsFloat);
ASSERT(destIsSint || destIsUint || destIsFloat || destIsHalfFloat); ASSERT(destIsSint || destIsUint || destIsSnorm || destIsUnorm || destIsFloat ||
destIsHalfFloat);
// We currently don't have any big-endian devices in the list of supported platforms. The // We currently don't have any big-endian devices in the list of supported platforms. The
// shader is capable of supporting big-endian architectures, but the relevant flag (IsBigEndian) // shader is capable of supporting big-endian architectures, but the relevant flag (IsBigEndian)
...@@ -115,6 +116,13 @@ uint32_t GetConvertVertexFlags(const UtilsVk::ConvertVertexParameters &params) ...@@ -115,6 +116,13 @@ uint32_t GetConvertVertexFlags(const UtilsVk::ConvertVertexParameters &params)
// Note that HalfFloat conversion uses the same shader as Uint. // Note that HalfFloat conversion uses the same shader as Uint.
flags = ConvertVertex_comp::kUintToUint; flags = ConvertVertex_comp::kUintToUint;
} }
else if ((srcIsSnorm && destIsSnorm) || (srcIsUnorm && destIsUnorm))
{
// Do snorm->snorm and unorm->unorm copies using the uint->uint shader. Currently only
// supported for same-width formats, so it's only used when adding channels.
ASSERT(params.srcFormat->redBits == params.destFormat->redBits);
flags = ConvertVertex_comp::kUintToUint;
}
else if (srcIsSint && destIsSint) else if (srcIsSint && destIsSint)
{ {
flags = ConvertVertex_comp::kSintToSint; flags = ConvertVertex_comp::kSintToSint;
...@@ -1793,7 +1801,7 @@ angle::Result UtilsVk::convertVertexBuffer(ContextVk *contextVk, ...@@ -1793,7 +1801,7 @@ angle::Result UtilsVk::convertVertexBuffer(ContextVk *contextVk,
shaderParams.componentCount = static_cast<uint32_t>(params.vertexCount * shaderParams.Nd); shaderParams.componentCount = static_cast<uint32_t>(params.vertexCount * shaderParams.Nd);
// Total number of 4-byte outputs is the number of components divided by how many components can // Total number of 4-byte outputs is the number of components divided by how many components can
// fit in a 4-byte value. Note that this value is also the invocation size of the shader. // fit in a 4-byte value. Note that this value is also the invocation size of the shader.
shaderParams.outputCount = shaderParams.componentCount / shaderParams.Ed; shaderParams.outputCount = UnsignedCeilDivide(shaderParams.componentCount, shaderParams.Ed);
shaderParams.srcOffset = static_cast<uint32_t>(params.srcOffset); shaderParams.srcOffset = static_cast<uint32_t>(params.srcOffset);
shaderParams.destOffset = static_cast<uint32_t>(params.destOffset); shaderParams.destOffset = static_cast<uint32_t>(params.destOffset);
...@@ -1816,13 +1824,35 @@ angle::Result UtilsVk::convertVertexBuffer(ContextVk *contextVk, ...@@ -1816,13 +1824,35 @@ angle::Result UtilsVk::convertVertexBuffer(ContextVk *contextVk,
switch (flags) switch (flags)
{ {
case ConvertVertex_comp::kSintToSint: case ConvertVertex_comp::kSintToSint:
case ConvertVertex_comp::kUintToUint:
case ConvertVertex_comp::kSintToFloat: case ConvertVertex_comp::kSintToFloat:
case ConvertVertex_comp::kUintToFloat: case ConvertVertex_comp::kUintToFloat:
// For integers, alpha should take a value of 1. // For integers, alpha should take a value of 1.
shaderParams.srcEmulatedAlpha = 1; shaderParams.srcEmulatedAlpha = 1;
break; break;
case ConvertVertex_comp::kUintToUint:
// For integers, alpha should take a value of 1. However, uint->uint is also used to
// add channels to RGB snorm, unorm and half formats.
if (params.destFormat->isSnorm())
{
// See case ConvertVertex_comp::kSnormToFloat below.
shaderParams.srcEmulatedAlpha = srcValueMask >> 1;
}
else if (params.destFormat->isUnorm())
{
// See case ConvertVertex_comp::kUnormToFloat below.
shaderParams.srcEmulatedAlpha = srcValueMask;
}
else if (params.destFormat->isVertexTypeHalfFloat())
{
shaderParams.srcEmulatedAlpha = gl::Float16One;
}
else
{
shaderParams.srcEmulatedAlpha = 1;
}
break;
case ConvertVertex_comp::kSnormToFloat: case ConvertVertex_comp::kSnormToFloat:
// The largest signed number with as many bits as the alpha channel of the source is // The largest signed number with as many bits as the alpha channel of the source is
// 0b011...1 which is srcValueMask >> 1 // 0b011...1 which is srcValueMask >> 1
...@@ -1842,7 +1872,7 @@ angle::Result UtilsVk::convertVertexBuffer(ContextVk *contextVk, ...@@ -1842,7 +1872,7 @@ angle::Result UtilsVk::convertVertexBuffer(ContextVk *contextVk,
case ConvertVertex_comp::kFloatToFloat: case ConvertVertex_comp::kFloatToFloat:
ASSERT(ValidateFloatOneAsUint()); ASSERT(ValidateFloatOneAsUint());
shaderParams.srcEmulatedAlpha = kFloatOneAsUint; shaderParams.srcEmulatedAlpha = gl::Float32One;
break; break;
default: default:
...@@ -2942,14 +2972,13 @@ angle::Result UtilsVk::copyImageBits(ContextVk *contextVk, ...@@ -2942,14 +2972,13 @@ angle::Result UtilsVk::copyImageBits(ContextVk *contextVk,
else if (shaderParams.Bd == 2) else if (shaderParams.Bd == 2)
{ {
ASSERT(dstImageFormat.isFloat()); ASSERT(dstImageFormat.isFloat());
// 1.0 in half-float is represented with 0 01111 0000000000 shaderParams.srcEmulatedAlpha = gl::Float16One;
shaderParams.srcEmulatedAlpha = 0x3C00;
} }
else if (shaderParams.Bd == 4) else if (shaderParams.Bd == 4)
{ {
ASSERT(dstImageFormat.isFloat()); ASSERT(dstImageFormat.isFloat());
ASSERT(ValidateFloatOneAsUint()); ASSERT(ValidateFloatOneAsUint());
shaderParams.srcEmulatedAlpha = kFloatOneAsUint; shaderParams.srcEmulatedAlpha = gl::Float32One;
} }
else else
{ {
......
...@@ -202,10 +202,6 @@ ...@@ -202,10 +202,6 @@
"R5G5B5A1_UNORM": { "R5G5B5A1_UNORM": {
"image": "A1R5G5B5_UNORM" "image": "A1R5G5B5_UNORM"
}, },
"R8G8B8_UNORM": {
"image": "R8G8B8A8_UNORM",
"buffer": "R32G32B32_FLOAT"
},
"R8G8B8_UNORM_SRGB": { "R8G8B8_UNORM_SRGB": {
"image": "R8G8B8A8_UNORM_SRGB" "image": "R8G8B8A8_UNORM_SRGB"
}, },
...@@ -355,45 +351,31 @@ ...@@ -355,45 +351,31 @@
"image": ["D24_UNORM_S8_UINT", "D32_FLOAT_S8X24_UINT", "S8_UINT"] "image": ["D24_UNORM_S8_UINT", "D32_FLOAT_S8X24_UINT", "S8_UINT"]
}, },
"R8_UNORM": {
"buffer": "R32_FLOAT"
},
"R8_SNORM": {
"buffer": "R32_FLOAT"
},
"R8_USCALED": { "R8_USCALED": {
"buffer": "R32_FLOAT" "buffer": "R16_FLOAT"
}, },
"R8_SSCALED": { "R8_SSCALED": {
"buffer": "R32_FLOAT" "buffer": "R16_FLOAT"
},
"R8G8_UNORM": {
"buffer": "R32G32_FLOAT"
},
"R8G8_SNORM": {
"buffer": "R32G32_FLOAT"
}, },
"R8G8_USCALED": { "R8G8_USCALED": {
"buffer": "R32G32_FLOAT" "buffer": "R16G16_FLOAT"
}, },
"R8G8_SSCALED": { "R8G8_SSCALED": {
"buffer": "R32G32_FLOAT" "buffer": "R16G16_FLOAT"
},
"R8G8B8_UNORM": {
"image": "R8G8B8A8_UNORM",
"buffer": "R8G8B8A8_UNORM"
}, },
"R8G8B8_SNORM": { "R8G8B8_SNORM": {
"image": "R8G8B8A8_SNORM", "image": "R8G8B8A8_SNORM",
"buffer": "R32G32B32_FLOAT" "buffer": "R8G8B8A8_SNORM"
}, },
"R8G8B8_USCALED": { "R8G8B8_USCALED": {
"buffer": "R32G32B32_FLOAT" "buffer": ["R16G16B16_FLOAT", "R16G16B16A16_FLOAT"]
}, },
"R8G8B8_SSCALED": { "R8G8B8_SSCALED": {
"buffer": "R32G32B32_FLOAT" "buffer": ["R16G16B16_FLOAT", "R16G16B16A16_FLOAT"]
},
"R8G8B8A8_UNORM": {
"buffer": "R16G16B16A16_FLOAT"
},
"R8G8B8A8_SNORM": {
"buffer": "R16G16B16A16_FLOAT"
}, },
"R8G8B8A8_USCALED": { "R8G8B8A8_USCALED": {
"buffer": "R16G16B16A16_FLOAT" "buffer": "R16G16B16A16_FLOAT"
...@@ -402,47 +384,37 @@ ...@@ -402,47 +384,37 @@
"buffer": "R16G16B16A16_FLOAT" "buffer": "R16G16B16A16_FLOAT"
}, },
"R16_UNORM": {
"buffer": "R32_FLOAT"
},
"R16_SNORM": {
"buffer": "R32_FLOAT"
},
"R16_USCALED": { "R16_USCALED": {
"buffer": "R32_FLOAT" "buffer": "R32_FLOAT",
"buffer_compressed": "R16_FLOAT"
}, },
"R16_SSCALED": { "R16_SSCALED": {
"buffer": "R32_FLOAT" "buffer": "R32_FLOAT",
}, "buffer_compressed": "R16_FLOAT"
"R16G16_UNORM": {
"buffer": "R32G32_FLOAT"
},
"R16G16_SNORM": {
"buffer": "R32G32_FLOAT"
}, },
"R16G16_USCALED": { "R16G16_USCALED": {
"buffer": "R32G32_FLOAT" "buffer": "R32G32_FLOAT",
"buffer_compressed": "R16G16_FLOAT"
}, },
"R16G16_SSCALED": { "R16G16_SSCALED": {
"buffer": "R32G32_FLOAT" "buffer": "R32G32_FLOAT",
"buffer_compressed": "R16G16_FLOAT"
}, },
"R16G16B16_UNORM": { "R16G16B16_UNORM": {
"buffer": "R32G32B32_FLOAT" "buffer": "R32G32B32_FLOAT",
"buffer_compressed": ["R16G16B16_FLOAT", "R16G16B16A16_FLOAT"]
}, },
"R16G16B16_SNORM": { "R16G16B16_SNORM": {
"buffer": "R32G32B32_FLOAT" "buffer": "R32G32B32_FLOAT",
"buffer_compressed": ["R16G16B16_FLOAT", "R16G16B16A16_FLOAT"]
}, },
"R16G16B16_USCALED": { "R16G16B16_USCALED": {
"buffer": "R32G32B32_FLOAT" "buffer": "R32G32B32_FLOAT",
"buffer_compressed": ["R16G16B16_FLOAT", "R16G16B16A16_FLOAT"]
}, },
"R16G16B16_SSCALED": { "R16G16B16_SSCALED": {
"buffer": "R32G32B32_FLOAT" "buffer": "R32G32B32_FLOAT",
}, "buffer_compressed": ["R16G16B16_FLOAT", "R16G16B16A16_FLOAT"]
"R16G16B16A16_UNORM": {
"buffer": "R32G32B32A32_FLOAT"
},
"R16G16B16A16_SNORM": {
"buffer": "R32G32B32A32_FLOAT"
}, },
"R16G16B16A16_USCALED": { "R16G16B16A16_USCALED": {
"buffer": "R32G32B32A32_FLOAT", "buffer": "R32G32B32A32_FLOAT",
...@@ -480,7 +452,7 @@ ...@@ -480,7 +452,7 @@
}, },
"R32G32B32_FLOAT": { "R32G32B32_FLOAT": {
"image": "R32G32B32A32_FLOAT", "image": "R32G32B32A32_FLOAT",
"buffer_compressed": "R16G16B16A16_FLOAT" "buffer_compressed": ["R16G16B16_FLOAT", "R16G16B16A16_FLOAT"]
}, },
"ETC2_R8G8B8_UNORM_BLOCK": { "ETC2_R8G8B8_UNORM_BLOCK": {
"image": "R8G8B8A8_UNORM" "image": "R8G8B8A8_UNORM"
......
...@@ -1185,17 +1185,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1185,17 +1185,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R16G16B16A16_SNORM: case angle::FormatID::R16G16B16A16_SNORM:
intendedGLFormat = GL_RGBA16_SNORM_EXT; intendedGLFormat = GL_RGBA16_SNORM_EXT;
actualImageFormatID = angle::FormatID::R16G16B16A16_SNORM; actualImageFormatID = angle::FormatID::R16G16B16A16_SNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R16G16B16A16_SNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R16G16B16A16_SNORM, false, vertexLoadFunction = CopyNativeVertexData<GLshort, 4, 4, 0>;
CopyNativeVertexData<GLshort, 4, 4, 0>, false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R32G32B32A32_FLOAT, false,
CopyToFloatVertexData<GLshort, 4, 4, true, false>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R16G16B16A16_SSCALED: case angle::FormatID::R16G16B16A16_SSCALED:
...@@ -1225,17 +1221,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1225,17 +1221,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R16G16B16A16_UNORM: case angle::FormatID::R16G16B16A16_UNORM:
intendedGLFormat = GL_RGBA16_EXT; intendedGLFormat = GL_RGBA16_EXT;
actualImageFormatID = angle::FormatID::R16G16B16A16_UNORM; actualImageFormatID = angle::FormatID::R16G16B16A16_UNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R16G16B16A16_UNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R16G16B16A16_UNORM, false, vertexLoadFunction = CopyNativeVertexData<GLushort, 4, 4, 0>;
CopyNativeVertexData<GLushort, 4, 4, 0>, false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R32G32B32A32_FLOAT, false,
CopyToFloatVertexData<GLushort, 4, 4, true, false>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R16G16B16A16_USCALED: case angle::FormatID::R16G16B16A16_USCALED:
...@@ -1268,7 +1260,7 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1268,7 +1260,7 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
{angle::FormatID::R16G16B16_FLOAT, false, CopyNativeVertexData<GLhalf, 3, 3, 0>, {angle::FormatID::R16G16B16_FLOAT, false, CopyNativeVertexData<GLhalf, 3, 3, 0>,
false}, false},
{angle::FormatID::R16G16B16A16_FLOAT, false, {angle::FormatID::R16G16B16A16_FLOAT, false,
CopyNativeVertexData<GLhalf, 3, 4, 0>, true}}; CopyNativeVertexData<GLhalf, 3, 4, gl::Float16One>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -1287,7 +1279,7 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1287,7 +1279,7 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
{angle::FormatID::R16G16B16_SINT, false, CopyNativeVertexData<GLshort, 3, 3, 0>, {angle::FormatID::R16G16B16_SINT, false, CopyNativeVertexData<GLshort, 3, 3, 0>,
false}, false},
{angle::FormatID::R16G16B16A16_SINT, false, {angle::FormatID::R16G16B16A16_SINT, false,
CopyNativeVertexData<GLshort, 3, 4, 0>, true}}; CopyNativeVertexData<GLshort, 3, 4, 1>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -1301,7 +1293,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1301,7 +1293,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
{angle::FormatID::R16G16B16_SNORM, false, {angle::FormatID::R16G16B16_SNORM, false,
CopyNativeVertexData<GLshort, 3, 3, 0>, false}, CopyNativeVertexData<GLshort, 3, 3, 0>, false},
{angle::FormatID::R32G32B32_FLOAT, false, {angle::FormatID::R32G32B32_FLOAT, false,
CopyToFloatVertexData<GLshort, 3, 3, true, false>, true}}; CopyToFloatVertexData<GLshort, 3, 3, true, false>, true},
{angle::FormatID::R16G16B16_FLOAT, false,
CopyToFloatVertexData<GLshort, 3, 3, true, true>, true},
{angle::FormatID::R16G16B16A16_FLOAT, false,
CopyToFloatVertexData<GLshort, 3, 4, true, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -1315,7 +1311,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1315,7 +1311,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
{angle::FormatID::R16G16B16_SSCALED, false, {angle::FormatID::R16G16B16_SSCALED, false,
CopyNativeVertexData<GLshort, 3, 3, 0>, false}, CopyNativeVertexData<GLshort, 3, 3, 0>, false},
{angle::FormatID::R32G32B32_FLOAT, false, {angle::FormatID::R32G32B32_FLOAT, false,
CopyToFloatVertexData<GLshort, 3, 3, false, false>, true}}; CopyToFloatVertexData<GLshort, 3, 3, false, false>, true},
{angle::FormatID::R16G16B16_FLOAT, false,
CopyToFloatVertexData<GLshort, 3, 3, false, true>, true},
{angle::FormatID::R16G16B16A16_FLOAT, false,
CopyToFloatVertexData<GLshort, 3, 4, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -1334,7 +1334,7 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1334,7 +1334,7 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
{angle::FormatID::R16G16B16_UINT, false, {angle::FormatID::R16G16B16_UINT, false,
CopyNativeVertexData<GLushort, 3, 3, 0>, false}, CopyNativeVertexData<GLushort, 3, 3, 0>, false},
{angle::FormatID::R16G16B16A16_UINT, false, {angle::FormatID::R16G16B16A16_UINT, false,
CopyNativeVertexData<GLushort, 3, 4, 0>, true}}; CopyNativeVertexData<GLushort, 3, 4, 1>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -1348,7 +1348,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1348,7 +1348,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
{angle::FormatID::R16G16B16_UNORM, false, {angle::FormatID::R16G16B16_UNORM, false,
CopyNativeVertexData<GLushort, 3, 3, 0>, false}, CopyNativeVertexData<GLushort, 3, 3, 0>, false},
{angle::FormatID::R32G32B32_FLOAT, false, {angle::FormatID::R32G32B32_FLOAT, false,
CopyToFloatVertexData<GLushort, 3, 3, true, false>, true}}; CopyToFloatVertexData<GLushort, 3, 3, true, false>, true},
{angle::FormatID::R16G16B16_FLOAT, false,
CopyToFloatVertexData<GLushort, 3, 3, true, true>, true},
{angle::FormatID::R16G16B16A16_FLOAT, false,
CopyToFloatVertexData<GLushort, 3, 4, true, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -1362,7 +1366,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1362,7 +1366,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
{angle::FormatID::R16G16B16_USCALED, false, {angle::FormatID::R16G16B16_USCALED, false,
CopyNativeVertexData<GLushort, 3, 3, 0>, false}, CopyNativeVertexData<GLushort, 3, 3, 0>, false},
{angle::FormatID::R32G32B32_FLOAT, false, {angle::FormatID::R32G32B32_FLOAT, false,
CopyToFloatVertexData<GLushort, 3, 3, false, false>, true}}; CopyToFloatVertexData<GLushort, 3, 3, false, false>, true},
{angle::FormatID::R16G16B16_FLOAT, false,
CopyToFloatVertexData<GLushort, 3, 3, false, true>, true},
{angle::FormatID::R16G16B16A16_FLOAT, false,
CopyToFloatVertexData<GLushort, 3, 4, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -1388,17 +1396,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1388,17 +1396,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R16G16_SNORM: case angle::FormatID::R16G16_SNORM:
intendedGLFormat = GL_RG16_SNORM_EXT; intendedGLFormat = GL_RG16_SNORM_EXT;
actualImageFormatID = angle::FormatID::R16G16_SNORM; actualImageFormatID = angle::FormatID::R16G16_SNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R16G16_SNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R16G16_SNORM, false, CopyNativeVertexData<GLshort, 2, 2, 0>, vertexLoadFunction = CopyNativeVertexData<GLshort, 2, 2, 0>;
false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R32G32_FLOAT, false,
CopyToFloatVertexData<GLshort, 2, 2, true, false>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R16G16_SSCALED: case angle::FormatID::R16G16_SSCALED:
...@@ -1410,7 +1414,9 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1410,7 +1414,9 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
{angle::FormatID::R16G16_SSCALED, false, CopyNativeVertexData<GLshort, 2, 2, 0>, {angle::FormatID::R16G16_SSCALED, false, CopyNativeVertexData<GLshort, 2, 2, 0>,
false}, false},
{angle::FormatID::R32G32_FLOAT, false, {angle::FormatID::R32G32_FLOAT, false,
CopyToFloatVertexData<GLshort, 2, 2, false, false>, true}}; CopyToFloatVertexData<GLshort, 2, 2, false, false>, true},
{angle::FormatID::R16G16_FLOAT, false,
CopyToFloatVertexData<GLshort, 2, 2, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -1426,17 +1432,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1426,17 +1432,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R16G16_UNORM: case angle::FormatID::R16G16_UNORM:
intendedGLFormat = GL_RG16_EXT; intendedGLFormat = GL_RG16_EXT;
actualImageFormatID = angle::FormatID::R16G16_UNORM; actualImageFormatID = angle::FormatID::R16G16_UNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R16G16_UNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R16G16_UNORM, false, CopyNativeVertexData<GLushort, 2, 2, 0>, vertexLoadFunction = CopyNativeVertexData<GLushort, 2, 2, 0>;
false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R32G32_FLOAT, false,
CopyToFloatVertexData<GLushort, 2, 2, true, false>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R16G16_USCALED: case angle::FormatID::R16G16_USCALED:
...@@ -1448,7 +1450,9 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1448,7 +1450,9 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
{angle::FormatID::R16G16_USCALED, false, {angle::FormatID::R16G16_USCALED, false,
CopyNativeVertexData<GLushort, 2, 2, 0>, false}, CopyNativeVertexData<GLushort, 2, 2, 0>, false},
{angle::FormatID::R32G32_FLOAT, false, {angle::FormatID::R32G32_FLOAT, false,
CopyToFloatVertexData<GLushort, 2, 2, false, false>, true}}; CopyToFloatVertexData<GLushort, 2, 2, false, false>, true},
{angle::FormatID::R16G16_FLOAT, false,
CopyToFloatVertexData<GLushort, 2, 2, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -1474,17 +1478,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1474,17 +1478,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R16_SNORM: case angle::FormatID::R16_SNORM:
intendedGLFormat = GL_R16_SNORM_EXT; intendedGLFormat = GL_R16_SNORM_EXT;
actualImageFormatID = angle::FormatID::R16_SNORM; actualImageFormatID = angle::FormatID::R16_SNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R16_SNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R16_SNORM, false, CopyNativeVertexData<GLshort, 1, 1, 0>, vertexLoadFunction = CopyNativeVertexData<GLshort, 1, 1, 0>;
false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R32_FLOAT, false,
CopyToFloatVertexData<GLshort, 1, 1, true, false>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R16_SSCALED: case angle::FormatID::R16_SSCALED:
...@@ -1496,7 +1496,9 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1496,7 +1496,9 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
{angle::FormatID::R16_SSCALED, false, CopyNativeVertexData<GLshort, 1, 1, 0>, {angle::FormatID::R16_SSCALED, false, CopyNativeVertexData<GLshort, 1, 1, 0>,
false}, false},
{angle::FormatID::R32_FLOAT, false, {angle::FormatID::R32_FLOAT, false,
CopyToFloatVertexData<GLshort, 1, 1, false, false>, true}}; CopyToFloatVertexData<GLshort, 1, 1, false, false>, true},
{angle::FormatID::R16_FLOAT, false,
CopyToFloatVertexData<GLshort, 1, 1, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -1512,17 +1514,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1512,17 +1514,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R16_UNORM: case angle::FormatID::R16_UNORM:
intendedGLFormat = GL_R16_EXT; intendedGLFormat = GL_R16_EXT;
actualImageFormatID = angle::FormatID::R16_UNORM; actualImageFormatID = angle::FormatID::R16_UNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R16_UNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R16_UNORM, false, CopyNativeVertexData<GLushort, 1, 1, 0>, vertexLoadFunction = CopyNativeVertexData<GLushort, 1, 1, 0>;
false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R32_FLOAT, false,
CopyToFloatVertexData<GLushort, 1, 1, true, false>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R16_USCALED: case angle::FormatID::R16_USCALED:
...@@ -1534,7 +1532,9 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1534,7 +1532,9 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
{angle::FormatID::R16_USCALED, false, CopyNativeVertexData<GLushort, 1, 1, 0>, {angle::FormatID::R16_USCALED, false, CopyNativeVertexData<GLushort, 1, 1, 0>,
false}, false},
{angle::FormatID::R32_FLOAT, false, {angle::FormatID::R32_FLOAT, false,
CopyToFloatVertexData<GLushort, 1, 1, false, false>, true}}; CopyToFloatVertexData<GLushort, 1, 1, false, false>, true},
{angle::FormatID::R16_FLOAT, false,
CopyToFloatVertexData<GLushort, 1, 1, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -1641,8 +1641,10 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1641,8 +1641,10 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
static constexpr BufferFormatInitInfo kInfo[] = { static constexpr BufferFormatInitInfo kInfo[] = {
{angle::FormatID::R32G32B32_FLOAT, false, {angle::FormatID::R32G32B32_FLOAT, false,
CopyNativeVertexData<GLfloat, 3, 3, 0>, false}, CopyNativeVertexData<GLfloat, 3, 3, 0>, false},
{angle::FormatID::R16G16B16_FLOAT, false,
CopyToFloatVertexData<GLfloat, 3, 3, false, true>, true},
{angle::FormatID::R16G16B16A16_FLOAT, false, {angle::FormatID::R16G16B16A16_FLOAT, false,
CopyToFloatVertexData<GLfloat, 3, 3, false, true>, true}}; CopyToFloatVertexData<GLfloat, 3, 4, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 1); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 1);
} }
break; break;
...@@ -1922,17 +1924,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1922,17 +1924,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R8G8B8A8_SNORM: case angle::FormatID::R8G8B8A8_SNORM:
intendedGLFormat = GL_RGBA8_SNORM; intendedGLFormat = GL_RGBA8_SNORM;
actualImageFormatID = angle::FormatID::R8G8B8A8_SNORM; actualImageFormatID = angle::FormatID::R8G8B8A8_SNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R8G8B8A8_SNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R8G8B8A8_SNORM, false, CopyNativeVertexData<GLbyte, 4, 4, 0>, vertexLoadFunction = CopyNativeVertexData<GLbyte, 4, 4, 0>;
false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R16G16B16A16_FLOAT, false,
CopyToFloatVertexData<GLbyte, 4, 4, true, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R8G8B8A8_SSCALED: case angle::FormatID::R8G8B8A8_SSCALED:
...@@ -1968,17 +1966,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -1968,17 +1966,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R8G8B8A8_UNORM: case angle::FormatID::R8G8B8A8_UNORM:
intendedGLFormat = GL_RGBA8; intendedGLFormat = GL_RGBA8;
actualImageFormatID = angle::FormatID::R8G8B8A8_UNORM; actualImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R8G8B8A8_UNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R8G8B8A8_UNORM, false, CopyNativeVertexData<GLubyte, 4, 4, 0>, vertexLoadFunction = CopyNativeVertexData<GLubyte, 4, 4, 0>;
false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R16G16B16A16_FLOAT, false,
CopyToFloatVertexData<GLubyte, 4, 4, true, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R8G8B8A8_UNORM_SRGB: case angle::FormatID::R8G8B8A8_UNORM_SRGB:
...@@ -2018,7 +2012,7 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2018,7 +2012,7 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
static constexpr BufferFormatInitInfo kInfo[] = { static constexpr BufferFormatInitInfo kInfo[] = {
{angle::FormatID::R8G8B8_SINT, false, CopyNativeVertexData<GLbyte, 3, 3, 0>, {angle::FormatID::R8G8B8_SINT, false, CopyNativeVertexData<GLbyte, 3, 3, 0>,
false}, false},
{angle::FormatID::R8G8B8A8_SINT, false, CopyNativeVertexData<GLbyte, 3, 4, 0>, {angle::FormatID::R8G8B8A8_SINT, false, CopyNativeVertexData<GLbyte, 3, 4, 1>,
true}}; true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
...@@ -2037,8 +2031,8 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2037,8 +2031,8 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
static constexpr BufferFormatInitInfo kInfo[] = { static constexpr BufferFormatInitInfo kInfo[] = {
{angle::FormatID::R8G8B8_SNORM, false, CopyNativeVertexData<GLbyte, 3, 3, 0>, {angle::FormatID::R8G8B8_SNORM, false, CopyNativeVertexData<GLbyte, 3, 3, 0>,
false}, false},
{angle::FormatID::R32G32B32_FLOAT, false, {angle::FormatID::R8G8B8A8_SNORM, false,
CopyToFloatVertexData<GLbyte, 3, 3, true, false>, true}}; CopyNativeVertexData<GLbyte, 3, 4, std::numeric_limits<GLbyte>::max()>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -2051,9 +2045,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2051,9 +2045,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
static constexpr BufferFormatInitInfo kInfo[] = { static constexpr BufferFormatInitInfo kInfo[] = {
{angle::FormatID::R8G8B8_SSCALED, false, CopyNativeVertexData<GLbyte, 3, 3, 0>, {angle::FormatID::R8G8B8_SSCALED, false, CopyNativeVertexData<GLbyte, 3, 3, 0>,
false}, false},
{angle::FormatID::R32G32B32_FLOAT, false, {angle::FormatID::R16G16B16_FLOAT, false,
CopyToFloatVertexData<GLbyte, 3, 3, false, false>, true}}; CopyToFloatVertexData<GLbyte, 3, 3, false, true>, true},
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); {angle::FormatID::R16G16B16A16_FLOAT, false,
CopyToFloatVertexData<GLbyte, 3, 4, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
} }
break; break;
...@@ -2070,7 +2066,7 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2070,7 +2066,7 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
static constexpr BufferFormatInitInfo kInfo[] = { static constexpr BufferFormatInitInfo kInfo[] = {
{angle::FormatID::R8G8B8_UINT, false, CopyNativeVertexData<GLubyte, 3, 3, 0>, {angle::FormatID::R8G8B8_UINT, false, CopyNativeVertexData<GLubyte, 3, 3, 0>,
false}, false},
{angle::FormatID::R8G8B8A8_UINT, false, CopyNativeVertexData<GLubyte, 3, 4, 0>, {angle::FormatID::R8G8B8A8_UINT, false, CopyNativeVertexData<GLubyte, 3, 4, 1>,
true}}; true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
...@@ -2080,9 +2076,10 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2080,9 +2076,10 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
intendedGLFormat = GL_RGB8; intendedGLFormat = GL_RGB8;
actualImageFormatID = angle::FormatID::R8G8B8A8_UNORM; actualImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
imageInitializerFunction = Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>; imageInitializerFunction = Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>;
actualBufferFormatID = angle::FormatID::R32G32B32_FLOAT; actualBufferFormatID = angle::FormatID::R8G8B8A8_UNORM;
vkBufferFormatIsPacked = false; vkBufferFormatIsPacked = false;
vertexLoadFunction = CopyToFloatVertexData<GLubyte, 3, 3, true, false>; vertexLoadFunction =
CopyNativeVertexData<GLubyte, 3, 4, std::numeric_limits<GLubyte>::max()>;
vertexLoadRequiresConversion = true; vertexLoadRequiresConversion = true;
break; break;
...@@ -2109,9 +2106,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2109,9 +2106,11 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
static constexpr BufferFormatInitInfo kInfo[] = { static constexpr BufferFormatInitInfo kInfo[] = {
{angle::FormatID::R8G8B8_USCALED, false, CopyNativeVertexData<GLubyte, 3, 3, 0>, {angle::FormatID::R8G8B8_USCALED, false, CopyNativeVertexData<GLubyte, 3, 3, 0>,
false}, false},
{angle::FormatID::R32G32B32_FLOAT, false, {angle::FormatID::R16G16B16_FLOAT, false,
CopyToFloatVertexData<GLubyte, 3, 3, false, false>, true}}; CopyToFloatVertexData<GLubyte, 3, 3, false, true>, true},
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); {angle::FormatID::R16G16B16A16_FLOAT, false,
CopyToFloatVertexData<GLubyte, 3, 4, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
} }
break; break;
...@@ -2126,17 +2125,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2126,17 +2125,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R8G8_SNORM: case angle::FormatID::R8G8_SNORM:
intendedGLFormat = GL_RG8_SNORM; intendedGLFormat = GL_RG8_SNORM;
actualImageFormatID = angle::FormatID::R8G8_SNORM; actualImageFormatID = angle::FormatID::R8G8_SNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R8G8_SNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R8G8_SNORM, false, CopyNativeVertexData<GLbyte, 2, 2, 0>, vertexLoadFunction = CopyNativeVertexData<GLbyte, 2, 2, 0>;
false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R32G32_FLOAT, false,
CopyToFloatVertexData<GLbyte, 2, 2, true, false>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R8G8_SSCALED: case angle::FormatID::R8G8_SSCALED:
...@@ -2147,8 +2142,8 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2147,8 +2142,8 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
static constexpr BufferFormatInitInfo kInfo[] = { static constexpr BufferFormatInitInfo kInfo[] = {
{angle::FormatID::R8G8_SSCALED, false, CopyNativeVertexData<GLbyte, 2, 2, 0>, {angle::FormatID::R8G8_SSCALED, false, CopyNativeVertexData<GLbyte, 2, 2, 0>,
false}, false},
{angle::FormatID::R32G32_FLOAT, false, {angle::FormatID::R16G16_FLOAT, false,
CopyToFloatVertexData<GLbyte, 2, 2, false, false>, true}}; CopyToFloatVertexData<GLbyte, 2, 2, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -2164,17 +2159,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2164,17 +2159,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R8G8_UNORM: case angle::FormatID::R8G8_UNORM:
intendedGLFormat = GL_RG8; intendedGLFormat = GL_RG8;
actualImageFormatID = angle::FormatID::R8G8_UNORM; actualImageFormatID = angle::FormatID::R8G8_UNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R8G8_UNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R8G8_UNORM, false, CopyNativeVertexData<GLubyte, 2, 2, 0>, vertexLoadFunction = CopyNativeVertexData<GLubyte, 2, 2, 0>;
false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R32G32_FLOAT, false,
CopyToFloatVertexData<GLubyte, 2, 2, true, false>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R8G8_USCALED: case angle::FormatID::R8G8_USCALED:
...@@ -2185,8 +2176,8 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2185,8 +2176,8 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
static constexpr BufferFormatInitInfo kInfo[] = { static constexpr BufferFormatInitInfo kInfo[] = {
{angle::FormatID::R8G8_USCALED, false, CopyNativeVertexData<GLubyte, 2, 2, 0>, {angle::FormatID::R8G8_USCALED, false, CopyNativeVertexData<GLubyte, 2, 2, 0>,
false}, false},
{angle::FormatID::R32G32_FLOAT, false, {angle::FormatID::R16G16_FLOAT, false,
CopyToFloatVertexData<GLubyte, 2, 2, false, false>, true}}; CopyToFloatVertexData<GLubyte, 2, 2, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -2202,17 +2193,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2202,17 +2193,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R8_SNORM: case angle::FormatID::R8_SNORM:
intendedGLFormat = GL_R8_SNORM; intendedGLFormat = GL_R8_SNORM;
actualImageFormatID = angle::FormatID::R8_SNORM; actualImageFormatID = angle::FormatID::R8_SNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R8_SNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R8_SNORM, false, CopyNativeVertexData<GLbyte, 1, 1, 0>, vertexLoadFunction = CopyNativeVertexData<GLbyte, 1, 1, 0>;
false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R32_FLOAT, false,
CopyToFloatVertexData<GLbyte, 1, 1, true, false>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R8_SSCALED: case angle::FormatID::R8_SSCALED:
...@@ -2223,8 +2210,8 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2223,8 +2210,8 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
static constexpr BufferFormatInitInfo kInfo[] = { static constexpr BufferFormatInitInfo kInfo[] = {
{angle::FormatID::R8_SSCALED, false, CopyNativeVertexData<GLbyte, 1, 1, 0>, {angle::FormatID::R8_SSCALED, false, CopyNativeVertexData<GLbyte, 1, 1, 0>,
false}, false},
{angle::FormatID::R32_FLOAT, false, {angle::FormatID::R16_FLOAT, false,
CopyToFloatVertexData<GLbyte, 1, 1, false, false>, true}}; CopyToFloatVertexData<GLbyte, 1, 1, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
...@@ -2240,17 +2227,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2240,17 +2227,13 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::R8_UNORM: case angle::FormatID::R8_UNORM:
intendedGLFormat = GL_R8; intendedGLFormat = GL_R8;
actualImageFormatID = angle::FormatID::R8_UNORM; actualImageFormatID = angle::FormatID::R8_UNORM;
imageInitializerFunction = nullptr; imageInitializerFunction = nullptr;
{ actualBufferFormatID = angle::FormatID::R8_UNORM;
static constexpr BufferFormatInitInfo kInfo[] = { vkBufferFormatIsPacked = false;
{angle::FormatID::R8_UNORM, false, CopyNativeVertexData<GLubyte, 1, 1, 0>, vertexLoadFunction = CopyNativeVertexData<GLubyte, 1, 1, 0>;
false}, vertexLoadRequiresConversion = false;
{angle::FormatID::R32_FLOAT, false,
CopyToFloatVertexData<GLubyte, 1, 1, true, false>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
}
break; break;
case angle::FormatID::R8_UNORM_SRGB: case angle::FormatID::R8_UNORM_SRGB:
...@@ -2271,8 +2254,8 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) ...@@ -2271,8 +2254,8 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
static constexpr BufferFormatInitInfo kInfo[] = { static constexpr BufferFormatInitInfo kInfo[] = {
{angle::FormatID::R8_USCALED, false, CopyNativeVertexData<GLubyte, 1, 1, 0>, {angle::FormatID::R8_USCALED, false, CopyNativeVertexData<GLubyte, 1, 1, 0>,
false}, false},
{angle::FormatID::R32_FLOAT, false, {angle::FormatID::R16_FLOAT, false,
CopyToFloatVertexData<GLubyte, 1, 1, false, false>, true}}; CopyToFloatVertexData<GLubyte, 1, 1, false, true>, true}};
initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2); initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
} }
break; break;
......
...@@ -214,9 +214,7 @@ class VertexAttributeTest : public ANGLETest ...@@ -214,9 +214,7 @@ class VertexAttributeTest : public ANGLETest
glEnableVertexAttribArray(mExpectedAttrib); glEnableVertexAttribArray(mExpectedAttrib);
} }
void checkPixels() { checkRGBPixels(true); } void checkPixels()
void checkRGBPixels(bool checkAlpha)
{ {
GLint viewportSize[4]; GLint viewportSize[4];
glGetIntegerv(GL_VIEWPORT, viewportSize); glGetIntegerv(GL_VIEWPORT, viewportSize);
...@@ -227,20 +225,10 @@ class VertexAttributeTest : public ANGLETest ...@@ -227,20 +225,10 @@ class VertexAttributeTest : public ANGLETest
// We need to offset our checks from triangle edges to ensure we don't fall on a single tri // We need to offset our checks from triangle edges to ensure we don't fall on a single tri
// Avoid making assumptions of drawQuad with four checks to check the four possible tri // Avoid making assumptions of drawQuad with four checks to check the four possible tri
// regions // regions
if (checkAlpha) EXPECT_PIXEL_EQ((midPixelX + viewportSize[0]) / 2, midPixelY, 255, 255, 255, 255);
{ EXPECT_PIXEL_EQ((midPixelX + viewportSize[2]) / 2, midPixelY, 255, 255, 255, 255);
EXPECT_PIXEL_EQ((midPixelX + viewportSize[0]) / 2, midPixelY, 255, 255, 255, 255); EXPECT_PIXEL_EQ(midPixelX, (midPixelY + viewportSize[1]) / 2, 255, 255, 255, 255);
EXPECT_PIXEL_EQ((midPixelX + viewportSize[2]) / 2, midPixelY, 255, 255, 255, 255); EXPECT_PIXEL_EQ(midPixelX, (midPixelY + viewportSize[3]) / 2, 255, 255, 255, 255);
EXPECT_PIXEL_EQ(midPixelX, (midPixelY + viewportSize[1]) / 2, 255, 255, 255, 255);
EXPECT_PIXEL_EQ(midPixelX, (midPixelY + viewportSize[3]) / 2, 255, 255, 255, 255);
}
else
{
EXPECT_PIXEL_RGB_EQUAL((midPixelX + viewportSize[0]) / 2, midPixelY, 255, 255, 255);
EXPECT_PIXEL_RGB_EQUAL((midPixelX + viewportSize[2]) / 2, midPixelY, 255, 255, 255);
EXPECT_PIXEL_RGB_EQUAL(midPixelX, (midPixelY + viewportSize[1]) / 2, 255, 255, 255);
EXPECT_PIXEL_RGB_EQUAL(midPixelX, (midPixelY + viewportSize[3]) / 2, 255, 255, 255);
}
} }
void checkPixelsUnEqual() void checkPixelsUnEqual()
...@@ -284,16 +272,7 @@ class VertexAttributeTest : public ANGLETest ...@@ -284,16 +272,7 @@ class VertexAttributeTest : public ANGLETest
if (checkPixelEqual) if (checkPixelEqual)
{ {
if ((test.type == GL_HALF_FLOAT || test.type == GL_HALF_FLOAT_OES) && IsVulkan() && checkPixels();
typeSize == 3)
{ // We need a special case for RGB16F format on a Vulkan backend due to the fact
// that in such a usecase, we need to ignore the alpha channel.
checkRGBPixels(false);
}
else
{
checkPixels();
}
} }
else else
{ {
......
...@@ -268,17 +268,6 @@ void LoadEntryPointsWithUtilLoader(angle::GLESDriverType driver); ...@@ -268,17 +268,6 @@ void LoadEntryPointsWithUtilLoader(angle::GLESDriverType driver);
EXPECT_EQ((a), pixel[3]); \ EXPECT_EQ((a), pixel[3]); \
} while (0) } while (0)
#define EXPECT_PIXEL_RGB_EQ_HELPER(x, y, r, g, b, ctype, format, type) \
do \
{ \
ctype pixel[4]; \
glReadPixels((x), (y), 1, 1, format, type, pixel); \
EXPECT_GL_NO_ERROR(); \
EXPECT_EQ((r), pixel[0]); \
EXPECT_EQ((g), pixel[1]); \
EXPECT_EQ((b), pixel[2]); \
} while (0)
#define EXPECT_PIXEL_NEAR(x, y, r, g, b, a, abs_error) \ #define EXPECT_PIXEL_NEAR(x, y, r, g, b, a, abs_error) \
EXPECT_PIXEL_NEAR_HELPER(x, y, r, g, b, a, abs_error, GLubyte, GL_RGBA, GL_UNSIGNED_BYTE) EXPECT_PIXEL_NEAR_HELPER(x, y, r, g, b, a, abs_error, GLubyte, GL_RGBA, GL_UNSIGNED_BYTE)
...@@ -297,9 +286,6 @@ void LoadEntryPointsWithUtilLoader(angle::GLESDriverType driver); ...@@ -297,9 +286,6 @@ void LoadEntryPointsWithUtilLoader(angle::GLESDriverType driver);
#define EXPECT_PIXEL_16UI_COLOR(x, y, color) \ #define EXPECT_PIXEL_16UI_COLOR(x, y, color) \
EXPECT_PIXEL_16UI(x, y, color.R, color.G, color.B, color.A) EXPECT_PIXEL_16UI(x, y, color.R, color.G, color.B, color.A)
#define EXPECT_PIXEL_RGB_EQUAL(x, y, r, g, b) \
EXPECT_PIXEL_RGB_EQ_HELPER(x, y, r, g, b, GLubyte, GL_RGBA, GL_UNSIGNED_BYTE)
// TODO(jmadill): Figure out how we can use GLColor's nice printing with EXPECT_NEAR. // TODO(jmadill): Figure out how we can use GLColor's nice printing with EXPECT_NEAR.
#define EXPECT_PIXEL_COLOR_NEAR(x, y, angleColor, abs_error) \ #define EXPECT_PIXEL_COLOR_NEAR(x, y, angleColor, abs_error) \
EXPECT_PIXEL_NEAR(x, y, angleColor.R, angleColor.G, angleColor.B, angleColor.A, abs_error) EXPECT_PIXEL_NEAR(x, y, angleColor.R, angleColor.G, angleColor.B, angleColor.A, abs_error)
......
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