Skip to content

Commit 5fb9827

Browse files
author
Dmitry Kolzov
committed
Optimize buffer recreations
1 parent 1a3f18e commit 5fb9827

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

App/Renderers/PT/ptrenderer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,9 @@ namespace Baikal
322322
if (output)
323323
{
324324
auto current_output = FindFirstNonZeroOutput();
325+
auto required_size = output->width() * output->height();
325326

326-
if (!current_output || current_output->width() < output->width() || current_output->height() < output->height())
327+
if (required_size > m_render_data->paths.GetElementCount())
327328
{
328329
ResizeWorkingSet(*output);
329330
}

App/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ void InitGraphics()
256256
{
257257
g_shader_manager.reset(new ShaderManager());
258258

259-
glClearColor(0.0, 0.5, 0.0, 0.0);CHECK_GL_ERROR;
259+
glGetError();
260+
glClearColor(0.0, 0.5, 0.0, 0.0); CHECK_GL_ERROR;
260261
glDisable(GL_DEPTH_TEST);CHECK_GL_ERROR;
261262

262263
glGenBuffers(1, &g_vertex_buffer);CHECK_GL_ERROR;

0 commit comments

Comments
 (0)