#include "test_utils/ANGLETest.h"
#include "common/debug.h"
#include "test_utils/VulkanHelper.h"
#include "test_utils/gl_raii.h"
namespace angle
{
namespace
{
constexpr int kInvalidFd = …;
constexpr VkImageUsageFlags kDefaultImageUsageFlags = …;
constexpr VkImageCreateFlags kDefaultImageCreateFlags = …;
constexpr VkImageUsageFlags kNoStorageImageUsageFlags = …;
constexpr VkImageCreateFlags kMutableImageCreateFlags = …;
const struct ImageFormatPair
{ … } kChromeFormats[] = …;
struct OpaqueFdTraits
{ … };
struct FuchsiaTraits
{ … };
VkImageLayout GetPostReleaseVulkanLayout(GLenum glLayout)
{ … }
void AdjustCreateFlags(bool useMemoryObjectFlags, VkImageCreateFlags *createFlags)
{ … }
constexpr uint32_t kWidth = …;
constexpr uint32_t kHeight = …;
}
class VulkanExternalImageTest : public ANGLETest<>
{ … };
class VulkanExternalImageTestES31 : public VulkanExternalImageTest
{ … };
template <typename Traits>
void RunShouldImportMemoryTest(VkImageCreateFlags createFlags,
VkImageUsageFlags usageFlags,
bool isSwiftshader,
bool enableDebugLayers)
{ … }
TEST_P(VulkanExternalImageTest, ShouldImportMemoryOpaqueFd)
{ … }
TEST_P(VulkanExternalImageTest, ShouldImportMemoryZirconVmo)
{ … }
template <typename Traits>
void RunShouldImportSemaphoreTest(bool isSwiftshader, bool enableDebugLayers)
{ … }
TEST_P(VulkanExternalImageTest, ShouldImportSemaphoreOpaqueFd)
{ … }
TEST_P(VulkanExternalImageTest, ShouldImportSemaphoreZirconEvent)
{ … }
template <typename Traits>
void RunShouldClearTest(bool useMemoryObjectFlags,
VkImageCreateFlags createFlags,
VkImageUsageFlags usageFlags,
bool isSwiftshader,
bool enableDebugLayers)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearOpaqueFdRGBA8)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearOpaqueWithFlagsFdRGBA8)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearNoStorageUsageOpaqueFdRGBA8)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearMutableNoStorageUsageOpaqueFdRGBA8)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearZirconVmoRGBA8)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearZirconWithFlagsVmoRGBA8)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearNoStorageUsageZirconVmoRGBA8)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearMutableNoStorageUsageZirconVmoRGBA8)
{ … }
template <typename Traits>
void RunTextureFormatCompatChromiumTest(bool useMemoryObjectFlags,
VkImageCreateFlags createFlags,
VkImageUsageFlags usageFlags,
bool isSwiftshader,
bool enableDebugLayers,
bool isES3)
{ … }
TEST_P(VulkanExternalImageTest, TextureFormatCompatChromiumFd)
{ … }
TEST_P(VulkanExternalImageTest, TextureFormatCompatChromiumWithFlagsFd)
{ … }
TEST_P(VulkanExternalImageTest, TextureFormatCompatChromiumNoStorageFd)
{ … }
TEST_P(VulkanExternalImageTest, TextureFormatCompatChromiumMutableNoStorageFd)
{ … }
TEST_P(VulkanExternalImageTest, TextureFormatCompatChromiumZirconVmo)
{ … }
TEST_P(VulkanExternalImageTest, TextureFormatCompatChromiumWithFlagsZirconVmo)
{ … }
TEST_P(VulkanExternalImageTest, TextureFormatCompatChromiumNoStorageZirconVmo)
{ … }
TEST_P(VulkanExternalImageTest, TextureFormatCompatChromiumMutableNoStorageZirconVmo)
{ … }
template <typename Traits>
void RunShouldClearWithSemaphoresTest(bool useMemoryObjectFlags,
VkImageCreateFlags createFlags,
VkImageUsageFlags usageFlags,
bool isSwiftshader,
bool enableDebugLayers)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearOpaqueFdWithSemaphores)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearOpaqueFdWithSemaphoresWithFlags)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearOpaqueFdWithSemaphoresNoStorage)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearOpaqueFdWithSemaphoresMutableNoStorage)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearZirconVmoWithSemaphores)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearZirconVmoWithSemaphoresWithFlags)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearZirconVmoWithSemaphoresNoStorage)
{ … }
TEST_P(VulkanExternalImageTest, ShouldClearZirconVmoWithSemaphoresMutableNoStorage)
{ … }
template <typename Traits>
void VulkanExternalImageTest::runShouldDrawTest(bool isSwiftshader, bool enableDebugLayers)
{ … }
TEST_P(VulkanExternalImageTest, ShouldDrawOpaqueFdWithSemaphores)
{ … }
TEST_P(VulkanExternalImageTest, ShouldDrawZirconVmoWithSemaphores)
{ … }
template <typename Traits>
void VulkanExternalImageTest::runWaitSemaphoresRetainsContentTest(bool isSwiftshader,
bool enableDebugLayers)
{ … }
TEST_P(VulkanExternalImageTest, WaitSemaphoresRetainsContentOpaqueFd)
{ … }
TEST_P(VulkanExternalImageTest, WaitSemaphoresRetainsContentZirconVmo)
{ … }
TEST_P(VulkanExternalImageTest, ShouldSupportExternalHandlesFuchsia)
{ … }
template <typename Traits>
void RunPreInitializedOnGLImportTest(bool useMemoryObjectFlags,
VkImageTiling tiling,
bool isSwiftshader,
bool enableDebugLayers)
{ … }
TEST_P(VulkanExternalImageTest, PreInitializedOnGLImport)
{ … }
TEST_P(VulkanExternalImageTest, PreInitializedOnGLImportLinear)
{ … }
TEST_P(VulkanExternalImageTest, PreInitializedOnGLImportWithFlags)
{ … }
TEST_P(VulkanExternalImageTest, PreInitializedOnGLImportLinearWithFlags)
{ … }
template <typename Traits>
void RunUninitializedOnGLImportTest(bool useMemoryObjectFlags,
std::function<GLenum(GLuint)> useTexture,
const uint32_t *expectInVulkan,
bool isSwiftshader,
bool enableDebugLayers)
{ … }
TEST_P(VulkanExternalImageTest, UninitializedOnGLImport)
{ … }
TEST_P(VulkanExternalImageTest, UninitializedOnGLImportAndExport)
{ … }
TEST_P(VulkanExternalImageTest, UninitializedOnGLImportAndCopy)
{ … }
TEST_P(VulkanExternalImageTest, UninitializedOnGLImportAndSample)
{ … }
TEST_P(VulkanExternalImageTestES31, UninitializedOnGLImportAndStorageWrite)
{ … }
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3(…);
ANGLE_INSTANTIATE_TEST_ES31(…);
}