Add basic supports of storage textures on Vulkan

This patch adds the basic supports of read-only and write-only storage
textures on Vulkan.

The subresource tracking and barriers on the subresources used as
read-only and write-only storage textures are not included in this
patch.

BUG=dawn:267
TEST=dawn_end2end_tests

Change-Id: I6831b96202a97182763ecd28bc41ab03df904a7c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20560
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Jiawei Shao
2020-04-30 02:43:08 +00:00
committed by Commit Bot service account
parent c85ef7927f
commit 754c161fd3
5 changed files with 52 additions and 28 deletions

View File

@@ -176,6 +176,7 @@ class StorageTextureTests : public DawnTest {
#version 450
void main() {
gl_Position = vec4(0.f, 0.f, 0.f, 1.f);
gl_PointSize = 1.0f;
})";
const char* kCommonReadOnlyTestCode_uimage2D = R"(
@@ -236,8 +237,8 @@ TEST_P(StorageTextureTests, BindGroupLayoutWithStorageTextureBindingType) {
// Test that read-only storage textures are supported in compute shader.
TEST_P(StorageTextureTests, ReadonlyStorageTextureInComputeShader) {
// TODO(jiawei.shao@intel.com): support read-only storage texture on D3D12, Vulkan and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsVulkan() || IsOpenGL());
// TODO(jiawei.shao@intel.com): support read-only storage texture on D3D12 and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsOpenGL());
// Prepare the read-only storage texture and fill it with the expected data.
// TODO(jiawei.shao@intel.com): test more texture formats.
@@ -291,8 +292,8 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInComputeShader) {
// Test that read-only storage textures are supported in vertex shader.
TEST_P(StorageTextureTests, ReadonlyStorageTextureInVertexShader) {
// TODO(jiawei.shao@intel.com): support read-only storage texture on D3D12, Vulkan and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsVulkan() || IsOpenGL());
// TODO(jiawei.shao@intel.com): support read-only storage texture on D3D12 and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsOpenGL());
// When we run dawn_end2end_tests with "--use-spvc-parser", extracting the binding type of a
// read-only image will always return shaderc_spvc_binding_type_writeonly_storage_texture.
@@ -321,6 +322,7 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInVertexShader) {
} else {
o_color = vec4(1.f, 0.f, 0.f, 1.f);
}
gl_PointSize = 1.0f;
})";
const char* kFragmentShader = R"(
#version 450
@@ -334,8 +336,8 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInVertexShader) {
// Test that read-only storage textures are supported in fragment shader.
TEST_P(StorageTextureTests, ReadonlyStorageTextureInFragmentShader) {
// TODO(jiawei.shao@intel.com): support read-only storage texture on D3D12, Vulkan and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsVulkan() || IsOpenGL());
// TODO(jiawei.shao@intel.com): support read-only storage texture on D3D12 and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsOpenGL());
// When we run dawn_end2end_tests with "--use-spvc-parser", extracting the binding type of a
// read-only image will always return shaderc_spvc_binding_type_writeonly_storage_texture.
@@ -370,8 +372,8 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInFragmentShader) {
// Test that write-only storage textures are supported in compute shader.
TEST_P(StorageTextureTests, WriteonlyStorageTextureInComputeShader) {
// TODO(jiawei.shao@intel.com): support read-only storage texture on D3D12, Vulkan and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsVulkan() || IsOpenGL());
// TODO(jiawei.shao@intel.com): support read-only storage texture on D3D12 and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsOpenGL());
// Prepare the write-only storage texture.
// TODO(jiawei.shao@intel.com): test more texture formats.
@@ -400,8 +402,8 @@ TEST_P(StorageTextureTests, WriteonlyStorageTextureInComputeShader) {
// Test that write-only storage textures are supported in fragment shader.
TEST_P(StorageTextureTests, WriteonlyStorageTextureInFragmentShader) {
// TODO(jiawei.shao@intel.com): support read-only storage texture on D3D12, Vulkan and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsVulkan() || IsOpenGL());
// TODO(jiawei.shao@intel.com): support read-only storage texture on D3D12 and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsOpenGL());
// Prepare the write-only storage texture.
// TODO(jiawei.shao@intel.com): test more texture formats.