From 342c6ea1a9332fbc1b3c5b40b6694e14ef897eb8 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Thu, 18 Apr 2019 18:28:48 +0000 Subject: [PATCH] Fix MultisampledRenderingWithDepthTest This test was using two separate depth-stencil textures for sequential render passes. The second render pass is supposed to load the texture from the first but it was instead loading a new uninitialized texture. Bug: dawn:133 Change-Id: I615ec4502a6f26bd039187b0c1942ffbb806b549 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6640 Reviewed-by: Corentin Wallez Reviewed-by: Kai Ninomiya Commit-Queue: Austin Eng --- src/tests/end2end/MultisampledRenderingTests.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tests/end2end/MultisampledRenderingTests.cpp b/src/tests/end2end/MultisampledRenderingTests.cpp index 11e2c0a996..cc07188f5d 100644 --- a/src/tests/end2end/MultisampledRenderingTests.cpp +++ b/src/tests/end2end/MultisampledRenderingTests.cpp @@ -31,6 +31,9 @@ class MultisampledRenderingTest : public DawnTest { CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateDefaultView(); mResolveTexture = CreateTextureForOutputAttachment(kColorFormat, 1); mResolveView = mResolveTexture.CreateDefaultView(); + + mDepthStencilTexture = CreateTextureForOutputAttachment(kDepthStencilFormat, kSampleCount); + mDepthStencilView = mDepthStencilTexture.CreateDefaultView(); } dawn::RenderPipeline CreateRenderPipelineWithOneOutputForTest(bool testDepth) { @@ -140,10 +143,7 @@ class MultisampledRenderingTest : public DawnTest { renderPass.cDepthStencilAttachmentInfo.depthLoadOp = depthStencilLoadOp; if (hasDepthStencilAttachment) { - dawn::Texture depthStencilTexture = - CreateTextureForOutputAttachment(kDepthStencilFormat, kSampleCount); - renderPass.cDepthStencilAttachmentInfo.attachment = - depthStencilTexture.CreateDefaultView(); + renderPass.cDepthStencilAttachmentInfo.attachment = mDepthStencilView; renderPass.depthStencilAttachment = &renderPass.cDepthStencilAttachmentInfo; } @@ -179,6 +179,8 @@ class MultisampledRenderingTest : public DawnTest { dawn::TextureView mMultisampledColorView; dawn::Texture mResolveTexture; dawn::TextureView mResolveView; + dawn::Texture mDepthStencilTexture; + dawn::TextureView mDepthStencilView; dawn::BindGroupLayout mBindGroupLayout; private: