diff --git a/src/dawn_native/PassResourceUsage.h b/src/dawn_native/PassResourceUsage.h index 9271114bc5..e7b0c1bd0c 100644 --- a/src/dawn_native/PassResourceUsage.h +++ b/src/dawn_native/PassResourceUsage.h @@ -45,8 +45,8 @@ namespace dawn_native { // the vector to record every single subresource's Usages. The texture usage is enough. And we // can decompress texture usage to a vector if necessary. struct PassTextureUsage { - wgpu::TextureUsage usage; - bool sameUsagesAcrossSubresources; + wgpu::TextureUsage usage = wgpu::TextureUsage::None; + bool sameUsagesAcrossSubresources = true; std::vector subresourceUsages; }; diff --git a/src/dawn_native/PassResourceUsageTracker.cpp b/src/dawn_native/PassResourceUsageTracker.cpp index f5e4a5664e..bd176dfcb2 100644 --- a/src/dawn_native/PassResourceUsageTracker.cpp +++ b/src/dawn_native/PassResourceUsageTracker.cpp @@ -43,7 +43,7 @@ namespace dawn_native { // Set parameters for the whole texture textureUsage.usage |= usage; uint32_t subresourceCount = texture->GetSubresourceCount(); - textureUsage.sameUsagesAcrossSubresources = levelCount * layerCount == subresourceCount; + textureUsage.sameUsagesAcrossSubresources &= levelCount * layerCount == subresourceCount; // Set usages for subresources if (!textureUsage.subresourceUsages.size()) { diff --git a/src/tests/end2end/MultisampledRenderingTests.cpp b/src/tests/end2end/MultisampledRenderingTests.cpp index 9192fca408..ef03bf2f89 100644 --- a/src/tests/end2end/MultisampledRenderingTests.cpp +++ b/src/tests/end2end/MultisampledRenderingTests.cpp @@ -422,9 +422,6 @@ TEST_P(MultisampledRenderingTest, ResolveOneMultisampledTextureTwice) { // Test using a layer of a 2D texture as resolve target works correctly. TEST_P(MultisampledRenderingTest, ResolveIntoOneMipmapLevelOf2DTexture) { - // TODO(dawn:462): Investigate backend validation failure. - DAWN_SKIP_TEST_IF(IsD3D12() && IsBackendValidationEnabled()); - constexpr uint32_t kBaseMipLevel = 2; wgpu::TextureViewDescriptor textureViewDescriptor; @@ -462,9 +459,6 @@ TEST_P(MultisampledRenderingTest, ResolveIntoOneMipmapLevelOf2DTexture) { // Test using a level or a layer of a 2D array texture as resolve target works correctly. TEST_P(MultisampledRenderingTest, ResolveInto2DArrayTexture) { - // TODO(dawn:462): Investigate backend validation failure. - DAWN_SKIP_TEST_IF(IsD3D12() && IsBackendValidationEnabled()); - wgpu::TextureView multisampledColorView2 = CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateView();