Reallocate the vertices vector for dynamic draw call when resize
This commit is contained in:
parent
feb1667acc
commit
e5fff9e65a
@ -18,7 +18,6 @@
|
||||
|
||||
#include "graphics/cpu_particle_manager.hpp"
|
||||
#include "graphics/stk_particle.hpp"
|
||||
#include "graphics/sp/sp_base.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/material.hpp"
|
||||
#include "graphics/material_manager.hpp"
|
||||
@ -199,7 +198,6 @@ void CPUParticleManager::generateAll()
|
||||
// ----------------------------------------------------------------------------
|
||||
void CPUParticleManager::uploadAll()
|
||||
{
|
||||
using namespace SP;
|
||||
for (auto& p : m_particles_generated)
|
||||
{
|
||||
if (p.second.empty())
|
||||
|
@ -108,6 +108,7 @@ public:
|
||||
{
|
||||
m_update_offset = 0;
|
||||
m_gl_vbo_size = new_size;
|
||||
m_vertices.reserve(m_gl_vbo_size);
|
||||
glBufferData(GL_ARRAY_BUFFER, m_gl_vbo_size * 48,
|
||||
m_vertices.data(), GL_DYNAMIC_DRAW);
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ void SPShader::addAllTextures(RenderPass rp)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
const unsigned i = m_prefilled_samplers[rp].size();
|
||||
const unsigned i = (unsigned)m_prefilled_samplers[rp].size();
|
||||
glUniform1i(loc, i);
|
||||
#ifdef USE_GLES2
|
||||
m_prefilled_samplers[rp].emplace_back(i, p.first, p.second.second,
|
||||
@ -153,7 +153,8 @@ void SPShader::addCustomPrefilledTextures(SamplerType st, GLuint texture_type,
|
||||
" files.", s);
|
||||
return;
|
||||
}
|
||||
const unsigned i = m_samplers[rp].size() + m_prefilled_samplers[rp].size();
|
||||
const unsigned i =
|
||||
unsigned(m_samplers[rp].size() + m_prefilled_samplers[rp].size());
|
||||
glUniform1i(loc, i);
|
||||
m_prefilled_samplers[rp].emplace_back(i, name, st, texture_type);
|
||||
m_custom_prefilled_getter[rp][name] = func;
|
||||
|
Loading…
x
Reference in New Issue
Block a user