Share target-aware framebuffer copy bridge
This commit is contained in:
@@ -447,9 +447,10 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\apple-remote-build.p
|
||||
RGBA8 region-update helper that uses the tested texture-update dispatch for
|
||||
canvas undo, layer restore, and flood-fill texture writes. 2D
|
||||
framebuffer-to-texture copies used by retained canvas, transform,
|
||||
layer-conversion, panorama UI, and brush-preview paths now execute through a
|
||||
tested `pp_renderer_gl` dispatch via `copy_framebuffer_to_texture_2d`; the
|
||||
retained cube-map framebuffer copy remains tracked by `DEBT-0036`. It also
|
||||
layer-conversion, panorama UI, brush-preview, and CanvasLayer cube-face paths
|
||||
now execute through a tested `pp_renderer_gl` dispatch via the target-aware
|
||||
retained framebuffer-copy utility bridge. That bridge remains retained until
|
||||
renderer services own copy execution under `DEBT-0036`. It also
|
||||
validates renderer API primitive-topology to OpenGL draw-mode mapping, Shape
|
||||
index-type, fill/stroke primitive-mode, buffer target, static upload usage,
|
||||
and vertex attribute component/normalization mapping used by
|
||||
@@ -522,8 +523,9 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\apple-remote-build.p
|
||||
clear, clear-color query/restore, and RGBA8 read/write pixel mapping. Their
|
||||
active-texture, cube-texture binding, viewport, blend capability,
|
||||
clear-color, and color-buffer clear adapter endpoints now share
|
||||
`legacy_ui_gl_dispatch`; the retained cube-face framebuffer-to-texture copy
|
||||
remains tracked by DEBT-0036.
|
||||
`legacy_ui_gl_dispatch`; the cube-face framebuffer-to-texture copy now uses
|
||||
the shared retained target-aware utility bridge and remains tracked by
|
||||
DEBT-0036.
|
||||
`NodePanelGrid` heightmap preview and lightmap baking also consume
|
||||
backend-owned texture readback formats, sampler filters, depth/blend state,
|
||||
depth clears, viewport queries, color-mask booleans, active texture units,
|
||||
@@ -565,8 +567,8 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\apple-remote-build.p
|
||||
`CanvasLayer` cube/equirect generation and frame clears also share the bridge
|
||||
for active texture, cube texture binding, viewport execution, blend
|
||||
capability execution, clear-color query/restore, and color-buffer clear
|
||||
adapter endpoints, while its cube-face framebuffer-to-texture copy remains a
|
||||
retained local copy bridge.
|
||||
adapter endpoints, while its cube-face framebuffer-to-texture copy uses the
|
||||
shared retained target-aware utility bridge.
|
||||
`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.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1153,10 +1153,11 @@ also live in `pp_renderer_gl`. Depth renderbuffer allocation/storage/delete and
|
||||
framebuffer depth attach/detach sequences used by retained `RTT` and canvas
|
||||
object-drawing helpers now execute through tested `pp_renderer_gl` dispatch
|
||||
contracts. 2D framebuffer-to-texture
|
||||
copies used by canvas, transform, layer-conversion, panorama UI, and brush
|
||||
preview paths now route through a tested `pp_renderer_gl` copy dispatch via the
|
||||
retained `copy_framebuffer_to_texture_2d` utility bridge; the remaining cube-map
|
||||
copy is tracked under `DEBT-0036`. RTT render-target clear, masked color clear
|
||||
copies used by canvas, transform, layer-conversion, panorama UI, brush preview,
|
||||
and CanvasLayer cube-face generation paths now route through a tested
|
||||
`pp_renderer_gl` copy dispatch via the retained target-aware framebuffer-copy
|
||||
utility bridge. The copy bridge remains retained until renderer services own
|
||||
cube and 2D framebuffer copy commands under `DEBT-0036`. RTT render-target clear, masked color clear
|
||||
with color-write-mask restore, and texture bind/unbind dispatch now execute
|
||||
through `pp_renderer_gl`; renderer API render-pass color/depth/stencil
|
||||
clear-mask and clear-value mapping, and color-write-mask query tokens also live
|
||||
@@ -1232,8 +1233,9 @@ viewport execution, cube texture binding, color-buffer clears, clear-color
|
||||
query/restore, and RGBA8 read/write pixel mapping to `pp_renderer_gl`. Its
|
||||
active-texture, cube-texture binding, viewport, blend capability, clear-color,
|
||||
and color-buffer clear adapter endpoints now share `legacy_ui_gl_dispatch`;
|
||||
the retained cube-face framebuffer-to-texture copy remains tracked under
|
||||
DEBT-0036 until a renderer-owned cube copy command replaces it.
|
||||
the cube-face framebuffer-to-texture copy now uses the shared retained
|
||||
target-aware utility bridge and remains tracked under DEBT-0036 until a
|
||||
renderer-owned cube copy command replaces it.
|
||||
`NodePanelGrid` heightmap preview and lightmap baking now delegate texture
|
||||
readback formats, sampler filters, depth/blend state, depth clears, viewport
|
||||
queries, color-mask booleans, active texture units, and float render-target
|
||||
@@ -2501,8 +2503,9 @@ Results:
|
||||
`legacy_ui_gl_dispatch` for active-texture selection, cube texture binding,
|
||||
viewport execution, blend capability execution, clear-color query/restore,
|
||||
and color-buffer clear adapter endpoints backed by tested renderer GL
|
||||
backend dispatch contracts. The cube-face framebuffer-to-texture copy remains
|
||||
the retained local copy bridge tracked by DEBT-0036.
|
||||
backend dispatch contracts. The cube-face framebuffer-to-texture copy now
|
||||
uses the shared retained target-aware utility bridge and remains tracked by
|
||||
DEBT-0036 until renderer services own copy execution.
|
||||
- `NodePanelGrid` live heightmap drawing and bake setup now route depth/blend
|
||||
state, depth clears, color-write-mask toggles, active texture selection, and
|
||||
bake viewport execution through tested renderer GL backend dispatch
|
||||
|
||||
@@ -13,27 +13,6 @@ uint32_t Layer::s_count = 0;
|
||||
|
||||
namespace {
|
||||
|
||||
void copy_opengl_tex_sub_image_2d(
|
||||
std::uint32_t target,
|
||||
std::int32_t level,
|
||||
std::int32_t destination_x,
|
||||
std::int32_t destination_y,
|
||||
std::int32_t source_x,
|
||||
std::int32_t source_y,
|
||||
std::int32_t width,
|
||||
std::int32_t height) noexcept
|
||||
{
|
||||
glCopyTexSubImage2D(
|
||||
static_cast<GLenum>(target),
|
||||
static_cast<GLint>(level),
|
||||
static_cast<GLint>(destination_x),
|
||||
static_cast<GLint>(destination_y),
|
||||
static_cast<GLint>(source_x),
|
||||
static_cast<GLint>(source_y),
|
||||
static_cast<GLsizei>(width),
|
||||
static_cast<GLsizei>(height));
|
||||
}
|
||||
|
||||
void apply_layer_viewport(std::int32_t x, std::int32_t y, std::int32_t width, std::int32_t height)
|
||||
{
|
||||
pp::legacy::ui_gl::apply_viewport(x, y, width, height, "Layer");
|
||||
@@ -63,21 +42,14 @@ void copy_layer_framebuffer_to_texture(
|
||||
std::int32_t width,
|
||||
std::int32_t height)
|
||||
{
|
||||
const auto status = pp::renderer::gl::copy_opengl_framebuffer_to_texture_2d(
|
||||
pp::renderer::gl::OpenGlTexture2DFramebufferCopy {
|
||||
.texture_target = texture_target,
|
||||
.destination_x = destination_x,
|
||||
.destination_y = destination_y,
|
||||
.source_x = source_x,
|
||||
.source_y = source_y,
|
||||
.width = width,
|
||||
.height = height,
|
||||
},
|
||||
pp::renderer::gl::OpenGlTexture2DFramebufferCopyDispatch {
|
||||
.copy_tex_sub_image_2d = copy_opengl_tex_sub_image_2d,
|
||||
});
|
||||
if (!status.ok())
|
||||
LOG("Layer framebuffer-to-texture copy dispatch failed because: %s", status.message);
|
||||
copy_framebuffer_to_texture_target(
|
||||
texture_target,
|
||||
destination_x,
|
||||
destination_y,
|
||||
source_x,
|
||||
source_y,
|
||||
width,
|
||||
height);
|
||||
}
|
||||
|
||||
void clear_layer_color_buffer(const glm::vec4& color)
|
||||
|
||||
24
src/util.cpp
24
src/util.cpp
@@ -740,7 +740,8 @@ void check_OpenGLError(const char* stmt, const char* fname, int line)
|
||||
}
|
||||
}
|
||||
|
||||
bool copy_framebuffer_to_texture_2d(
|
||||
bool copy_framebuffer_to_texture_target(
|
||||
uint32_t texture_target,
|
||||
int destination_x,
|
||||
int destination_y,
|
||||
int source_x,
|
||||
@@ -751,6 +752,7 @@ bool copy_framebuffer_to_texture_2d(
|
||||
{
|
||||
const auto status = pp::renderer::gl::copy_opengl_framebuffer_to_texture_2d(
|
||||
pp::renderer::gl::OpenGlTexture2DFramebufferCopy {
|
||||
.texture_target = texture_target,
|
||||
.level = level,
|
||||
.destination_x = destination_x,
|
||||
.destination_y = destination_y,
|
||||
@@ -769,6 +771,26 @@ bool copy_framebuffer_to_texture_2d(
|
||||
return true;
|
||||
}
|
||||
|
||||
bool copy_framebuffer_to_texture_2d(
|
||||
int destination_x,
|
||||
int destination_y,
|
||||
int source_x,
|
||||
int source_y,
|
||||
int width,
|
||||
int height,
|
||||
int level) noexcept
|
||||
{
|
||||
return copy_framebuffer_to_texture_target(
|
||||
pp::renderer::gl::texture_2d_target(),
|
||||
destination_x,
|
||||
destination_y,
|
||||
source_x,
|
||||
source_y,
|
||||
width,
|
||||
height,
|
||||
level);
|
||||
}
|
||||
|
||||
size_t curl_data_handler(void *contents, size_t size, size_t nmemb, void *userp)
|
||||
{
|
||||
auto buffer = reinterpret_cast<std::string*>(userp);
|
||||
|
||||
@@ -201,6 +201,15 @@ std::string str_replace(const std::string& string, const std::string& search, co
|
||||
size_t curl_data_handler(void *contents, size_t size, size_t nmemb, void *userp);
|
||||
size_t curl_data_write(void *ptr, size_t size, size_t nmemb, FILE *stream);
|
||||
void check_OpenGLError(const char* stmt, const char* fname, int line);
|
||||
bool copy_framebuffer_to_texture_target(
|
||||
uint32_t texture_target,
|
||||
int destination_x,
|
||||
int destination_y,
|
||||
int source_x,
|
||||
int source_y,
|
||||
int width,
|
||||
int height,
|
||||
int level = 0) noexcept;
|
||||
bool copy_framebuffer_to_texture_2d(
|
||||
int destination_x,
|
||||
int destination_y,
|
||||
|
||||
Reference in New Issue
Block a user