Browse Source

Fix missing depth formats in love.graphics.getTextureFormats.

Sasha Szpakowski 1 year ago
parent
commit
c5feaa3dfa
2 changed files with 2 additions and 4 deletions
  1. 0 3
      src/modules/graphics/wrap_Graphics.cpp
  2. 2 1
      testing/tests/graphics.lua

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

@@ -2937,9 +2937,6 @@ int w_getTextureFormats(lua_State *L)
 		if (format == PIXELFORMAT_UNKNOWN || !love::getConstant(format, name))
 			continue;
 
-		if (rt && isPixelFormatDepth(format))
-			continue;
-
 		uint32 usage = PIXELFORMATUSAGEFLAGS_NONE;
 		if (rt)
 			usage |= PIXELFORMATUSAGEFLAGS_RENDERTARGET;

+ 2 - 1
testing/tests/graphics.lua

@@ -2761,7 +2761,8 @@ love.test.graphics.getTextureFormats = function(test)
     'rg11b10f', 'ASTC10x8', 'ASTC10x10', 'ASTC12x10', 'ASTC12x12', 'normal',
     'srgba8', 'la8', 'ASTC10x6', 'ASTC8x8', 'ASTC6x6', 'ASTC5x5', 'EACrgs',
     'EACrs', 'ETC2rgba1', 'ETC2rgb', 'PVR1rgba4', 'PVR1rgb4', 'BC6h',
-    'BC5', 'BC4', 'DXT3', 'stencil8', 'rgba16ui', 'bgra8srgb'
+    'BC5', 'BC4', 'DXT3', 'rgba16ui', 'bgra8srgb',
+    'depth16', 'depth24', 'depth32f', 'depth24stencil8', 'depth32fstencil8', 'stencil8'
   }
   local supported = love.graphics.getTextureFormats({ canvas = true })
   test:assertNotNil(supported)