|
|
@@ -2555,7 +2555,6 @@ namespace bgfx
|
|
|
}
|
|
|
|
|
|
m_numPredefined = 0;
|
|
|
- m_constantBuffer = ConstantBuffer::create(1024);
|
|
|
m_numSamplers = 0;
|
|
|
|
|
|
struct VariableInfo
|
|
|
@@ -2653,6 +2652,11 @@ namespace bgfx
|
|
|
const UniformInfo* info = s_renderGL->m_uniformReg.find(name);
|
|
|
if (NULL != info)
|
|
|
{
|
|
|
+ if (NULL == m_constantBuffer)
|
|
|
+ {
|
|
|
+ m_constantBuffer = ConstantBuffer::create(1024);
|
|
|
+ }
|
|
|
+
|
|
|
UniformType::Enum type = convertGlType(gltype);
|
|
|
m_constantBuffer->writeUniformHandle(type, 0, info->m_handle, num);
|
|
|
m_constantBuffer->write(loc);
|
|
|
@@ -2671,6 +2675,11 @@ namespace bgfx
|
|
|
BX_UNUSED(offset);
|
|
|
}
|
|
|
|
|
|
+ if (NULL != m_constantBuffer)
|
|
|
+ {
|
|
|
+ m_constantBuffer->finish();
|
|
|
+ }
|
|
|
+
|
|
|
if (s_extension[Extension::ARB_program_interface_query].m_supported
|
|
|
|| BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 31) )
|
|
|
{
|
|
|
@@ -2710,8 +2719,6 @@ namespace bgfx
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- m_constantBuffer->finish();
|
|
|
-
|
|
|
memset(m_attributes, 0xff, sizeof(m_attributes) );
|
|
|
uint32_t used = 0;
|
|
|
for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
|