Add basic supports of storage textures on D3D12

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

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: Ie29a3a9962cd1a79217bc87815ed0bd27623e3a8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21140
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
Jiawei Shao
2020-05-07 00:06:44 +00:00
committed by Commit Bot service account
parent 458ab1bf7f
commit e8bf706d16
6 changed files with 70 additions and 13 deletions

View File

@@ -237,8 +237,14 @@ 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 and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsOpenGL());
// TODO(jiawei.shao@intel.com): support read-only storage texture on OpenGL.
DAWN_SKIP_TEST_IF(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.
// TODO(jiawei.shao@intel.com): enable this test when we specify "--use-spvc-parser" after the
// bug in spvc parser is fixed.
DAWN_SKIP_TEST_IF(IsD3D12() && IsSpvcParserBeingUsed());
// Prepare the read-only storage texture and fill it with the expected data.
// TODO(jiawei.shao@intel.com): test more texture formats.
@@ -292,8 +298,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 and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsOpenGL());
// TODO(jiawei.shao@intel.com): support read-only storage texture on OpenGL.
DAWN_SKIP_TEST_IF(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.
@@ -336,8 +342,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 and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsOpenGL());
// TODO(jiawei.shao@intel.com): support read-only storage texture on OpenGL.
DAWN_SKIP_TEST_IF(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.
@@ -373,7 +379,13 @@ 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 and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsOpenGL());
DAWN_SKIP_TEST_IF(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.
// TODO(jiawei.shao@intel.com): enable this test when we specify "--use-spvc-parser" after the
// bug in spvc parser is fixed.
DAWN_SKIP_TEST_IF(IsD3D12() && IsSpvcParserBeingUsed());
// Prepare the write-only storage texture.
// TODO(jiawei.shao@intel.com): test more texture formats.
@@ -403,7 +415,13 @@ 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 and OpenGL.
DAWN_SKIP_TEST_IF(IsD3D12() || IsOpenGL());
DAWN_SKIP_TEST_IF(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.
// TODO(jiawei.shao@intel.com): enable this test when we specify "--use-spvc-parser" after the
// bug in spvc parser is fixed.
DAWN_SKIP_TEST_IF(IsD3D12() && IsSpvcParserBeingUsed());
// Prepare the write-only storage texture.
// TODO(jiawei.shao@intel.com): test more texture formats.