Skip to content

Commit

Permalink
Fix missing depth formats in love.graphics.getTextureFormats.
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Apr 13, 2024
1 parent 59e18df commit c5feaa3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/modules/graphics/wrap_Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion testing/tests/graphics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c5feaa3

Please sign in to comment.