Share retained RTT clear dispatch

This commit is contained in:
2026-06-05 15:27:00 +02:00
parent 26470e0fe8
commit 0fb3bd09ac
5 changed files with 28 additions and 32 deletions

View File

@@ -589,6 +589,9 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\apple-remote-build.p
`NodePanelGrid` heightmap draw and bake setup also shares it for active
texture, depth/blend capability query/apply, viewport query/execution, depth
clears, and color-write-mask adapter endpoints.
Retained RTT clear and masked-clear endpoints also share it for color-mask
query/apply, clear-color, and buffer-clear callbacks instead of owning a
local raw clear callback cluster.
Retained desktop HMD eye rendering also routes viewport
execution through tested backend dispatch.
Legacy `Texture2D`, `TextureManager`, `Sampler`, and `RTT` public headers no

File diff suppressed because one or more lines are too long

View File

@@ -944,7 +944,8 @@ moving render-target pass entry/exit state management behind the backend.
Legacy `RTT::clear`, `RTT::clear_mask`, `RTT::bindTexture`, and
`RTT::unbindTexture` now dispatch through `pp_renderer_gl` clear,
color-write-mask restore, and texture-bind contracts, keeping render-target
utility operations behind the backend boundary.
utility operations behind the backend boundary. The retained RTT clear and
masked-clear callback endpoints now share `legacy_ui_gl_dispatch`.
Windows RenderDoc frame capture hooks now also dispatch through
`PlatformServices`, keeping capture integration in the platform service while
leaving non-Windows adapters as no-ops.
@@ -2605,6 +2606,11 @@ Results:
local raw callback clusters from `src/app.cpp`, `src/app_commands.cpp`, and
`src/app_vr.cpp` while app/VR renderer execution remains retained under
DEBT-0036.
- Retained RTT clear and masked-clear endpoints now share
`legacy_ui_gl_dispatch` for boolean color-mask query, color-mask apply,
clear-color, and buffer-clear callbacks, removing the local raw clear
callback cluster from `src/rtt.cpp` while RTT render-target execution remains
retained under DEBT-0036.
- Canvas draw-merge shader-blend selection now consumes the extracted
`pp_paint_renderer` stroke composite planner for current layer and primary
brush blend modes, while preserving legacy OpenGL compositing execution under

View File

@@ -38,6 +38,11 @@ inline void set_opengl_color_mask(std::uint8_t r, std::uint8_t g, std::uint8_t b
glColorMask(r, g, b, a);
}
inline void get_opengl_boolean(std::uint32_t name, std::uint8_t* value) noexcept
{
glGetBooleanv(static_cast<GLenum>(name), reinterpret_cast<GLboolean*>(value));
}
inline void set_opengl_clear_color(float r, float g, float b, float a) noexcept
{
glClearColor(r, g, b, a);

View File

@@ -7,34 +7,11 @@
#include "legacy_gl_pixel_buffer_dispatch.h"
#include "legacy_gl_renderbuffer_dispatch.h"
#include "legacy_gl_texture_dispatch.h"
#include "legacy_ui_gl_dispatch.h"
#include "renderer_gl/opengl_capabilities.h"
#include <cstdint>
namespace {
void query_opengl_boolean(std::uint32_t name, std::uint8_t* value) noexcept
{
glGetBooleanv(static_cast<GLenum>(name), reinterpret_cast<GLboolean*>(value));
}
void set_opengl_clear_color(float r, float g, float b, float a) noexcept
{
glClearColor(r, g, b, a);
}
void clear_opengl_buffers(std::uint32_t mask) noexcept
{
glClear(static_cast<GLbitfield>(mask));
}
void set_opengl_color_mask(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a) noexcept
{
glColorMask(r, g, b, a);
}
}
RTT& RTT::operator=(RTT&& other)
{
int_fmt = other.int_fmt;
@@ -403,8 +380,8 @@ void RTT::clear(glm::vec4 color)
| pp::renderer::gl::framebuffer_depth_buffer_mask(),
},
pp::renderer::gl::OpenGlClearDispatch {
.clear_color = set_opengl_clear_color,
.clear = clear_opengl_buffers,
.clear_color = pp::legacy::ui_gl::set_opengl_clear_color,
.clear = pp::legacy::ui_gl::clear_opengl_buffer,
});
if (!status.ok())
LOG("RTT::clear() failed because: %s", status.message);
@@ -424,10 +401,10 @@ void RTT::clear_mask(glm::bool4 mask, glm::vec4 color)
.color = { color.r, color.g, color.b, color.a },
},
pp::renderer::gl::OpenGlColorMaskedClearDispatch {
.get_boolean = query_opengl_boolean,
.color_mask = set_opengl_color_mask,
.clear_color = set_opengl_clear_color,
.clear = clear_opengl_buffers,
.get_boolean = pp::legacy::ui_gl::get_opengl_boolean,
.color_mask = pp::legacy::ui_gl::set_opengl_color_mask,
.clear_color = pp::legacy::ui_gl::set_opengl_clear_color,
.clear = pp::legacy::ui_gl::clear_opengl_buffer,
});
if (!status.ok())
LOG("RTT::clear_mask() failed because: %s", status.message);