350 {
351 const auto& gl =
reactor.GetProcTable();
352
353
354
355 if (!gl.BlitFramebuffer.IsAvailable()) {
356
357 VALIDATION_LOG <<
"Texture blit fallback not implemented yet for GLES2.";
358 return false;
359 }
360
361 GLuint read_fbo = GL_NONE;
362 GLuint draw_fbo = GL_NONE;
364 DeleteFBO(gl, read_fbo, GL_READ_FRAMEBUFFER);
365 DeleteFBO(gl, draw_fbo, GL_DRAW_FRAMEBUFFER);
366 });
367
368 {
370 if (!read.has_value()) {
371 return false;
372 }
373 read_fbo = read.value();
374 }
375
376 {
378 if (!draw.has_value()) {
379 return false;
380 }
381 draw_fbo = draw.value();
382 }
383
384 gl.Disable(GL_SCISSOR_TEST);
385 gl.Disable(GL_DEPTH_TEST);
386 gl.Disable(GL_STENCIL_TEST);
387
390
391 gl.BlitFramebuffer(source_region.GetX(),
392 source_region.GetY(),
393 source_region.GetWidth(),
394 source_region.GetHeight(),
395 destination_region.GetX(),
396 destination_region.GetY(),
397 destination_region.GetWidth(),
398 destination_region.GetHeight(),
399 GL_COLOR_BUFFER_BIT,
400 GL_LINEAR
401 );
402
403 return true;
404}
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< ReactorGLES > reactor
std::shared_ptr< Texture > destination
std::shared_ptr< Texture > source
static constexpr TRect MakeSize(const TSize< U > &size)