Vulkan: Choose D32S8 or D24S8 depending on availability

The Vulkan spec mandates support for only one or the other, which is
why we have the concept of a depth24plus format. This also adds a Toggle
to test both formats in DepthStencilStateTests.

Finally this renames ForceWorkarounds to ForceToggles because toggles
can be more than just workarounds.

BUG=dawn:286

Change-Id: I5b5dc582ffd4ee61c51e3e75563aec815c580511
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14103
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: David Turner <digit@google.com>
This commit is contained in:
Corentin Wallez
2019-12-05 14:02:11 +00:00
committed by Commit Bot service account
parent ec0020c208
commit 84a57756db
17 changed files with 104 additions and 47 deletions

View File

@@ -93,9 +93,9 @@ const DawnTestParam MetalBackend(dawn_native::BackendType::Metal);
const DawnTestParam OpenGLBackend(dawn_native::BackendType::OpenGL);
const DawnTestParam VulkanBackend(dawn_native::BackendType::Vulkan);
DawnTestParam ForceWorkarounds(const DawnTestParam& originParam,
std::initializer_list<const char*> forceEnabledWorkarounds,
std::initializer_list<const char*> forceDisabledWorkarounds) {
DawnTestParam ForceToggles(const DawnTestParam& originParam,
std::initializer_list<const char*> forceEnabledWorkarounds,
std::initializer_list<const char*> forceDisabledWorkarounds) {
DawnTestParam newTestParam = originParam;
newTestParam.forceEnabledWorkarounds = forceEnabledWorkarounds;
newTestParam.forceDisabledWorkarounds = forceDisabledWorkarounds;

View File

@@ -104,9 +104,9 @@ extern const DawnTestParam MetalBackend;
extern const DawnTestParam OpenGLBackend;
extern const DawnTestParam VulkanBackend;
DawnTestParam ForceWorkarounds(const DawnTestParam& originParam,
std::initializer_list<const char*> forceEnabledWorkarounds,
std::initializer_list<const char*> forceDisabledWorkarounds = {});
DawnTestParam ForceToggles(const DawnTestParam& originParam,
std::initializer_list<const char*> forceEnabledWorkarounds,
std::initializer_list<const char*> forceDisabledWorkarounds = {});
namespace utils {
class TerribleCommandBuffer;

View File

@@ -746,7 +746,7 @@ TEST_P(CreateBufferMappedTests, LargeBufferFails) {
DAWN_INSTANTIATE_TEST(CreateBufferMappedTests,
D3D12Backend,
ForceWorkarounds(D3D12Backend, {}, {"use_d3d12_resource_heap_tier2"}),
ForceToggles(D3D12Backend, {}, {"use_d3d12_resource_heap_tier2"}),
MetalBackend,
OpenGLBackend,
VulkanBackend);

View File

@@ -1054,5 +1054,5 @@ DAWN_INSTANTIATE_TEST(CompressedTextureBCFormatTest,
MetalBackend,
OpenGLBackend,
VulkanBackend,
ForceWorkarounds(VulkanBackend,
{"use_temporary_buffer_in_texture_to_texture_copy"}));
ForceToggles(VulkanBackend,
{"use_temporary_buffer_in_texture_to_texture_copy"}));

View File

@@ -682,7 +682,8 @@ TEST_P(DepthStencilStateTest, StencilDepthPass) {
}
DAWN_INSTANTIATE_TEST(DepthStencilStateTest,
D3D12Backend,
MetalBackend,
OpenGLBackend,
VulkanBackend);
D3D12Backend,
MetalBackend,
OpenGLBackend,
ForceToggles(VulkanBackend, {"vulkan_use_d32s8"}, {}),
ForceToggles(VulkanBackend, {}, {"vulkan_use_d32s8"}));

View File

@@ -497,13 +497,13 @@ TEST_P(MultisampledRenderingTest, ResolveInto2DArrayTexture) {
DAWN_INSTANTIATE_TEST(MultisampledRenderingTest,
D3D12Backend,
ForceWorkarounds(D3D12Backend, {}, {"use_d3d12_resource_heap_tier2"}),
ForceWorkarounds(D3D12Backend, {}, {"use_d3d12_render_pass"}),
ForceToggles(D3D12Backend, {}, {"use_d3d12_resource_heap_tier2"}),
ForceToggles(D3D12Backend, {}, {"use_d3d12_render_pass"}),
MetalBackend,
OpenGLBackend,
VulkanBackend,
ForceWorkarounds(MetalBackend, {"emulate_store_and_msaa_resolve"}),
ForceWorkarounds(MetalBackend, {"always_resolve_into_zero_level_and_layer"}),
ForceWorkarounds(MetalBackend,
{"always_resolve_into_zero_level_and_layer",
"emulate_store_and_msaa_resolve"}));
ForceToggles(MetalBackend, {"emulate_store_and_msaa_resolve"}),
ForceToggles(MetalBackend, {"always_resolve_into_zero_level_and_layer"}),
ForceToggles(MetalBackend,
{"always_resolve_into_zero_level_and_layer",
"emulate_store_and_msaa_resolve"}));

View File

@@ -166,12 +166,12 @@ TEST_P(NonzeroTextureCreationTests, NonRenderableTextureClearWithMultiArrayLayer
}
DAWN_INSTANTIATE_TEST(NonzeroTextureCreationTests,
ForceWorkarounds(D3D12Backend,
{"nonzero_clear_resources_on_creation_for_testing"},
{"lazy_clear_resource_on_first_use"}),
ForceWorkarounds(OpenGLBackend,
{"nonzero_clear_resources_on_creation_for_testing"},
{"lazy_clear_resource_on_first_use"}),
ForceWorkarounds(VulkanBackend,
{"nonzero_clear_resources_on_creation_for_testing"},
{"lazy_clear_resource_on_first_use"}));
ForceToggles(D3D12Backend,
{"nonzero_clear_resources_on_creation_for_testing"},
{"lazy_clear_resource_on_first_use"}),
ForceToggles(OpenGLBackend,
{"nonzero_clear_resources_on_creation_for_testing"},
{"lazy_clear_resource_on_first_use"}),
ForceToggles(VulkanBackend,
{"nonzero_clear_resources_on_creation_for_testing"},
{"lazy_clear_resource_on_first_use"}));

View File

@@ -167,7 +167,7 @@ TEST_P(RenderPassTest, NoCorrespondingFragmentShaderOutputs) {
DAWN_INSTANTIATE_TEST(RenderPassTest,
D3D12Backend,
ForceWorkarounds(D3D12Backend, {}, {"use_d3d12_render_pass"}),
ForceToggles(D3D12Backend, {}, {"use_d3d12_render_pass"}),
MetalBackend,
OpenGLBackend,
VulkanBackend);

View File

@@ -762,9 +762,9 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepthStencilStoreOpClear) {
DAWN_INSTANTIATE_TEST(
TextureZeroInitTest,
ForceWorkarounds(D3D12Backend, {"nonzero_clear_resources_on_creation_for_testing"}),
ForceWorkarounds(D3D12Backend,
{"nonzero_clear_resources_on_creation_for_testing"},
{"use_d3d12_render_pass"}),
ForceWorkarounds(OpenGLBackend, {"nonzero_clear_resources_on_creation_for_testing"}),
ForceWorkarounds(VulkanBackend, {"nonzero_clear_resources_on_creation_for_testing"}));
ForceToggles(D3D12Backend, {"nonzero_clear_resources_on_creation_for_testing"}),
ForceToggles(D3D12Backend,
{"nonzero_clear_resources_on_creation_for_testing"},
{"use_d3d12_render_pass"}),
ForceToggles(OpenGLBackend, {"nonzero_clear_resources_on_creation_for_testing"}),
ForceToggles(VulkanBackend, {"nonzero_clear_resources_on_creation_for_testing"}));

View File

@@ -607,7 +607,7 @@ TEST_P(DrawCallPerf, Run) {
DAWN_INSTANTIATE_PERF_TEST_SUITE_P(
DrawCallPerf,
{D3D12Backend, MetalBackend, OpenGLBackend, VulkanBackend,
ForceWorkarounds(VulkanBackend, {"skip_validation"})},
ForceToggles(VulkanBackend, {"skip_validation"})},
{
// Baseline
MakeParam(),