Route framebuffer texture copies through GL backend
This commit is contained in:
@@ -748,6 +748,36 @@ pp::foundation::Status update_opengl_texture_2d(
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status copy_opengl_framebuffer_to_texture_2d(
|
||||
OpenGlTexture2DFramebufferCopy copy,
|
||||
OpenGlTexture2DFramebufferCopyDispatch dispatch) noexcept
|
||||
{
|
||||
if (dispatch.copy_tex_sub_image_2d == nullptr) {
|
||||
return pp::foundation::Status::invalid_argument(
|
||||
"OpenGL framebuffer-to-texture copy dispatch callback must not be null");
|
||||
}
|
||||
|
||||
if (copy.width < 0 || copy.height < 0) {
|
||||
return pp::foundation::Status::invalid_argument(
|
||||
"OpenGL framebuffer-to-texture copy dimensions are invalid");
|
||||
}
|
||||
|
||||
if (copy.width == 0 || copy.height == 0) {
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
dispatch.copy_tex_sub_image_2d(
|
||||
texture_2d_target(),
|
||||
copy.level,
|
||||
copy.destination_x,
|
||||
copy.destination_y,
|
||||
copy.source_x,
|
||||
copy.source_y,
|
||||
copy.width,
|
||||
copy.height);
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status generate_opengl_texture_2d_mipmaps(
|
||||
std::uint32_t texture_id,
|
||||
OpenGlTexture2DMipmapDispatch dispatch) noexcept
|
||||
|
||||
Reference in New Issue
Block a user