408 {
409 const auto& gl = reactor.GetProcTable();
410
411
412
413 if (!gl.BlitFramebuffer.IsAvailable()) {
414
415 VALIDATION_LOG <<
"Texture blit fallback not implemented yet for GLES2.";
416 return false;
417 }
418
420
421 GLuint read_fbo = GL_NONE;
422 GLuint draw_fbo = GL_NONE;
424 DeleteFBO(gl, read_fbo, GL_READ_FRAMEBUFFER);
425 DeleteFBO(gl, draw_fbo, GL_DRAW_FRAMEBUFFER);
426 });
427
428 {
430 if (!read.has_value()) {
431 return false;
432 }
433 read_fbo = read.value();
434 }
435
436 {
438 if (!draw.has_value()) {
439 return false;
440 }
441 draw_fbo = draw.value();
442 }
443
444 gl.Disable(GL_SCISSOR_TEST);
445 gl.Disable(GL_DEPTH_TEST);
446 gl.Disable(GL_STENCIL_TEST);
447
450
451 gl.BlitFramebuffer(source_region.GetX(),
452 source_region.GetY(),
453 source_region.GetWidth(),
454 source_region.GetHeight(),
455 destination_region.GetX(),
456 destination_region.GetY(),
457 destination_region.GetWidth(),
458 destination_region.GetHeight(),
459 GL_COLOR_BUFFER_BIT,
460 GL_LINEAR
461 );
462
463 return true;
464}
Wraps a closure that is invoked in the destructor unless released by the caller.
static std::optional< GLuint > ConfigureFBO(const ProcTableGLES &gl, const std::shared_ptr< Texture > &texture, GLenum fbo_type)
static void DeleteFBO(const ProcTableGLES &gl, GLuint fbo, GLenum type)
std::shared_ptr< Texture > destination
std::shared_ptr< Texture > source
static constexpr TRect MakeSize(const TSize< U > &size)