This commit is contained in:
Branimir Karadžić 2018-01-18 20:29:10 -08:00
parent 55427f424c
commit 8a3d42d0b9

View File

@ -3067,6 +3067,7 @@ error:
void Encoder::setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags)
{
BGFX_CHECK_HANDLE("setTexture/UniformHandle", s_ctx->m_uniformHandle, _sampler);
BGFX_CHECK_HANDLE_INVALID_OK("setTexture/TextureHandle", s_ctx->m_textureHandle, _handle);
BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
BGFX_ENCODER(setTexture(_stage, _sampler, _handle, _flags) );
@ -3145,6 +3146,8 @@ error:
void Encoder::setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
{
BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
BGFX_CHECK_HANDLE("setImage/UniformHandle", s_ctx->m_uniformHandle, _sampler);
BGFX_CHECK_HANDLE_INVALID_OK("setImage/TextureHandle", s_ctx->m_textureHandle, _handle);
_format = TextureFormat::Count == _format
? TextureFormat::Enum(s_ctx->m_textureRef[_handle.idx].m_format)
: _format