16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 12:19:19 +02:00

perf window

This commit is contained in:
milek7
2019-03-27 23:13:51 +01:00
parent aa8d66e5da
commit 803bf23715
7 changed files with 134 additions and 8 deletions

View File

@@ -98,12 +98,21 @@ void render_task::upload()
{
if (m_target->image)
{
static bool width = 0;
glBindTexture(GL_TEXTURE_2D, m_target->shared_tex);
glTexImage2D(
GL_TEXTURE_2D, 0,
m_target->format,
m_target->width, m_target->height, 0,
m_target->components, GL_UNSIGNED_BYTE, m_target->image);
if (!width != m_target->width) {
glTexImage2D(
GL_TEXTURE_2D, 0,
m_target->format,
m_target->width, m_target->height, 0,
m_target->components, GL_UNSIGNED_BYTE, m_target->image);
width = m_target->width;
}
else {
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_target->width, m_target->height, m_target->components, GL_UNSIGNED_BYTE, m_target->image);
}
if (Global.python_mipmaps)
{