mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 10:35:43 -05:00
GL: Prevent memory stomp when shader has more samplers than allowed. Issue #704.
This commit is contained in:
parent
a3501ff77d
commit
1fa80e7478
1 changed files with 13 additions and 3 deletions
|
@ -3706,9 +3706,19 @@ namespace bgfx { namespace gl
|
|||
case GL_IMAGE_CUBE:
|
||||
case GL_INT_IMAGE_CUBE:
|
||||
case GL_UNSIGNED_INT_IMAGE_CUBE:
|
||||
if (m_numSamplers < BX_COUNTOF(m_sampler) )
|
||||
{
|
||||
BX_TRACE("Sampler #%d at location %d.", m_numSamplers, loc);
|
||||
m_sampler[m_numSamplers] = loc;
|
||||
m_numSamplers++;
|
||||
}
|
||||
else
|
||||
{
|
||||
BX_TRACE("Too many samplers (max: %d)! Sampler at location %d."
|
||||
, BX_COUNTOF(m_sampler)
|
||||
, loc
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue