Vulkan: Implement very basic textures.
This is a quick implementation which supports only one backing Image
and one type of ImageView at a time, for 2D texture only.
It also implements a helper class for finding compatible memory pools.
It's possible we can keep a cache of memory pool indexes given the
guarantees the Vulkan spec has on compatible memory types (see the
documentation for VkMemoryRequirements).
BUG=angleproject:2167
Change-Id: I1d7a8eaec90f240273ad75194e23430d6d4c5dc1
Reviewed-on: https://chromium-review.googlesource.com/680000
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
diff --git a/src/tests/gl_tests/SimpleOperationTest.cpp b/src/tests/gl_tests/SimpleOperationTest.cpp
index 4e40215..29fa0fa 100644
--- a/src/tests/gl_tests/SimpleOperationTest.cpp
+++ b/src/tests/gl_tests/SimpleOperationTest.cpp
@@ -330,6 +330,26 @@
EXPECT_PIXEL_RECT_EQ(0, 0, getWindowWidth(), getWindowHeight(), GLColor::yellow);
}
+// Creates a texture, no other operations.
+TEST_P(SimpleOperationTest, CreateTexture2DNoData)
+{
+ GLTexture texture;
+ glBindTexture(GL_TEXTURE_2D, texture);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
+ ASSERT_GL_NO_ERROR();
+}
+
+// Creates a texture, no other operations.
+TEST_P(SimpleOperationTest, CreateTexture2DWithData)
+{
+ std::vector<GLColor> colors(16 * 16, GLColor::red);
+
+ GLTexture texture;
+ glBindTexture(GL_TEXTURE_2D, texture);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, colors.data());
+ ASSERT_GL_NO_ERROR();
+}
+
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(SimpleOperationTest,
ES2_D3D9(),