mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Added check for texture flag missuse.
This commit is contained in:
@@ -2905,9 +2905,13 @@ namespace bgfx
|
||||
_height = bx::uint16_max(1, _height);
|
||||
}
|
||||
|
||||
TextureHandle createTexture2D(BackbufferRatio::Enum _ratio, uint16_t _width, uint16_t _height, uint8_t _numMips, TextureFormat::Enum _format, uint32_t _flags, const Memory* _mem)
|
||||
static TextureHandle createTexture2D(BackbufferRatio::Enum _ratio, uint16_t _width, uint16_t _height, uint8_t _numMips, TextureFormat::Enum _format, uint32_t _flags, const Memory* _mem)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
|
||||
BX_CHECK(0 == (_flags & BGFX_TEXTURE_RT_MASK) || 0 == (_flags & BGFX_TEXTURE_READ_BACK)
|
||||
, "Can't create render target with BGFX_TEXTURE_READ_BACK flag."
|
||||
);
|
||||
BX_CHECK(0 != (g_caps.formats[_format] & (BGFX_CAPS_FORMAT_TEXTURE_2D|BGFX_CAPS_FORMAT_TEXTURE_2D_EMULATED|BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB) )
|
||||
, "Format %s is not supported for 2D texture. Use bgfx::getCaps to check available texture formats."
|
||||
, getName(_format)
|
||||
|
||||
Reference in New Issue
Block a user