mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +00:00
Add tests for clears, render passes, framebuffers (#107)
* Add tests for clears, render passes, framebuffers * Test load with a draw in it
This commit is contained in:
@@ -103,19 +103,10 @@ namespace backend {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// TODO(kainino@chromium.org): Remove this flag when the
|
||||
// null=backbuffer hack is removed. Then, using null texture views can
|
||||
// be completely disallowed.
|
||||
bool usingBackbufferHack = false;
|
||||
for (auto& textureView : textureViews) {
|
||||
if (!textureView) {
|
||||
if (usingBackbufferHack) {
|
||||
// TODO(kainino@chromium.org) update this too
|
||||
HandleError("Framebuffer has more than one null attachment");
|
||||
return nullptr;
|
||||
}
|
||||
usingBackbufferHack = true;
|
||||
continue;
|
||||
HandleError("Framebuffer attachment not set");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// TODO(cwallez@chromium.org): Adjust for the mip-level once that is supported.
|
||||
|
||||
@@ -94,6 +94,23 @@ namespace backend {
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& subpass : subpasses) {
|
||||
for (unsigned int location : IterateBitSet(subpass.colorAttachmentsSet)) {
|
||||
uint32_t slot = subpass.colorAttachments[location];
|
||||
if (TextureFormatHasDepthOrStencil(attachments[slot].format)) {
|
||||
HandleError("Render pass color attachment is not of a color format");
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
if (subpass.depthStencilAttachmentSet) {
|
||||
uint32_t slot = subpass.depthStencilAttachment;
|
||||
if (!TextureFormatHasDepthOrStencil(attachments[slot].format)) {
|
||||
HandleError("Render pass depth/stencil attachment is not of a depth/stencil format");
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return device->CreateRenderPass(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +97,11 @@ namespace opengl {
|
||||
{
|
||||
commands.NextCommand<BeginRenderSubpassCmd>();
|
||||
|
||||
// TODO(kainino@chromium.org): This is added to possibly
|
||||
// work around an issue seen on Windows/Intel. It should
|
||||
// break any feedback loop before the clears, even if
|
||||
// there shouldn't be any negative effects from this.
|
||||
// Investigate whether it's actually needed.
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
// TODO(kainino@chromium.org): possible future
|
||||
// optimization: create these framebuffers at
|
||||
|
||||
Reference in New Issue
Block a user