Route RTT region readbacks through backend
This commit is contained in:
@@ -92,22 +92,12 @@ Action* ActionStroke::get_redo()
|
||||
{
|
||||
action->m_image[i] = std::make_unique<uint8_t[]>(
|
||||
static_cast<size_t>((int)box_sz.x) * static_cast<size_t>((int)box_sz.y) * 4U);
|
||||
App::I->render_task([&]
|
||||
{
|
||||
const auto pixel_format = pp::renderer::gl::rgba_pixel_format();
|
||||
const auto component_type = pp::renderer::gl::unsigned_byte_component_type();
|
||||
|
||||
layer->rtt(i, m_frame_idx).bindFramebuffer();
|
||||
glReadPixels(
|
||||
(int)box_or.x,
|
||||
(int)box_or.y,
|
||||
(int)box_sz.x,
|
||||
(int)box_sz.y,
|
||||
pixel_format,
|
||||
component_type,
|
||||
action->m_image[i].get());
|
||||
layer->rtt(i, m_frame_idx).unbindFramebuffer();
|
||||
});
|
||||
layer->rtt(i, m_frame_idx).readPixelsRgba8(
|
||||
static_cast<int>(box_or.x),
|
||||
static_cast<int>(box_or.y),
|
||||
static_cast<int>(box_sz.x),
|
||||
static_cast<int>(box_sz.y),
|
||||
action->m_image[i].get());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user