GL: Clamp number of MRT targets.

This commit is contained in:
Branimir Karadžić 2018-04-15 07:56:07 -07:00
parent 789c2f0dde
commit 27e8c94e0f

View File

@ -2331,7 +2331,9 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
|| s_extension[Extension::EXT_draw_buffers ].m_supported
|| s_extension[Extension::WEBGL_draw_buffers].m_supported)
{
g_caps.limits.maxFBAttachments = uint8_t(bx::uint32_min(glGet(GL_MAX_DRAW_BUFFERS)
g_caps.limits.maxFBAttachments = uint8_t(bx::uint32_clamp(
glGet(GL_MAX_DRAW_BUFFERS)
, 1
, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS)
);
}