diff --git a/test/fixtures/offscreen_texture/clear-render-pass-color/expected.png b/test/fixtures/offscreen_texture/clear-render-pass-color/expected.png new file mode 100644 index 000000000..89d7feace Binary files /dev/null and b/test/fixtures/offscreen_texture/clear-render-pass-color/expected.png differ diff --git a/test/util/offscreen_texture.test.cpp b/test/util/offscreen_texture.test.cpp index ae56b347a..78cf7cef6 100644 --- a/test/util/offscreen_texture.test.cpp +++ b/test/util/offscreen_texture.test.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -180,3 +181,18 @@ void main() { image = backend.readStillImage(); test::checkImage("test/fixtures/offscreen_texture/render-to-fbo-composited", image, 0, 0.1); } + +TEST(OffscreenTexture, ClearRenderPassColor) { + auto backend = gfx::HeadlessBackend::Create({ 128, 256 }); + gfx::BackendScope scope { *backend->getRendererBackend() }; + auto& context = backend->getRendererBackend()->getContext(); + auto encoder = context.createCommandEncoder(); + auto offscreenTexture = context.createOffscreenTexture({ 128, 256 }); + auto renderPass = encoder->createRenderPass( + "offscreen texture", { *offscreenTexture, Color{ 1.0f, 0.0f, 0.0f, 1.0f }, {}, {} }); + renderPass.reset(); + encoder.reset(); + + auto image = offscreenTexture->readStillImage(); + test::checkImage("test/fixtures/offscreen_texture/clear-render-pass-color", image, 0, 0); +}