Commit 67c388e6 by Frank Henigman Committed by Commit Bot

Vulkan: support GL_FIXED vertex data.

Override fixed to float, generate code, enable tests. BUG=angleproject:2405 Change-Id: Ic3e9a31eaf22372023b94081b0f4a83770dcabbe Reviewed-on: https://chromium-review.googlesource.com/1144455 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent e452382a
......@@ -68,7 +68,7 @@
"Vulkan format:src/libANGLE/renderer/vulkan/gen_vk_format_table.py":
"4a69cb1e69194ca237b94642edbd3f69",
"Vulkan format:src/libANGLE/renderer/vulkan/vk_format_map.json":
"d1afcd16318ca0a19550d713eb23b85a",
"f7cb189ab41f1ce48ff26e7c328c5cd0",
"Vulkan internal shader programs:src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py":
"c1cc895645db3fe1cd284352890c219e",
"Vulkan internal shader programs:src/libANGLE/renderer/vulkan/shaders/src/FullScreenQuad.vert":
......@@ -82,7 +82,7 @@
"Vulkan mandatory format support table:src/libANGLE/renderer/vulkan/vk_mandatory_format_support_data.json":
"fa2bd54c1bb0ab2cf1d386061a4bc5c5",
"Vulkan mandatory format support table:third_party/vulkan-headers/src/registry/vk.xml":
"e21d71df417d9f90ef01417b25e78575",
"c73903f9411b54db01d4891bc24ebd0e",
"packed enum:src/common/gen_packed_gl_enums.py":
"a9b1c38b4e4d8a1038e743be323f1a51",
"packed enum:src/common/packed_egl_enums.json":
......
......@@ -325,12 +325,12 @@ angle::Result VertexArrayVk::syncDirtyAttrib(ContextVk *contextVk,
// Invalidate the input description for pipelines.
mDirtyPackedInputs.set(attribIndex);
RendererVk *renderer = contextVk->getRenderer();
RendererVk *renderer = contextVk->getRenderer();
bool releaseConversion = true;
if (attrib.enabled)
{
gl::Buffer *bufferGL = binding.getBuffer().get();
gl::Buffer *bufferGL = binding.getBuffer().get();
mCurrentArrayBufferFormats[attribIndex] = &renderer->getFormat(GetVertexFormatID(attrib));
if (bufferGL)
......
......@@ -227,6 +227,18 @@
"D24_UNORM_X8_UINT": {
"buffer": "NONE",
"texture": "D24_UNORM_S8_UINT"
},
"R32_FIXED": {
"buffer": "R32_FLOAT"
},
"R32G32_FIXED": {
"buffer": "R32G32_FLOAT"
},
"R32G32B32_FIXED": {
"buffer": "R32G32B32_FLOAT"
},
"R32G32B32A32_FIXED": {
"buffer": "R32G32B32A32_FLOAT"
}
},
"fallbacks": {
......
......@@ -593,10 +593,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
case angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK:
internalFormat = GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;
textureFormatID = angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK;
textureFormatID = angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK;
vkTextureFormat = VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK;
textureInitializerFunction = Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>;
bufferFormatID = angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK;
bufferFormatID = angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK;
vkBufferFormat = VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK;
vertexLoadFunction = CopyNativeVertexData<GLubyte, 4, 4, 0>;
vertexLoadRequiresConversion = false;
......@@ -1021,7 +1021,12 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
case angle::FormatID::R32G32B32A32_FIXED:
// This format is not implemented in Vulkan.
internalFormat = GL_RGBA32_FIXED_ANGLEX;
bufferFormatID = angle::FormatID::R32G32B32A32_FLOAT;
vkBufferFormat = VK_FORMAT_R32G32B32A32_SFLOAT;
vertexLoadFunction = Copy32FixedTo32FVertexData<4, 4>;
vertexLoadRequiresConversion = true;
break;
case angle::FormatID::R32G32B32A32_FLOAT:
......@@ -1074,7 +1079,12 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
case angle::FormatID::R32G32B32_FIXED:
// This format is not implemented in Vulkan.
internalFormat = GL_RGB32_FIXED_ANGLEX;
bufferFormatID = angle::FormatID::R32G32B32_FLOAT;
vkBufferFormat = VK_FORMAT_R32G32B32_SFLOAT;
vertexLoadFunction = Copy32FixedTo32FVertexData<3, 3>;
vertexLoadRequiresConversion = true;
break;
case angle::FormatID::R32G32B32_FLOAT:
......@@ -1127,7 +1137,12 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
case angle::FormatID::R32G32_FIXED:
// This format is not implemented in Vulkan.
internalFormat = GL_RG32_FIXED_ANGLEX;
bufferFormatID = angle::FormatID::R32G32_FLOAT;
vkBufferFormat = VK_FORMAT_R32G32_SFLOAT;
vertexLoadFunction = Copy32FixedTo32FVertexData<2, 2>;
vertexLoadRequiresConversion = true;
break;
case angle::FormatID::R32G32_FLOAT:
......@@ -1180,7 +1195,12 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
case angle::FormatID::R32_FIXED:
// This format is not implemented in Vulkan.
internalFormat = GL_R32_FIXED_ANGLEX;
bufferFormatID = angle::FormatID::R32_FLOAT;
vkBufferFormat = VK_FORMAT_R32_SFLOAT;
vertexLoadFunction = Copy32FixedTo32FVertexData<1, 1>;
vertexLoadRequiresConversion = true;
break;
case angle::FormatID::R32_FLOAT:
......
......@@ -341,7 +341,7 @@ angle::Result DynamicDescriptorPool::allocateNewPool(Context *context)
descriptorPoolInfo.pPoolSizes = &mPoolSize;
mFreeDescriptorSets = mPoolSize.descriptorCount;
mCurrentSetsCount = 0;
mCurrentSetsCount = 0;
ANGLE_TRY(mCurrentDescriptorPool.init(context, descriptorPoolInfo));
return angle::Result::Continue();
......@@ -496,10 +496,7 @@ void LineLoopHelper::Draw(uint32_t count, CommandBuffer *commandBuffer)
// ImageHelper implementation.
ImageHelper::ImageHelper()
: mFormat(nullptr),
mSamples(0),
mCurrentLayout(VK_IMAGE_LAYOUT_UNDEFINED),
mLayerCount(0)
: mFormat(nullptr), mSamples(0), mCurrentLayout(VK_IMAGE_LAYOUT_UNDEFINED), mLayerCount(0)
{
}
......
......@@ -216,6 +216,8 @@
2606 VULKAN ANDROID : dEQP-GLES2.functional.debug_marker.random = SKIP
2606 VULKAN ANDROID : dEQP-GLES2.functional.debug_marker.supported = SKIP
2609 VULKAN ANDROID : dEQP-GLES2.functional.texture.mipmap.cube.generate.* = SKIP
2405 VULKAN ANDROID : dEQP-GLES2.functional.draw.random.42 = SKIP
2405 VULKAN ANDROID : dEQP-GLES2.functional.draw.random.59 = SKIP
2567 GLES ANDROID : dEQP-GLES2.functional.fbo.completeness.renderable.texture.depth.red_unsigned_byte = FAIL
2567 GLES ANDROID : dEQP-GLES2.functional.fbo.completeness.renderable.texture.depth.rg_unsigned_byte = FAIL
......@@ -233,51 +235,6 @@
2601 VULKAN : dEQP-GLES2.functional.clipping.* = SKIP
2353 VULKAN : dEQP-GLES2.functional.polygon_offset.* = SKIP
// fixed format vertex data
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_byte2_vec2_byte2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_byte2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_byte2_vec2_short2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_byte2_vec2_unsigned_byte2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_byte2_vec2_unsigned_short2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_short2_vec2_byte2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_short2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_short2_vec2_short2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_short2_vec2_unsigned_byte2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_short2_vec2_unsigned_short2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_unsigned_byte2_vec2_byte2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_unsigned_byte2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_unsigned_byte2_vec2_short2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_unsigned_byte2_vec2_unsigned_byte2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_unsigned_byte2_vec2_unsigned_short2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_unsigned_short2_vec2_byte2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_unsigned_short2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_unsigned_short2_vec2_short2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_unsigned_short2_vec2_unsigned_byte2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.multiple_attributes.input_types.3_unsigned_short2_vec2_unsigned_short2_vec2_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.first.fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.normalize.user_ptr_0_0_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.offset.buffer_32_32_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.offset.buffer_32_8_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.offset.buffer_4_32_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.offset.buffer_4_8_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.output_types.user_ptr_0_0_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.strides.buffer_0_12_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.strides.buffer_0_16_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.strides.buffer_0_32_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.strides.buffer_0_8_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.usages.buffer_0_0_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.usages.buffer_0_32_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.vertex_arrays.single_attribute.usages.buffer_0_8_fixed* = SKIP
2405 VULKAN : dEQP-GLES2.functional.draw.random.9 = SKIP
2405 VULKAN : dEQP-GLES2.functional.draw.random.28 = SKIP
2405 VULKAN : dEQP-GLES2.functional.draw.random.38 = SKIP
2405 VULKAN : dEQP-GLES2.functional.draw.random.39 = SKIP
2405 VULKAN : dEQP-GLES2.functional.draw.random.42 = SKIP
2405 VULKAN : dEQP-GLES2.functional.draw.random.56 = SKIP
2405 VULKAN : dEQP-GLES2.functional.draw.random.59 = SKIP
2405 VULKAN : dEQP-GLES2.functional.draw.random.61 = SKIP
// Vulkan AMD Windows specific failures
2602 VULKAN WIN AMD : dEQP-GLES2.functional.buffer.write.* = SKIP
......
......@@ -394,20 +394,11 @@ void AttributeLayoutTest::GetTestCases(void)
mTestCases.push_back({NormSByte(M0, 0, 8, mCoord), NormUByte(M0, 4, 8, mColor)});
mTestCases.push_back({NormSShort(M0, 0, 20, mCoord), NormUShort(M0, 8, 20, mColor)});
if (IsVulkan())
{
std::cout << "cases skipped on Vulkan: fixed format vertex data" << std::endl;
mTestCases.push_back({});
mTestCases.push_back({});
}
else
{
// 10. one buffer, sequential
mTestCases.push_back({Fixed(B0, 0, 8, mCoord), Float(B0, 96, 12, mColor)});
// 10. one buffer, sequential
mTestCases.push_back({Fixed(B0, 0, 8, mCoord), Float(B0, 96, 12, mColor)});
// 11. one buffer, interleaved
mTestCases.push_back({Fixed(B0, 0, 20, mCoord), Float(B0, 8, 20, mColor)});
}
// 11. one buffer, interleaved
mTestCases.push_back({Fixed(B0, 0, 20, mCoord), Float(B0, 8, 20, mColor)});
// 12. memory and buffer, float and integer
mTestCases.push_back({Float(M0, 0, 8, mCoord), SByte(B0, 0, 12, mColor)});
......
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