From bee8d16427b1c2cfe35e7739702c15a1ba2447a9 Mon Sep 17 00:00:00 2001 From: bjorn Date: Sat, 21 Jan 2023 12:16:35 -0800 Subject: [PATCH] Add error when render pass/texture sample counts don't match; --- src/modules/graphics/graphics.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/graphics/graphics.c b/src/modules/graphics/graphics.c index 92709b8b..29d3060d 100644 --- a/src/modules/graphics/graphics.c +++ b/src/modules/graphics/graphics.c @@ -3309,6 +3309,7 @@ Pass* lovrGraphicsGetPass(PassInfo* info) { lovrCheck(texture->height == t->height, "Render pass texture sizes must match"); lovrCheck(texture->layers == t->layers, "Render pass texture layer counts must match"); lovrCheck(texture->samples == t->samples, "Render pass texture sample counts must match"); + lovrCheck(texture->samples == 1 || texture->samples == canvas->samples, "Render pass texture sample count must be 1 or match the pass sample count"); lovrCheck(!canvas->mipmap || texture->mipmaps == 1 || texture->usage & TEXTURE_TRANSFER, "Texture must have 'transfer' flag to mipmap it after a pass"); lovrCheck(canvas->samples == 1 || texture->samples > 1 || canvas->loads[i] != LOAD_KEEP, "When doing multisample resolves to a texture, it must be cleared"); }