From 54fc1b26bcc714f72ab867e11bee53b2235603f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 15 Oct 2015 20:38:00 -0700 Subject: [PATCH] Added blit debug check. --- src/bgfx_p.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 9913ed63..db33dfd1 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -3612,6 +3612,14 @@ namespace bgfx BGFX_API_FUNC(void blit(uint8_t _id, TextureHandle _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, TextureHandle _src, uint8_t _srcMip, uint16_t _srcX, uint16_t _srcY, uint16_t _srcZ, uint16_t _width, uint16_t _height, uint16_t _depth) ) { + const TextureRef& src = m_textureRef[_src.idx]; + const TextureRef& dst = m_textureRef[_dst.idx]; + BX_CHECK(src.m_format == dst.m_format + , "Texture format must match (src %s, dst %s)." + , bgfx::getName(TextureFormat::Enum(src.m_format) ) + , bgfx::getName(TextureFormat::Enum(dst.m_format) ) + ); + BX_UNUSED(src, dst); m_submit->blit(_id, _dst, _dstMip, _dstX, _dstY, _dstZ, _src, _srcMip, _srcX, _srcY, _srcZ, _width, _height, _depth); }