From a819a3f73e37ce5758fbf00f17aff9f4aaec2eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 5 Mar 2015 19:31:20 -0800 Subject: [PATCH] Added error check for use of TextureFormat::BGRA8 in compute. --- src/bgfx_p.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index eaa5c1c5..166d19c5 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -3260,6 +3260,9 @@ namespace bgfx BGFX_API_FUNC(void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format) ) { _format = TextureFormat::Count == _format ? TextureFormat::Enum(m_textureRef[_handle.idx].m_format) : _format; + BX_CHECK(_format != TextureFormat::BGRA8 + , "Can't use TextureFormat::BGRA8 with compute, use TextureFormat::RGBA8 instead." + ); m_submit->setImage(_stage, _sampler, _handle, _mip, _access, _format); }