浏览代码

error if a volume texture is created with a depth/stencil pixel format.

Sasha Szpakowski 1 年之前
父节点
当前提交
679f3bdaa9
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/modules/graphics/Texture.cpp

+ 3 - 0
src/modules/graphics/Texture.cpp

@@ -287,6 +287,9 @@ Texture::Texture(Graphics *gfx, const Settings &settings, const Slices *slices)
 	if (isPixelFormatDepthStencil(format) && !renderTarget)
 	if (isPixelFormatDepthStencil(format) && !renderTarget)
 		throw love::Exception("Depth or stencil pixel formats are only supported with render target textures.");
 		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)
 	for (PixelFormat viewformat : viewFormats)
 	{
 	{
 		if (getLinearPixelFormat(viewformat) == getLinearPixelFormat(format))
 		if (getLinearPixelFormat(viewformat) == getLinearPixelFormat(format))