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
|
RGBA8 region-update helper that uses the tested texture-update dispatch for
|
||||||
canvas undo, layer restore, and flood-fill texture writes. 2D
|
canvas undo, layer restore, and flood-fill texture writes. 2D
|
||||||
framebuffer-to-texture copies used by retained canvas, transform,
|
framebuffer-to-texture copies used by retained canvas, transform,
|
||||||
layer-conversion, panorama UI, and brush-preview paths now execute through a
|
layer-conversion, panorama UI, brush-preview, and CanvasLayer cube-face paths
|
||||||
tested `pp_renderer_gl` dispatch via `copy_framebuffer_to_texture_2d`; the
|
now execute through a tested `pp_renderer_gl` dispatch via the target-aware
|
||||||
retained cube-map framebuffer copy remains tracked by `DEBT-0036`. It also
|
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
|
validates renderer API primitive-topology to OpenGL draw-mode mapping, Shape
|
||||||
index-type, fill/stroke primitive-mode, buffer target, static upload usage,
|
index-type, fill/stroke primitive-mode, buffer target, static upload usage,
|
||||||
and vertex attribute component/normalization mapping used by
|
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
|
clear, clear-color query/restore, and RGBA8 read/write pixel mapping. Their
|
||||||
active-texture, cube-texture binding, viewport, blend capability,
|
active-texture, cube-texture binding, viewport, blend capability,
|
||||||
clear-color, and color-buffer clear adapter endpoints now share
|
clear-color, and color-buffer clear adapter endpoints now share
|
||||||
`legacy_ui_gl_dispatch`; the retained cube-face framebuffer-to-texture copy
|
`legacy_ui_gl_dispatch`; the cube-face framebuffer-to-texture copy now uses
|
||||||
remains tracked by DEBT-0036.
|
the shared retained target-aware utility bridge and remains tracked by
|
||||||
|
DEBT-0036.
|
||||||
`NodePanelGrid` heightmap preview and lightmap baking also consume
|
`NodePanelGrid` heightmap preview and lightmap baking also consume
|
||||||
backend-owned texture readback formats, sampler filters, depth/blend state,
|
backend-owned texture readback formats, sampler filters, depth/blend state,
|
||||||
depth clears, viewport queries, color-mask booleans, active texture units,
|
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
|
`CanvasLayer` cube/equirect generation and frame clears also share the bridge
|
||||||
for active texture, cube texture binding, viewport execution, blend
|
for active texture, cube texture binding, viewport execution, blend
|
||||||
capability execution, clear-color query/restore, and color-buffer clear
|
capability execution, clear-color query/restore, and color-buffer clear
|
||||||
adapter endpoints, while its cube-face framebuffer-to-texture copy remains a
|
adapter endpoints, while its cube-face framebuffer-to-texture copy uses the
|
||||||
retained local copy bridge.
|
shared retained target-aware utility bridge.
|
||||||
`NodePanelGrid` heightmap draw and bake setup also shares it for active
|
`NodePanelGrid` heightmap draw and bake setup also shares it for active
|
||||||
texture, depth/blend capability query/apply, viewport query/execution, depth
|
texture, depth/blend capability query/apply, viewport query/execution, depth
|
||||||
clears, and color-write-mask adapter endpoints.
|
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
|
framebuffer depth attach/detach sequences used by retained `RTT` and canvas
|
||||||
object-drawing helpers now execute through tested `pp_renderer_gl` dispatch
|
object-drawing helpers now execute through tested `pp_renderer_gl` dispatch
|
||||||
contracts. 2D framebuffer-to-texture
|
contracts. 2D framebuffer-to-texture
|
||||||
copies used by canvas, transform, layer-conversion, panorama UI, and brush
|
copies used by canvas, transform, layer-conversion, panorama UI, brush preview,
|
||||||
preview paths now route through a tested `pp_renderer_gl` copy dispatch via the
|
and CanvasLayer cube-face generation paths now route through a tested
|
||||||
retained `copy_framebuffer_to_texture_2d` utility bridge; the remaining cube-map
|
`pp_renderer_gl` copy dispatch via the retained target-aware framebuffer-copy
|
||||||
copy is tracked under `DEBT-0036`. RTT render-target clear, masked color clear
|
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
|
with color-write-mask restore, and texture bind/unbind dispatch now execute
|
||||||
through `pp_renderer_gl`; renderer API render-pass color/depth/stencil
|
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
|
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
|
query/restore, and RGBA8 read/write pixel mapping to `pp_renderer_gl`. Its
|
||||||
active-texture, cube-texture binding, viewport, blend capability, clear-color,
|
active-texture, cube-texture binding, viewport, blend capability, clear-color,
|
||||||
and color-buffer clear adapter endpoints now share `legacy_ui_gl_dispatch`;
|
and color-buffer clear adapter endpoints now share `legacy_ui_gl_dispatch`;
|
||||||
the retained cube-face framebuffer-to-texture copy remains tracked under
|
the cube-face framebuffer-to-texture copy now uses the shared retained
|
||||||
DEBT-0036 until a renderer-owned cube copy command replaces it.
|
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
|
`NodePanelGrid` heightmap preview and lightmap baking now delegate texture
|
||||||
readback formats, sampler filters, depth/blend state, depth clears, viewport
|
readback formats, sampler filters, depth/blend state, depth clears, viewport
|
||||||
queries, color-mask booleans, active texture units, and float render-target
|
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,
|
`legacy_ui_gl_dispatch` for active-texture selection, cube texture binding,
|
||||||
viewport execution, blend capability execution, clear-color query/restore,
|
viewport execution, blend capability execution, clear-color query/restore,
|
||||||
and color-buffer clear adapter endpoints backed by tested renderer GL
|
and color-buffer clear adapter endpoints backed by tested renderer GL
|
||||||
backend dispatch contracts. The cube-face framebuffer-to-texture copy remains
|
backend dispatch contracts. The cube-face framebuffer-to-texture copy now
|
||||||
the retained local copy bridge tracked by DEBT-0036.
|
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
|
- `NodePanelGrid` live heightmap drawing and bake setup now route depth/blend
|
||||||
state, depth clears, color-write-mask toggles, active texture selection, and
|
state, depth clears, color-write-mask toggles, active texture selection, and
|
||||||
bake viewport execution through tested renderer GL backend dispatch
|
bake viewport execution through tested renderer GL backend dispatch
|
||||||
|
|||||||
@@ -13,27 +13,6 @@ uint32_t Layer::s_count = 0;
|
|||||||
|
|
||||||
namespace {
|
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)
|
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");
|
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 width,
|
||||||
std::int32_t height)
|
std::int32_t height)
|
||||||
{
|
{
|
||||||
const auto status = pp::renderer::gl::copy_opengl_framebuffer_to_texture_2d(
|
copy_framebuffer_to_texture_target(
|
||||||
pp::renderer::gl::OpenGlTexture2DFramebufferCopy {
|
texture_target,
|
||||||
.texture_target = texture_target,
|
destination_x,
|
||||||
.destination_x = destination_x,
|
destination_y,
|
||||||
.destination_y = destination_y,
|
source_x,
|
||||||
.source_x = source_x,
|
source_y,
|
||||||
.source_y = source_y,
|
width,
|
||||||
.width = width,
|
height);
|
||||||
.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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_layer_color_buffer(const glm::vec4& color)
|
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_x,
|
||||||
int destination_y,
|
int destination_y,
|
||||||
int source_x,
|
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(
|
const auto status = pp::renderer::gl::copy_opengl_framebuffer_to_texture_2d(
|
||||||
pp::renderer::gl::OpenGlTexture2DFramebufferCopy {
|
pp::renderer::gl::OpenGlTexture2DFramebufferCopy {
|
||||||
|
.texture_target = texture_target,
|
||||||
.level = level,
|
.level = level,
|
||||||
.destination_x = destination_x,
|
.destination_x = destination_x,
|
||||||
.destination_y = destination_y,
|
.destination_y = destination_y,
|
||||||
@@ -769,6 +771,26 @@ bool copy_framebuffer_to_texture_2d(
|
|||||||
return true;
|
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)
|
size_t curl_data_handler(void *contents, size_t size, size_t nmemb, void *userp)
|
||||||
{
|
{
|
||||||
auto buffer = reinterpret_cast<std::string*>(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_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);
|
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);
|
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(
|
bool copy_framebuffer_to_texture_2d(
|
||||||
int destination_x,
|
int destination_x,
|
||||||
int destination_y,
|
int destination_y,
|
||||||
|
|||||||
Reference in New Issue
Block a user