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 <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng 2019-04-18 18:28:48 +00:00 committed by Commit Bot service account
parent 0c133bbe55
commit 342c6ea1a9
1 changed files with 6 additions and 4 deletions

View File

@ -31,6 +31,9 @@ class MultisampledRenderingTest : public DawnTest {
CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateDefaultView(); CreateTextureForOutputAttachment(kColorFormat, kSampleCount).CreateDefaultView();
mResolveTexture = CreateTextureForOutputAttachment(kColorFormat, 1); mResolveTexture = CreateTextureForOutputAttachment(kColorFormat, 1);
mResolveView = mResolveTexture.CreateDefaultView(); mResolveView = mResolveTexture.CreateDefaultView();
mDepthStencilTexture = CreateTextureForOutputAttachment(kDepthStencilFormat, kSampleCount);
mDepthStencilView = mDepthStencilTexture.CreateDefaultView();
} }
dawn::RenderPipeline CreateRenderPipelineWithOneOutputForTest(bool testDepth) { dawn::RenderPipeline CreateRenderPipelineWithOneOutputForTest(bool testDepth) {
@ -140,10 +143,7 @@ class MultisampledRenderingTest : public DawnTest {
renderPass.cDepthStencilAttachmentInfo.depthLoadOp = depthStencilLoadOp; renderPass.cDepthStencilAttachmentInfo.depthLoadOp = depthStencilLoadOp;
if (hasDepthStencilAttachment) { if (hasDepthStencilAttachment) {
dawn::Texture depthStencilTexture = renderPass.cDepthStencilAttachmentInfo.attachment = mDepthStencilView;
CreateTextureForOutputAttachment(kDepthStencilFormat, kSampleCount);
renderPass.cDepthStencilAttachmentInfo.attachment =
depthStencilTexture.CreateDefaultView();
renderPass.depthStencilAttachment = &renderPass.cDepthStencilAttachmentInfo; renderPass.depthStencilAttachment = &renderPass.cDepthStencilAttachmentInfo;
} }
@ -179,6 +179,8 @@ class MultisampledRenderingTest : public DawnTest {
dawn::TextureView mMultisampledColorView; dawn::TextureView mMultisampledColorView;
dawn::Texture mResolveTexture; dawn::Texture mResolveTexture;
dawn::TextureView mResolveView; dawn::TextureView mResolveView;
dawn::Texture mDepthStencilTexture;
dawn::TextureView mDepthStencilView;
dawn::BindGroupLayout mBindGroupLayout; dawn::BindGroupLayout mBindGroupLayout;
private: private: