From 679f3bdaa9335b6cfe59bce19c7950ad8855b4a1 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Tue, 16 Jul 2024 16:46:59 -0300 Subject: [PATCH] error if a volume texture is created with a depth/stencil pixel format. --- src/modules/graphics/Texture.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/graphics/Texture.cpp b/src/modules/graphics/Texture.cpp index 1cb91dbc7..dde61a53a 100644 --- a/src/modules/graphics/Texture.cpp +++ b/src/modules/graphics/Texture.cpp @@ -287,6 +287,9 @@ Texture::Texture(Graphics *gfx, const Settings &settings, const Slices *slices) if (isPixelFormatDepthStencil(format) && !renderTarget) throw love::Exception("Depth or stencil pixel formats are only supported with render target textures."); + if (isPixelFormatDepthStencil(format) && texType == TEXTURE_VOLUME) + throw love::Exception("Volume texture types are not supported with depth or stencil pixel formats."); + for (PixelFormat viewformat : viewFormats) { if (getLinearPixelFormat(viewformat) == getLinearPixelFormat(format))