Add testing of depth and stencil Android Hardware Buffer formats.
These are added in Android API version 28 and present in the Format
Equivalence Table for VK_ANDROID_external_memory_android_hardware_buffer
Added tests:
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d16_unorm
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.x8_d24_unorm_pack32
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d24_unorm_s8_uint
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d32_sfloat
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d32_sfloat_s8_uint
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.s8_uint
Components: Vulkan
VK-GL-CTS issue: 2280
Change-Id: Ia90efc34f600eea6a1510276f3edab668c253459
dEQP-VK.api.fill_and_update_buffer.dedicated_alloc.fill_buffer_vk_whole_size_3_extra_bytes_offset_4
dEQP-VK.api.fill_and_update_buffer.dedicated_alloc.fill_buffer_vk_whole_size_3_extra_bytes_offset_8
dEQP-VK.api.fill_and_update_buffer.dedicated_alloc.fill_buffer_vk_whole_size_3_extra_bytes_offset_12
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d16_unorm
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.x8_d24_unorm_pack32
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d24_unorm_s8_uint
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d32_sfloat
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d32_sfloat_s8_uint
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.s8_uint
dEQP-VK.api.external.memory.dma_buf.suballocated.device_only.import_twice
dEQP-VK.api.external.memory.dma_buf.suballocated.device_only.import_multiple_times
dEQP-VK.api.external.memory.dma_buf.suballocated.device_only.dup
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.r5g6b5_unorm_pack16
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.r16g16b16a16_sfloat
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.a2b10g10r10_unorm_pack32
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d16_unorm
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.x8_d24_unorm_pack32
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d24_unorm_s8_uint
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d32_sfloat
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d32_sfloat_s8_uint
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.s8_uint
dEQP-VK.api.external.memory.dma_buf.suballocated.device_only.import_twice
dEQP-VK.api.external.memory.dma_buf.suballocated.device_only.import_multiple_times
dEQP-VK.api.external.memory.dma_buf.suballocated.device_only.dup
#include "vkPlatform.hpp"
#include "vkMemUtil.hpp"
#include "vkApiVersion.hpp"
+#include "vkImageUtil.hpp"
#include "tcuTestLog.hpp"
#include "tcuCommandLine.hpp"
vki.getPhysicalDeviceFeatures2(physicalDevice, &deviceFeatures);
+ const vk::VkImageUsageFlagBits framebufferUsageFlag = vk::isDepthStencilFormat(format) ? vk::VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
+ : vk::VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
+
const vk::VkImageUsageFlagBits usageFlags[] =
{
vk::VK_IMAGE_USAGE_TRANSFER_SRC_BIT,
vk::VK_IMAGE_USAGE_TRANSFER_DST_BIT,
vk::VK_IMAGE_USAGE_SAMPLED_BIT,
vk::VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT,
- vk::VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
+ framebufferUsageFlag,
};
const vk::VkImageCreateFlagBits createFlags[] =
{
vk::VK_FORMAT_R5G6B5_UNORM_PACK16,
vk::VK_FORMAT_R16G16B16A16_SFLOAT,
vk::VK_FORMAT_A2B10G10R10_UNORM_PACK32,
+ vk::VK_FORMAT_D16_UNORM,
+ vk::VK_FORMAT_X8_D24_UNORM_PACK32,
+ vk::VK_FORMAT_D24_UNORM_S8_UINT,
+ vk::VK_FORMAT_D32_SFLOAT,
+ vk::VK_FORMAT_D32_SFLOAT_S8_UINT,
+ vk::VK_FORMAT_S8_UINT,
};
const size_t numOfAhbFormats = DE_LENGTH_OF_ARRAY(ahbFormats);
case vk::VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT:
return AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE;
case vk::VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT:
+ case vk::VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT:
+ // Alias of AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER which is defined in later Android API versions.
return AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT;
default:
return 0u;
public:
virtual deUint64 vkCreateToAhbUsage(vk::VkImageCreateFlagBits vkFlag);
+ virtual deUint32 vkFormatToAhbFormat(vk::VkFormat vkFormat);
virtual deUint64 mustSupportAhbUsageFlags();
AndroidHardwareBufferExternalApi28() : AndroidHardwareBufferExternalApi26() {};
}
}
+deUint32 AndroidHardwareBufferExternalApi28::vkFormatToAhbFormat(vk::VkFormat vkFormat)
+{
+ switch(vkFormat)
+ {
+ case vk::VK_FORMAT_D16_UNORM:
+ return AHARDWAREBUFFER_FORMAT_D16_UNORM;
+ case vk::VK_FORMAT_X8_D24_UNORM_PACK32:
+ return AHARDWAREBUFFER_FORMAT_D24_UNORM;
+ case vk::VK_FORMAT_D24_UNORM_S8_UINT:
+ return AHARDWAREBUFFER_FORMAT_D24_UNORM_S8_UINT;
+ case vk::VK_FORMAT_D32_SFLOAT:
+ return AHARDWAREBUFFER_FORMAT_D32_FLOAT;
+ case vk::VK_FORMAT_D32_SFLOAT_S8_UINT:
+ return AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT;
+ case vk::VK_FORMAT_S8_UINT:
+ return AHARDWAREBUFFER_FORMAT_S8_UINT;
+ default:
+ return AndroidHardwareBufferExternalApi26::vkFormatToAhbFormat(vkFormat);
+ }
+}
+
deUint64 AndroidHardwareBufferExternalApi28::mustSupportAhbUsageFlags()
{
return AndroidHardwareBufferExternalApi26::mustSupportAhbUsageFlags() | AHARDWAREBUFFER_USAGE_GPU_CUBE_MAP | AHARDWAREBUFFER_USAGE_GPU_MIPMAP_COMPLETE;
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.r5g6b5_unorm_pack16
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.r16g16b16a16_sfloat
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.a2b10g10r10_unorm_pack32
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d16_unorm
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.x8_d24_unorm_pack32
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d24_unorm_s8_uint
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d32_sfloat
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d32_sfloat_s8_uint
+dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.s8_uint
dEQP-VK.api.external.memory.dma_buf.suballocated.device_only.import_twice
dEQP-VK.api.external.memory.dma_buf.suballocated.device_only.import_multiple_times
dEQP-VK.api.external.memory.dma_buf.suballocated.device_only.dup