summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/src/bgfx.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/src/bgfx.cpp')
-rw-r--r--3rdparty/bgfx/src/bgfx.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp
index 5da3c5609b7..a6c60aaa499 100644
--- a/3rdparty/bgfx/src/bgfx.cpp
+++ b/3rdparty/bgfx/src/bgfx.cpp
@@ -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)