mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-11 19:14:54 +00:00
gl: Workaround slow PBO usage with Mesa
-Mesa is currently fastest with GL_STREAM_COPY
-See a338dc0186
-Also see https://bugs.freedesktop.org/show_bug.cgi?id=111043
This commit is contained in:
parent
690cdff0d3
commit
b5d5113803
@ -723,11 +723,16 @@ namespace gl
|
||||
GLsizeiptr src_mem = src->width() * src->height();
|
||||
GLsizeiptr dst_mem = dst->width() * dst->height();
|
||||
|
||||
GLenum buffer_copy_flag = GL_STATIC_COPY;
|
||||
if (gl::get_driver_caps().vendor_MESA) buffer_copy_flag = GL_STREAM_COPY;
|
||||
// NOTE: Mesa lacks acceleration for PBO unpacking and is currently fastest with GL_STREAM_COPY
|
||||
// See https://bugs.freedesktop.org/show_bug.cgi?id=111043
|
||||
|
||||
auto max_mem = std::max(src_mem, dst_mem) * 16;
|
||||
if (!g_typeless_transfer_buffer || max_mem > g_typeless_transfer_buffer.size())
|
||||
{
|
||||
if (g_typeless_transfer_buffer) g_typeless_transfer_buffer.remove();
|
||||
g_typeless_transfer_buffer.create(buffer::target::pixel_pack, max_mem, nullptr, GL_STATIC_COPY);
|
||||
g_typeless_transfer_buffer.create(buffer::target::pixel_pack, max_mem, nullptr, buffer_copy_flag);
|
||||
}
|
||||
|
||||
auto format_type = get_format_type(src->get_internal_format());
|
||||
|
Loading…
x
Reference in New Issue
Block a user