From bb6a413daab067326fed2f67e2e66531fe55f896 Mon Sep 17 00:00:00 2001 From: Tony Barbour Date: Tue, 31 Mar 2015 08:59:00 -0600 Subject: [PATCH] tests: Use image format to determine tiling --- tests/image_tests.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/image_tests.cpp b/tests/image_tests.cpp index fd62f0e..a0d3bb5 100644 --- a/tests/image_tests.cpp +++ b/tests/image_tests.cpp @@ -172,7 +172,15 @@ void XglImageTest::CreateImage(uint32_t w, uint32_t h) imageCreateInfo.extent.depth = 1; imageCreateInfo.mipLevels = mipCount; imageCreateInfo.samples = 1; - imageCreateInfo.tiling = XGL_LINEAR_TILING; + if (image_fmt.linearTilingFeatures & XGL_FORMAT_IMAGE_SHADER_READ_BIT) { + imageCreateInfo.tiling = XGL_LINEAR_TILING; + } + else if (image_fmt.optimalTilingFeatures & XGL_FORMAT_IMAGE_SHADER_READ_BIT) { + imageCreateInfo.tiling = XGL_OPTIMAL_TILING; + } + else { + ASSERT_TRUE(false) << "Cannot find supported tiling format - Exiting"; + } // Image usage flags // typedef enum _XGL_IMAGE_USAGE_FLAGS -- 2.7.4