mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-14 11:21:40 +00:00
Add render pass color and depth stencil attachment descriptor
This patch is the first one of the descriptorization of render pass. In this patch we add support of RenderPassColorAttachmentDescriptor and RenderPassDepthStencilAttachmentDescriptor to RenderPassDescriptorBuilder. This patch also adds StoreOp to render pass color and depth stencil attachment descriptor. RenderPassDescriptorBuilder will be completely removed in the next patch. BUG=dawn:6, dawn:49 TEST=dawn_end2end_tests, dawn_unittests Change-Id: If623b41d04016425efa53932ae1648daf2263675 Reviewed-on: https://dawn-review.googlesource.com/c/3300 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
parent
292c0c31f2
commit
5e811aeee5
73
dawn.json
73
dawn.json
@ -275,6 +275,15 @@
|
|||||||
"char": {
|
"char": {
|
||||||
"category": "native"
|
"category": "native"
|
||||||
},
|
},
|
||||||
|
"color": {
|
||||||
|
"category": "structure",
|
||||||
|
"members": [
|
||||||
|
{"name": "r", "type": "float"},
|
||||||
|
{"name": "g", "type": "float"},
|
||||||
|
{"name": "b", "type": "float"},
|
||||||
|
{"name": "a", "type": "float"}
|
||||||
|
]
|
||||||
|
},
|
||||||
"color write mask": {
|
"color write mask": {
|
||||||
"category": "bitmask",
|
"category": "bitmask",
|
||||||
"values": [
|
"values": [
|
||||||
@ -678,6 +687,12 @@
|
|||||||
{"value": 1, "name": "load"}
|
{"value": 1, "name": "load"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"store op": {
|
||||||
|
"category": "enum",
|
||||||
|
"values": [
|
||||||
|
{"value": 0, "name": "store"}
|
||||||
|
]
|
||||||
|
},
|
||||||
"origin 3D": {
|
"origin 3D": {
|
||||||
"category": "structure",
|
"category": "structure",
|
||||||
"members": [
|
"members": [
|
||||||
@ -744,6 +759,31 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"render pass color attachment descriptor": {
|
||||||
|
"category": "structure",
|
||||||
|
"members": [
|
||||||
|
{"name": "attachment", "type": "texture view"},
|
||||||
|
{"name": "resolve target", "type": "texture view", "optional": true},
|
||||||
|
{"name": "load op", "type": "load op"},
|
||||||
|
{"name": "store op", "type": "store op"},
|
||||||
|
{"name": "clear color", "type": "color"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"render pass depth stencil attachment descriptor": {
|
||||||
|
"category": "structure",
|
||||||
|
"members": [
|
||||||
|
{"name": "attachment", "type": "texture view"},
|
||||||
|
{"name": "depth load op", "type": "load op"},
|
||||||
|
{"name": "depth store op", "type": "store op"},
|
||||||
|
{"name": "clear depth", "type": "float"},
|
||||||
|
{"name": "stencil load op", "type": "load op"},
|
||||||
|
{"name": "stencil store op", "type": "store op"},
|
||||||
|
{"name": "clear stencil", "type": "uint32_t"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"render pass descriptor builder": {
|
"render pass descriptor builder": {
|
||||||
"category": "object",
|
"category": "object",
|
||||||
"methods": [
|
"methods": [
|
||||||
@ -752,41 +792,20 @@
|
|||||||
"returns": "render pass descriptor"
|
"returns": "render pass descriptor"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "set color attachment",
|
"name": "set color attachments",
|
||||||
"args": [
|
"args": [
|
||||||
{"name": "attachment slot", "type": "uint32_t"},
|
{"name": "count", "type": "uint32_t"},
|
||||||
{"name": "texture view", "type": "texture view"},
|
{"name": "color attachments", "type": "render pass color attachment descriptor", "annotation": "const*", "length": "count"}
|
||||||
{"name": "load op", "type": "load op"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "set color attachment clear color",
|
|
||||||
"TODO": "determine where to put these methods (probably BeginRenderPass?)",
|
|
||||||
"args": [
|
|
||||||
{"name": "attachment slot", "type": "uint32_t"},
|
|
||||||
{"name": "clear r", "type": "float"},
|
|
||||||
{"name": "clear g", "type": "float"},
|
|
||||||
{"name": "clear b", "type": "float"},
|
|
||||||
{"name": "clear a", "type": "float"}
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "set depth stencil attachment",
|
"name": "set depth stencil attachment",
|
||||||
"args": [
|
"args": [
|
||||||
{"name": "texture view", "type": "texture view"},
|
{"name": "depth stencil attachment", "type": "render pass depth stencil attachment descriptor", "annotation": "const*"}
|
||||||
{"name": "depth load op", "type": "load op"},
|
|
||||||
{"name": "stencil load op", "type": "load op"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "set depth stencil attachment clear value",
|
|
||||||
"TODO": "determine where to put these methods (probably BeginRenderPass?)",
|
|
||||||
"args": [
|
|
||||||
{"name": "clear depth", "type": "float"},
|
|
||||||
{"name": "clear stencil", "type": "uint32_t"}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"TODO": "Remove this builder and use render pass descriptor directly"
|
||||||
},
|
},
|
||||||
"render pass descriptor": {
|
"render pass descriptor": {
|
||||||
"category": "object"
|
"category": "object"
|
||||||
|
@ -127,7 +127,13 @@ void frame() {
|
|||||||
dawnRenderPassDescriptor renderpassInfo;
|
dawnRenderPassDescriptor renderpassInfo;
|
||||||
{
|
{
|
||||||
dawnRenderPassDescriptorBuilder builder = dawnDeviceCreateRenderPassDescriptorBuilder(device);
|
dawnRenderPassDescriptorBuilder builder = dawnDeviceCreateRenderPassDescriptorBuilder(device);
|
||||||
dawnRenderPassDescriptorBuilderSetColorAttachment(builder, 0, backbufferView, DAWN_LOAD_OP_CLEAR);
|
dawnRenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = backbufferView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = DAWN_LOAD_OP_CLEAR;
|
||||||
|
colorAttachment.storeOp = DAWN_STORE_OP_STORE;
|
||||||
|
dawnRenderPassDescriptorBuilderSetColorAttachments(builder, 1, &colorAttachment);
|
||||||
renderpassInfo = dawnRenderPassDescriptorBuilderGetResult(builder);
|
renderpassInfo = dawnRenderPassDescriptorBuilderGetResult(builder);
|
||||||
dawnRenderPassDescriptorBuilderRelease(builder);
|
dawnRenderPassDescriptorBuilderRelease(builder);
|
||||||
}
|
}
|
||||||
|
@ -157,9 +157,25 @@ void GetNextRenderPassDescriptor(const dawn::Device& device,
|
|||||||
dawn::RenderPassDescriptor* info) {
|
dawn::RenderPassDescriptor* info) {
|
||||||
*backbuffer = swapchain.GetNextTexture();
|
*backbuffer = swapchain.GetNextTexture();
|
||||||
auto backbufferView = backbuffer->CreateDefaultTextureView();
|
auto backbufferView = backbuffer->CreateDefaultTextureView();
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = backbufferView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
|
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
|
||||||
|
depthStencilAttachment.attachment = depthStencilView;
|
||||||
|
depthStencilAttachment.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment.clearStencil = 0;
|
||||||
|
depthStencilAttachment.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
|
|
||||||
*info = device.CreateRenderPassDescriptorBuilder()
|
*info = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, backbufferView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.SetDepthStencilAttachment(depthStencilView, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
.SetDepthStencilAttachment(&depthStencilAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,53 +144,52 @@ namespace dawn_native {
|
|||||||
return GetDevice()->CreateRenderPassDescriptor(this);
|
return GetDevice()->CreateRenderPassDescriptor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderPassDescriptorBuilder::SetColorAttachment(uint32_t attachment,
|
void RenderPassDescriptorBuilder::SetColorAttachments(
|
||||||
TextureViewBase* textureView,
|
uint32_t count,
|
||||||
dawn::LoadOp loadOp) {
|
const RenderPassColorAttachmentDescriptor* attachments) {
|
||||||
if (attachment >= kMaxColorAttachments) {
|
if (count > kMaxColorAttachments) {
|
||||||
HandleError("Setting color attachment out of bounds");
|
HandleError("Setting color attachments out of bounds");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (textureView == nullptr) {
|
for (uint32_t i = 0; i < count; ++i) {
|
||||||
HandleError("Texture view cannot be nullptr");
|
// TODO(jiawei.shao@intel.com): support resolve target for multisample color attachment.
|
||||||
return;
|
if (attachments[i].resolveTarget != nullptr) {
|
||||||
}
|
HandleError("Resolve target is not supported now");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!IsColorRenderableTextureFormat(textureView->GetFormat())) {
|
TextureViewBase* textureView = attachments[i].attachment;
|
||||||
HandleError(
|
if (textureView == nullptr) {
|
||||||
"The format of the texture view used as color attachment is not color renderable");
|
continue;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!CheckArrayLayersAndLevelCountForAttachment(textureView)) {
|
if (!IsColorRenderableTextureFormat(textureView->GetFormat())) {
|
||||||
return;
|
HandleError(
|
||||||
}
|
"The format of the texture view used as color attachment is not color "
|
||||||
|
"renderable");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mColorAttachmentsSet.set(attachment);
|
if (!CheckArrayLayersAndLevelCountForAttachment(textureView)) {
|
||||||
mColorAttachments[attachment].loadOp = loadOp;
|
return;
|
||||||
mColorAttachments[attachment].view = textureView;
|
}
|
||||||
|
|
||||||
|
// TODO(jiawei.shao@intel.com): set and make use of storeOp
|
||||||
|
mColorAttachmentsSet.set(i);
|
||||||
|
mColorAttachments[i].loadOp = attachments[i].loadOp;
|
||||||
|
mColorAttachments[i].view = textureView;
|
||||||
|
|
||||||
|
mColorAttachments[i].clearColor[0] = attachments[i].clearColor.r;
|
||||||
|
mColorAttachments[i].clearColor[1] = attachments[i].clearColor.g;
|
||||||
|
mColorAttachments[i].clearColor[2] = attachments[i].clearColor.b;
|
||||||
|
mColorAttachments[i].clearColor[3] = attachments[i].clearColor.a;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderPassDescriptorBuilder::SetColorAttachmentClearColor(uint32_t attachment,
|
void RenderPassDescriptorBuilder::SetDepthStencilAttachment(
|
||||||
float clearR,
|
const RenderPassDepthStencilAttachmentDescriptor* attachment) {
|
||||||
float clearG,
|
TextureViewBase* textureView = attachment->attachment;
|
||||||
float clearB,
|
|
||||||
float clearA) {
|
|
||||||
if (attachment >= kMaxColorAttachments) {
|
|
||||||
HandleError("Setting color attachment out of bounds");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mColorAttachments[attachment].clearColor[0] = clearR;
|
|
||||||
mColorAttachments[attachment].clearColor[1] = clearG;
|
|
||||||
mColorAttachments[attachment].clearColor[2] = clearB;
|
|
||||||
mColorAttachments[attachment].clearColor[3] = clearA;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RenderPassDescriptorBuilder::SetDepthStencilAttachment(TextureViewBase* textureView,
|
|
||||||
dawn::LoadOp depthLoadOp,
|
|
||||||
dawn::LoadOp stencilLoadOp) {
|
|
||||||
if (textureView == nullptr) {
|
if (textureView == nullptr) {
|
||||||
HandleError("Texture view cannot be nullptr");
|
HandleError("Texture view cannot be nullptr");
|
||||||
return;
|
return;
|
||||||
@ -207,16 +206,13 @@ namespace dawn_native {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(jiawei.shao@intel.com): set and make use of depthStoreOp and stencilStoreOp
|
||||||
mDepthStencilAttachmentSet = true;
|
mDepthStencilAttachmentSet = true;
|
||||||
mDepthStencilAttachment.depthLoadOp = depthLoadOp;
|
mDepthStencilAttachment.depthLoadOp = attachment->depthLoadOp;
|
||||||
mDepthStencilAttachment.stencilLoadOp = stencilLoadOp;
|
mDepthStencilAttachment.stencilLoadOp = attachment->stencilLoadOp;
|
||||||
mDepthStencilAttachment.view = textureView;
|
mDepthStencilAttachment.view = textureView;
|
||||||
}
|
mDepthStencilAttachment.clearDepth = attachment->clearDepth;
|
||||||
|
mDepthStencilAttachment.clearStencil = attachment->clearStencil;
|
||||||
void RenderPassDescriptorBuilder::SetDepthStencilAttachmentClearValue(float clearDepth,
|
|
||||||
uint32_t clearStencil) {
|
|
||||||
mDepthStencilAttachment.clearDepth = clearDepth;
|
|
||||||
mDepthStencilAttachment.clearStencil = clearStencil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace dawn_native
|
} // namespace dawn_native
|
||||||
|
@ -72,24 +72,18 @@ namespace dawn_native {
|
|||||||
uint32_t mHeight;
|
uint32_t mHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO(jiawei.shao@intel.com): remove RenderPassDescriptorBuilder and set data into
|
||||||
|
// RenderPassDescriptor directly.
|
||||||
class RenderPassDescriptorBuilder : public Builder<RenderPassDescriptorBase> {
|
class RenderPassDescriptorBuilder : public Builder<RenderPassDescriptorBase> {
|
||||||
public:
|
public:
|
||||||
RenderPassDescriptorBuilder(DeviceBase* device);
|
RenderPassDescriptorBuilder(DeviceBase* device);
|
||||||
|
|
||||||
// Dawn API
|
// Dawn API
|
||||||
RenderPassDescriptorBase* GetResultImpl() override;
|
RenderPassDescriptorBase* GetResultImpl() override;
|
||||||
void SetColorAttachment(uint32_t attachment,
|
void SetColorAttachments(uint32_t count,
|
||||||
TextureViewBase* textureView,
|
const RenderPassColorAttachmentDescriptor* attachments);
|
||||||
dawn::LoadOp loadOp);
|
void SetDepthStencilAttachment(
|
||||||
void SetColorAttachmentClearColor(uint32_t attachment,
|
const RenderPassDepthStencilAttachmentDescriptor* attachment);
|
||||||
float clearR,
|
|
||||||
float clearG,
|
|
||||||
float clearB,
|
|
||||||
float clearA);
|
|
||||||
void SetDepthStencilAttachment(TextureViewBase* textureView,
|
|
||||||
dawn::LoadOp depthLoadOp,
|
|
||||||
dawn::LoadOp stencilLoadOp);
|
|
||||||
void SetDepthStencilAttachmentClearValue(float clearDepth, uint32_t clearStencil);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class RenderPassDescriptorBase;
|
friend class RenderPassDescriptorBase;
|
||||||
|
@ -728,11 +728,17 @@ TEST_P(BlendStateTest, IndependentBlendState) {
|
|||||||
renderTargetViews[i] = renderTargets[i].CreateDefaultTextureView();
|
renderTargetViews[i] = renderTargets[i].CreateDefaultTextureView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachments[4];
|
||||||
|
for (uint32_t i = 0; i < 4; ++i) {
|
||||||
|
colorAttachments[i].attachment = renderTargetViews[i];
|
||||||
|
colorAttachments[i].resolveTarget = nullptr;
|
||||||
|
colorAttachments[i].clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachments[i].loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachments[i].storeOp = dawn::StoreOp::Store;
|
||||||
|
}
|
||||||
|
|
||||||
dawn::RenderPassDescriptor renderpass = device.CreateRenderPassDescriptorBuilder()
|
dawn::RenderPassDescriptor renderpass = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, renderTargetViews[0], dawn::LoadOp::Clear)
|
.SetColorAttachments(4, colorAttachments)
|
||||||
.SetColorAttachment(1, renderTargetViews[1], dawn::LoadOp::Clear)
|
|
||||||
.SetColorAttachment(2, renderTargetViews[2], dawn::LoadOp::Clear)
|
|
||||||
.SetColorAttachment(3, renderTargetViews[3], dawn::LoadOp::Clear)
|
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
dawn::ShaderModule fsModule = utils::CreateShaderModule(device, dawn::ShaderStage::Fragment, R"(
|
dawn::ShaderModule fsModule = utils::CreateShaderModule(device, dawn::ShaderStage::Fragment, R"(
|
||||||
|
@ -53,9 +53,24 @@ class DepthStencilStateTest : public DawnTest {
|
|||||||
|
|
||||||
depthTextureView = depthTexture.CreateDefaultTextureView();
|
depthTextureView = depthTexture.CreateDefaultTextureView();
|
||||||
|
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = renderTargetView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
|
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
|
||||||
|
depthStencilAttachment.attachment = depthTextureView;
|
||||||
|
depthStencilAttachment.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment.clearStencil = 0;
|
||||||
|
depthStencilAttachment.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
renderpass = device.CreateRenderPassDescriptorBuilder()
|
renderpass = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, renderTargetView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.SetDepthStencilAttachment(depthTextureView, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
.SetDepthStencilAttachment(&depthStencilAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
vsModule = utils::CreateShaderModule(device, dawn::ShaderStage::Vertex, R"(
|
vsModule = utils::CreateShaderModule(device, dawn::ShaderStage::Vertex, R"(
|
||||||
|
@ -112,12 +112,16 @@ class RenderPassLoadOpTests : public DawnTest {
|
|||||||
|
|
||||||
// Tests clearing, loading, and drawing into color attachments
|
// Tests clearing, loading, and drawing into color attachments
|
||||||
TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
|
TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = renderTargetView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
|
|
||||||
// Part 1: clear once, check to make sure it's cleared
|
// Part 1: clear once, check to make sure it's cleared
|
||||||
|
|
||||||
auto renderPassClearZero = device.CreateRenderPassDescriptorBuilder()
|
auto renderPassClearZero = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, renderTargetView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.SetColorAttachmentClearColor(0, 0.0f, 0.0f, 0.0f, 0.0f)
|
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
auto commandsClearZeroBuilder = device.CreateCommandBufferBuilder();
|
auto commandsClearZeroBuilder = device.CreateCommandBufferBuilder();
|
||||||
@ -125,9 +129,10 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
|
|||||||
clearZeroPass.EndPass();
|
clearZeroPass.EndPass();
|
||||||
auto commandsClearZero = commandsClearZeroBuilder.GetResult();
|
auto commandsClearZero = commandsClearZeroBuilder.GetResult();
|
||||||
|
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachmentGreen = colorAttachment;
|
||||||
|
colorAttachmentGreen.clearColor = { 0.0f, 1.0f, 0.0f, 1.0f };
|
||||||
auto renderPassClearGreen = device.CreateRenderPassDescriptorBuilder()
|
auto renderPassClearGreen = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, renderTargetView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachmentGreen)
|
||||||
.SetColorAttachmentClearColor(0, 0.0f, 1.0f, 0.0f, 1.0f)
|
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
auto commandsClearGreenBuilder = device.CreateCommandBufferBuilder();
|
auto commandsClearGreenBuilder = device.CreateCommandBufferBuilder();
|
||||||
@ -142,9 +147,10 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
|
|||||||
EXPECT_TEXTURE_RGBA8_EQ(expectGreen.data(), renderTarget, 0, 0, kRTSize, kRTSize, 0, 0);
|
EXPECT_TEXTURE_RGBA8_EQ(expectGreen.data(), renderTarget, 0, 0, kRTSize, kRTSize, 0, 0);
|
||||||
|
|
||||||
// Part 2: draw a blue quad into the right half of the render target, and check result
|
// Part 2: draw a blue quad into the right half of the render target, and check result
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachmentLoad = colorAttachment;
|
||||||
|
colorAttachmentLoad.loadOp = dawn::LoadOp::Load;
|
||||||
auto renderPassLoad = device.CreateRenderPassDescriptorBuilder()
|
auto renderPassLoad = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, renderTargetView, dawn::LoadOp::Load)
|
.SetColorAttachments(1, &colorAttachmentLoad)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
dawn::CommandBuffer commandsLoad;
|
dawn::CommandBuffer commandsLoad;
|
||||||
|
@ -490,9 +490,14 @@ class TextureViewRenderingTest : public DawnTest {
|
|||||||
dawn::ShaderModule vsModule = CreateDefaultVertexShaderModule(device);
|
dawn::ShaderModule vsModule = CreateDefaultVertexShaderModule(device);
|
||||||
|
|
||||||
// Clear textureView with Red(255, 0, 0, 255) and render Green(0, 255, 0, 255) into it
|
// Clear textureView with Red(255, 0, 0, 255) and render Green(0, 255, 0, 255) into it
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = textureView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 1.0, 0.0, 0.0, 1.0 };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
dawn::RenderPassDescriptor renderPassInfo = device.CreateRenderPassDescriptorBuilder()
|
dawn::RenderPassDescriptor renderPassInfo = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, textureView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.SetColorAttachmentClearColor(0, 1.0, 0.0, 0.0, 1.0)
|
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
const char* oneColorFragmentShader = R"(
|
const char* oneColorFragmentShader = R"(
|
||||||
|
@ -149,8 +149,14 @@ TEST_F(CommandBufferValidationTest, TextureWithReadAndWriteUsage) {
|
|||||||
dawn::BindGroup bg = utils::MakeBindGroup(device, bgl, {{0, view}});
|
dawn::BindGroup bg = utils::MakeBindGroup(device, bgl, {{0, view}});
|
||||||
|
|
||||||
// Create the render pass that will use the texture as an output attachment
|
// Create the render pass that will use the texture as an output attachment
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = view;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Load;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
dawn::RenderPassDescriptor renderPass = device.CreateRenderPassDescriptorBuilder()
|
dawn::RenderPassDescriptor renderPass = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, view, dawn::LoadOp::Load)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
// Use the texture as both sampeld and output attachment in the same pass
|
// Use the texture as both sampeld and output attachment in the same pass
|
||||||
|
@ -62,15 +62,29 @@ TEST_F(RenderPassDescriptorValidationTest, OneAttachment) {
|
|||||||
// One color attachment
|
// One color attachment
|
||||||
{
|
{
|
||||||
dawn::TextureView color = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
dawn::TextureView color = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = color;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, color, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
// One depth-stencil attachment
|
// One depth-stencil attachment
|
||||||
{
|
{
|
||||||
dawn::TextureView depthStencil = Create2DAttachment(device, 1, 1, dawn::TextureFormat::D32FloatS8Uint);
|
dawn::TextureView depthStencil = Create2DAttachment(device, 1, 1, dawn::TextureFormat::D32FloatS8Uint);
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
|
||||||
|
depthStencilAttachment.attachment = depthStencil;
|
||||||
|
depthStencilAttachment.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment.clearStencil = 0;
|
||||||
|
depthStencilAttachment.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetDepthStencilAttachment(depthStencil, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
.SetDepthStencilAttachment(&depthStencilAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,58 +94,27 @@ TEST_F(RenderPassDescriptorValidationTest, ColorAttachmentOutOfBounds) {
|
|||||||
// For setting the color attachment, control case
|
// For setting the color attachment, control case
|
||||||
{
|
{
|
||||||
dawn::TextureView color = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
dawn::TextureView color = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachments[kMaxColorAttachments];
|
||||||
|
colorAttachments[kMaxColorAttachments - 1].attachment = color;
|
||||||
|
colorAttachments[kMaxColorAttachments - 1].resolveTarget = nullptr;
|
||||||
|
colorAttachments[kMaxColorAttachments - 1].clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachments[kMaxColorAttachments - 1].loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachments[kMaxColorAttachments - 1].storeOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(kMaxColorAttachments - 1, color, dawn::LoadOp::Clear)
|
.SetColorAttachments(kMaxColorAttachments, colorAttachments)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
// For setting the color attachment, OOB
|
// For setting the color attachment, OOB
|
||||||
{
|
{
|
||||||
dawn::TextureView color = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
dawn::TextureView color = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachments[kMaxColorAttachments + 1];
|
||||||
|
colorAttachments[kMaxColorAttachments].attachment = color;
|
||||||
|
colorAttachments[kMaxColorAttachments].resolveTarget = nullptr;
|
||||||
|
colorAttachments[kMaxColorAttachments].clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachments[kMaxColorAttachments].loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachments[kMaxColorAttachments].storeOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(kMaxColorAttachments, color, dawn::LoadOp::Clear)
|
.SetColorAttachments(kMaxColorAttachments + 1, colorAttachments)
|
||||||
.GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
dawn::TextureView color = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
|
||||||
// For setting the clear color, control case
|
|
||||||
{
|
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
|
||||||
.SetColorAttachment(0, color, dawn::LoadOp::Clear)
|
|
||||||
.SetColorAttachmentClearColor(kMaxColorAttachments - 1, 0.0f, 0.0f, 0.0f, 0.0f)
|
|
||||||
.GetResult();
|
|
||||||
}
|
|
||||||
// For setting the clear color, OOB
|
|
||||||
{
|
|
||||||
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
|
||||||
.SetColorAttachment(0, color, dawn::LoadOp::Clear)
|
|
||||||
.SetColorAttachmentClearColor(kMaxColorAttachments, 0.0f, 0.0f, 0.0f, 0.0f)
|
|
||||||
.GetResult();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test setting a clear value without an attachment and vice-versa is ok.
|
|
||||||
TEST_F(RenderPassDescriptorValidationTest, ClearAndAttachmentMismatchIsOk) {
|
|
||||||
dawn::TextureView color = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
|
||||||
|
|
||||||
// For cleared attachment 0 doesn't get a color, clear color for 1 is unused
|
|
||||||
{
|
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
|
||||||
.SetColorAttachment(0, color, dawn::LoadOp::Clear)
|
|
||||||
.SetColorAttachmentClearColor(1, 0.0f, 0.0f, 0.0f, 0.0f)
|
|
||||||
.GetResult();
|
|
||||||
}
|
|
||||||
// Clear depth stencil doesn't get values
|
|
||||||
{
|
|
||||||
dawn::TextureView depthStencil = Create2DAttachment(device, 1, 1, dawn::TextureFormat::D32FloatS8Uint);
|
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
|
||||||
.SetDepthStencilAttachment(depthStencil, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
|
||||||
.GetResult();
|
|
||||||
}
|
|
||||||
// Clear values for depth-stencil when it isn't used
|
|
||||||
{
|
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
|
||||||
.SetColorAttachment(0, color, dawn::LoadOp::Clear)
|
|
||||||
.SetDepthStencilAttachmentClearValue(0.0f, 0)
|
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,33 +124,82 @@ TEST_F(RenderPassDescriptorValidationTest, SizeMustMatch) {
|
|||||||
dawn::TextureView color1x1A = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
dawn::TextureView color1x1A = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
||||||
dawn::TextureView color1x1B = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
dawn::TextureView color1x1B = Create2DAttachment(device, 1, 1, dawn::TextureFormat::R8G8B8A8Unorm);
|
||||||
dawn::TextureView color2x2 = Create2DAttachment(device, 2, 2, dawn::TextureFormat::R8G8B8A8Unorm);
|
dawn::TextureView color2x2 = Create2DAttachment(device, 2, 2, dawn::TextureFormat::R8G8B8A8Unorm);
|
||||||
|
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment1x1A;
|
||||||
|
colorAttachment1x1A.attachment = color1x1A;
|
||||||
|
colorAttachment1x1A.resolveTarget = nullptr;
|
||||||
|
colorAttachment1x1A.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment1x1A.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment1x1A.storeOp = dawn::StoreOp::Store;
|
||||||
|
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment1x1B;
|
||||||
|
colorAttachment1x1B.attachment = color1x1B;
|
||||||
|
colorAttachment1x1B.resolveTarget = nullptr;
|
||||||
|
colorAttachment1x1B.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment1x1B.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment1x1B.storeOp = dawn::StoreOp::Store;
|
||||||
|
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment2x2;
|
||||||
|
colorAttachment2x2.attachment = color2x2;
|
||||||
|
colorAttachment2x2.resolveTarget = nullptr;
|
||||||
|
colorAttachment2x2.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment2x2.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment2x2.storeOp = dawn::StoreOp::Store;
|
||||||
|
|
||||||
dawn::TextureView depthStencil1x1 = Create2DAttachment(device, 1, 1, dawn::TextureFormat::D32FloatS8Uint);
|
dawn::TextureView depthStencil1x1 = Create2DAttachment(device, 1, 1, dawn::TextureFormat::D32FloatS8Uint);
|
||||||
dawn::TextureView depthStencil2x2 = Create2DAttachment(device, 2, 2, dawn::TextureFormat::D32FloatS8Uint);
|
dawn::TextureView depthStencil2x2 = Create2DAttachment(device, 2, 2, dawn::TextureFormat::D32FloatS8Uint);
|
||||||
|
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment1x1;
|
||||||
|
depthStencilAttachment1x1.attachment = depthStencil1x1;
|
||||||
|
depthStencilAttachment1x1.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment1x1.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment1x1.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment1x1.clearStencil = 0;
|
||||||
|
depthStencilAttachment1x1.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment1x1.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
|
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment2x2;
|
||||||
|
depthStencilAttachment2x2.attachment = depthStencil2x2;
|
||||||
|
depthStencilAttachment2x2.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment2x2.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment2x2.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment2x2.clearStencil = 0;
|
||||||
|
depthStencilAttachment2x2.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment2x2.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
|
|
||||||
// Control case: all the same size (1x1)
|
// Control case: all the same size (1x1)
|
||||||
{
|
{
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachments[2];
|
||||||
|
colorAttachments[0] = colorAttachment1x1A;
|
||||||
|
colorAttachments[1] = colorAttachment1x1B;
|
||||||
|
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, color1x1A, dawn::LoadOp::Clear)
|
.SetColorAttachments(2, colorAttachments)
|
||||||
.SetColorAttachment(1, color1x1B, dawn::LoadOp::Clear)
|
.SetDepthStencilAttachment(&depthStencilAttachment1x1)
|
||||||
.SetDepthStencilAttachment(depthStencil1x1, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
// One of the color attachments has a different size
|
// One of the color attachments has a different size
|
||||||
{
|
{
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachments[2];
|
||||||
|
colorAttachments[0] = colorAttachment1x1A;
|
||||||
|
colorAttachments[1] = colorAttachment2x2;
|
||||||
|
|
||||||
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, color1x1A, dawn::LoadOp::Clear)
|
.SetColorAttachments(2, colorAttachments)
|
||||||
.SetColorAttachment(1, color2x2, dawn::LoadOp::Clear)
|
.SetDepthStencilAttachment(&depthStencilAttachment1x1)
|
||||||
.SetDepthStencilAttachment(depthStencil1x1, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
// The depth stencil attachment has a different size
|
// The depth stencil attachment has a different size
|
||||||
{
|
{
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachments[2];
|
||||||
|
colorAttachments[0] = colorAttachment1x1A;
|
||||||
|
colorAttachments[1] = colorAttachment1x1B;
|
||||||
|
|
||||||
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, color1x1A, dawn::LoadOp::Clear)
|
.SetColorAttachments(2, colorAttachments)
|
||||||
.SetColorAttachment(1, color1x1B, dawn::LoadOp::Clear)
|
.SetDepthStencilAttachment(&depthStencilAttachment2x2)
|
||||||
.SetDepthStencilAttachment(depthStencil2x2, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -179,15 +211,30 @@ TEST_F(RenderPassDescriptorValidationTest, FormatMismatch) {
|
|||||||
|
|
||||||
// Using depth-stencil for color
|
// Using depth-stencil for color
|
||||||
{
|
{
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = depthStencil;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
|
|
||||||
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, depthStencil, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Using color for depth-stencil
|
// Using color for depth-stencil
|
||||||
{
|
{
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
|
||||||
|
depthStencilAttachment.attachment = color;
|
||||||
|
depthStencilAttachment.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment.clearStencil = 0;
|
||||||
|
depthStencilAttachment.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetDepthStencilAttachment(color, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
.SetDepthStencilAttachment(&depthStencilAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -222,8 +269,15 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth
|
|||||||
descriptor.layerCount = 5;
|
descriptor.layerCount = 5;
|
||||||
|
|
||||||
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = colorTextureView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
|
|
||||||
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, colorTextureView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,8 +288,16 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth
|
|||||||
descriptor.layerCount = 5;
|
descriptor.layerCount = 5;
|
||||||
|
|
||||||
dawn::TextureView depthStencilView = depthStencilTexture.CreateTextureView(&descriptor);
|
dawn::TextureView depthStencilView = depthStencilTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
|
||||||
|
depthStencilAttachment.attachment = depthStencilView;
|
||||||
|
depthStencilAttachment.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment.clearStencil = 0;
|
||||||
|
depthStencilAttachment.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetDepthStencilAttachment(depthStencilView, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
.SetDepthStencilAttachment(&depthStencilAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,8 +309,14 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth
|
|||||||
descriptor.layerCount = 1;
|
descriptor.layerCount = 1;
|
||||||
|
|
||||||
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = colorTextureView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, colorTextureView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,9 +329,16 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth
|
|||||||
|
|
||||||
dawn::TextureView depthStencilTextureView =
|
dawn::TextureView depthStencilTextureView =
|
||||||
depthStencilTexture.CreateTextureView(&descriptor);
|
depthStencilTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
|
||||||
|
depthStencilAttachment.attachment = depthStencilTextureView;
|
||||||
|
depthStencilAttachment.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment.clearStencil = 0;
|
||||||
|
depthStencilAttachment.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetDepthStencilAttachment(
|
.SetDepthStencilAttachment(&depthStencilAttachment)
|
||||||
depthStencilTextureView, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,8 +350,14 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth
|
|||||||
descriptor.layerCount = 1;
|
descriptor.layerCount = 1;
|
||||||
|
|
||||||
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = colorTextureView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, colorTextureView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,9 +370,16 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLayerCountForColorAndDepth
|
|||||||
|
|
||||||
dawn::TextureView depthStencilTextureView =
|
dawn::TextureView depthStencilTextureView =
|
||||||
depthStencilTexture.CreateTextureView(&descriptor);
|
depthStencilTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
|
||||||
|
depthStencilAttachment.attachment = depthStencilTextureView;
|
||||||
|
depthStencilAttachment.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment.clearStencil = 0;
|
||||||
|
depthStencilAttachment.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetDepthStencilAttachment(
|
.SetDepthStencilAttachment(&depthStencilAttachment)
|
||||||
depthStencilTextureView, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -325,8 +413,14 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth
|
|||||||
descriptor.levelCount = 2;
|
descriptor.levelCount = 2;
|
||||||
|
|
||||||
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = colorTextureView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, colorTextureView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,8 +431,16 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth
|
|||||||
descriptor.levelCount = 2;
|
descriptor.levelCount = 2;
|
||||||
|
|
||||||
dawn::TextureView depthStencilView = depthStencilTexture.CreateTextureView(&descriptor);
|
dawn::TextureView depthStencilView = depthStencilTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
|
||||||
|
depthStencilAttachment.attachment = depthStencilView;
|
||||||
|
depthStencilAttachment.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment.clearStencil = 0;
|
||||||
|
depthStencilAttachment.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetDepthStencilAttachment(depthStencilView, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
.SetDepthStencilAttachment(&depthStencilAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,8 +452,14 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth
|
|||||||
descriptor.levelCount = 1;
|
descriptor.levelCount = 1;
|
||||||
|
|
||||||
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = colorTextureView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, colorTextureView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,9 +472,16 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth
|
|||||||
|
|
||||||
dawn::TextureView depthStencilTextureView =
|
dawn::TextureView depthStencilTextureView =
|
||||||
depthStencilTexture.CreateTextureView(&descriptor);
|
depthStencilTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
|
||||||
|
depthStencilAttachment.attachment = depthStencilTextureView;
|
||||||
|
depthStencilAttachment.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment.clearStencil = 0;
|
||||||
|
depthStencilAttachment.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetDepthStencilAttachment(
|
.SetDepthStencilAttachment(&depthStencilAttachment)
|
||||||
depthStencilTextureView, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,8 +493,14 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth
|
|||||||
descriptor.levelCount = 1;
|
descriptor.levelCount = 1;
|
||||||
|
|
||||||
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
dawn::TextureView colorTextureView = colorTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = colorTextureView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, colorTextureView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,9 +513,48 @@ TEST_F(RenderPassDescriptorValidationTest, TextureViewLevelCountForColorAndDepth
|
|||||||
|
|
||||||
dawn::TextureView depthStencilTextureView =
|
dawn::TextureView depthStencilTextureView =
|
||||||
depthStencilTexture.CreateTextureView(&descriptor);
|
depthStencilTexture.CreateTextureView(&descriptor);
|
||||||
|
dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
|
||||||
|
depthStencilAttachment.attachment = depthStencilTextureView;
|
||||||
|
depthStencilAttachment.depthLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.stencilLoadOp = dawn::LoadOp::Clear;
|
||||||
|
depthStencilAttachment.clearDepth = 1.0f;
|
||||||
|
depthStencilAttachment.clearStencil = 0;
|
||||||
|
depthStencilAttachment.depthStoreOp = dawn::StoreOp::Store;
|
||||||
|
depthStencilAttachment.stencilStoreOp = dawn::StoreOp::Store;
|
||||||
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetDepthStencilAttachment(
|
.SetDepthStencilAttachment(&depthStencilAttachment)
|
||||||
depthStencilTextureView, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
.GetResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tests on the resolve target of RenderPassColorAttachmentDescriptor.
|
||||||
|
// TODO(jiawei.shao@intel.com): add more tests when we support multisample color attachments.
|
||||||
|
TEST_F(RenderPassDescriptorValidationTest, ResolveTarget) {
|
||||||
|
constexpr uint32_t kArrayLayers = 1;
|
||||||
|
constexpr uint32_t kSize = 32;
|
||||||
|
constexpr dawn::TextureFormat kColorFormat = dawn::TextureFormat::R8G8B8A8Unorm;
|
||||||
|
|
||||||
|
constexpr uint32_t kLevelCount = 1;
|
||||||
|
|
||||||
|
dawn::Texture colorTexture = CreateTexture(
|
||||||
|
device, dawn::TextureDimension::e2D, kColorFormat, kSize, kSize, kArrayLayers, kLevelCount);
|
||||||
|
|
||||||
|
dawn::Texture resolveTexture = CreateTexture(
|
||||||
|
device, dawn::TextureDimension::e2D, kColorFormat, kSize, kSize, kArrayLayers, kLevelCount);
|
||||||
|
|
||||||
|
// It is not allowed to set resolve target when the sample count of the color attachment is 1.
|
||||||
|
{
|
||||||
|
dawn::TextureView colorTextureView = colorTexture.CreateDefaultTextureView();
|
||||||
|
dawn::TextureView resolveTargetTextureView = resolveTexture.CreateDefaultTextureView();
|
||||||
|
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = colorTextureView;
|
||||||
|
colorAttachment.resolveTarget = resolveTargetTextureView;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,9 +87,14 @@ dawn::RenderPassDescriptor ValidationTest::CreateSimpleRenderPass() {
|
|||||||
|
|
||||||
auto colorBuffer = device.CreateTexture(&descriptor);
|
auto colorBuffer = device.CreateTexture(&descriptor);
|
||||||
auto colorView = colorBuffer.CreateDefaultTextureView();
|
auto colorView = colorBuffer.CreateDefaultTextureView();
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = colorView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
return device.CreateRenderPassDescriptorBuilder()
|
return device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, colorView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,9 +146,14 @@ ValidationTest::DummyRenderPass ValidationTest::CreateDummyRenderPass() {
|
|||||||
dummy.attachment = device.CreateTexture(&descriptor);
|
dummy.attachment = device.CreateTexture(&descriptor);
|
||||||
|
|
||||||
dawn::TextureView view = dummy.attachment.CreateDefaultTextureView();
|
dawn::TextureView view = dummy.attachment.CreateDefaultTextureView();
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = view;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
dummy.renderPass = AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
dummy.renderPass = AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, view, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
return dummy;
|
return dummy;
|
||||||
|
@ -147,8 +147,14 @@ namespace utils {
|
|||||||
result.color = device.CreateTexture(&descriptor);
|
result.color = device.CreateTexture(&descriptor);
|
||||||
|
|
||||||
dawn::TextureView colorView = result.color.CreateDefaultTextureView();
|
dawn::TextureView colorView = result.color.CreateDefaultTextureView();
|
||||||
|
dawn::RenderPassColorAttachmentDescriptor colorAttachment;
|
||||||
|
colorAttachment.attachment = colorView;
|
||||||
|
colorAttachment.resolveTarget = nullptr;
|
||||||
|
colorAttachment.clearColor = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
|
colorAttachment.loadOp = dawn::LoadOp::Clear;
|
||||||
|
colorAttachment.storeOp = dawn::StoreOp::Store;
|
||||||
result.renderPassInfo = device.CreateRenderPassDescriptorBuilder()
|
result.renderPassInfo = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, colorView, dawn::LoadOp::Clear)
|
.SetColorAttachments(1, &colorAttachment)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user