Move OpenGL texture upload mapping

This commit is contained in:
2026-06-01 17:46:48 +02:00
parent 9ab73a0354
commit 2754df9f46
7 changed files with 56 additions and 11 deletions

View File

@@ -3,6 +3,9 @@
#include "rtt.h"
#include "util.h"
#include "app.h"
#include "renderer_gl/opengl_capabilities.h"
#include <cstdint>
RTT& RTT::operator=(RTT&& other)
{
@@ -204,9 +207,8 @@ bool RTT::create(int width, int height, int tex/* = -1*/, GLint internal_format,
texID = tex;
}
auto ifmt = GL_UNSIGNED_BYTE;
if (internal_format == GL_RGBA32F) ifmt = GL_FLOAT;
if (internal_format == GL_RGBA16F) ifmt = GL_HALF_FLOAT;
const auto ifmt = static_cast<GLenum>(
pp::renderer::gl::texture_upload_type_for_internal_format(static_cast<std::uint32_t>(internal_format)));
glBindTexture(GL_TEXTURE_2D, texID);
if (tex == -1)