Route RTT texture updates through GL backend

This commit is contained in:
2026-06-04 23:44:25 +02:00
parent c9fb91ab48
commit 111cc8c892
11 changed files with 115 additions and 44 deletions

View File

@@ -4,7 +4,6 @@
#include "canvas.h"
#include "canvas_actions.h"
#include "node_panel_layer.h"
#include "renderer_gl/opengl_capabilities.h"
void ActionStroke::undo()
{
@@ -37,22 +36,12 @@ void ActionStroke::undo()
{
App::I->render_task([&]
{
const auto texture_target = pp::renderer::gl::texture_2d_target();
const auto pixel_format = pp::renderer::gl::rgba_pixel_format();
const auto component_type = pp::renderer::gl::unsigned_byte_component_type();
m_canvas->m_layers[m_layer_idx]->rtt(i, m_frame_idx).bindTexture();
glTexSubImage2D(
texture_target,
0,
m_canvas->m_layers[m_layer_idx]->rtt(i, m_frame_idx).updateRgba8(
(int)m_box[i].x,
(int)m_box[i].y,
(int)box_sz.x,
(int)box_sz.y,
pixel_format,
component_type,
m_image[i].get());
m_canvas->m_layers[m_layer_idx]->rtt(i, m_frame_idx).unbindTexture();
});
}
else