Route RTT blit readback through renderer GL
This commit is contained in:
@@ -141,6 +141,32 @@ struct OpenGlTexture2DReadbackResult {
|
||||
bool pixels_read = false;
|
||||
};
|
||||
|
||||
struct OpenGlFramebufferRect {
|
||||
std::int32_t x0 = 0;
|
||||
std::int32_t y0 = 0;
|
||||
std::int32_t x1 = 0;
|
||||
std::int32_t y1 = 0;
|
||||
};
|
||||
|
||||
struct OpenGlFramebufferBlit {
|
||||
std::uint32_t source_framebuffer = 0;
|
||||
std::uint32_t destination_framebuffer = 0;
|
||||
OpenGlFramebufferRect source_rect;
|
||||
OpenGlFramebufferRect destination_rect;
|
||||
std::uint32_t mask = 0;
|
||||
std::uint32_t filter = 0;
|
||||
};
|
||||
|
||||
struct OpenGlFramebufferReadback {
|
||||
std::uint32_t framebuffer = 0;
|
||||
std::int32_t x = 0;
|
||||
std::int32_t y = 0;
|
||||
std::int32_t width = 0;
|
||||
std::int32_t height = 0;
|
||||
OpenGlReadbackFormat format;
|
||||
void* pixels = nullptr;
|
||||
};
|
||||
|
||||
struct OpenGlWindowsWglContextConfig {
|
||||
std::array<std::int32_t, 9> context_attributes {};
|
||||
std::array<std::int32_t, 15> pixel_format_attributes {};
|
||||
@@ -223,6 +249,17 @@ using OpenGlReadPixelsFn = void (*)(
|
||||
std::uint32_t pixel_format,
|
||||
std::uint32_t component_type,
|
||||
void* pixels) noexcept;
|
||||
using OpenGlBlitFramebufferFn = void (*)(
|
||||
std::int32_t source_x0,
|
||||
std::int32_t source_y0,
|
||||
std::int32_t source_x1,
|
||||
std::int32_t source_y1,
|
||||
std::int32_t destination_x0,
|
||||
std::int32_t destination_y0,
|
||||
std::int32_t destination_x1,
|
||||
std::int32_t destination_y1,
|
||||
std::uint32_t mask,
|
||||
std::uint32_t filter) noexcept;
|
||||
|
||||
struct OpenGlStateDispatch {
|
||||
OpenGlCapabilityFn enable = nullptr;
|
||||
@@ -332,6 +369,18 @@ struct OpenGlTexture2DReadbackDispatch {
|
||||
OpenGlDeleteObjectsFn delete_framebuffers = nullptr;
|
||||
};
|
||||
|
||||
struct OpenGlFramebufferBlitDispatch {
|
||||
OpenGlGetIntegerFn get_integer = nullptr;
|
||||
OpenGlBindFramebufferFn bind_framebuffer = nullptr;
|
||||
OpenGlBlitFramebufferFn blit_framebuffer = nullptr;
|
||||
};
|
||||
|
||||
struct OpenGlFramebufferReadbackDispatch {
|
||||
OpenGlGetIntegerFn get_integer = nullptr;
|
||||
OpenGlBindFramebufferFn bind_framebuffer = nullptr;
|
||||
OpenGlReadPixelsFn read_pixels = nullptr;
|
||||
};
|
||||
|
||||
[[nodiscard]] OpenGlCapabilities detect_opengl_capabilities(
|
||||
std::span<const std::string_view> extensions,
|
||||
OpenGlRuntime runtime) noexcept;
|
||||
@@ -382,6 +431,12 @@ struct OpenGlTexture2DReadbackDispatch {
|
||||
[[nodiscard]] pp::foundation::Result<OpenGlTexture2DReadbackResult> readback_opengl_texture_2d(
|
||||
OpenGlTexture2DReadback readback,
|
||||
OpenGlTexture2DReadbackDispatch dispatch) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status blit_opengl_framebuffer(
|
||||
OpenGlFramebufferBlit blit,
|
||||
OpenGlFramebufferBlitDispatch dispatch) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status readback_opengl_framebuffer(
|
||||
OpenGlFramebufferReadback readback,
|
||||
OpenGlFramebufferReadbackDispatch dispatch) noexcept;
|
||||
|
||||
[[nodiscard]] std::uint32_t extension_count_query() noexcept;
|
||||
[[nodiscard]] std::uint32_t extension_string_name() noexcept;
|
||||
|
||||
Reference in New Issue
Block a user