wined3d-mesa_texture_download: Remove patch set.

This was a workaround for a shortcoming in Gallium drivers, now fixed upstream.
This commit is contained in:
Zebediah Figura 2024-02-23 00:27:07 -06:00
parent 53e890acb9
commit 8f19bbf064
2 changed files with 0 additions and 58 deletions

View File

@ -1,57 +0,0 @@
From eca848444ad8ab987b93ba54752c122d8eb69237 Mon Sep 17 00:00:00 2001
From: Andrew Wesie <awesie@gmail.com>
Date: Sun, 30 Sep 2018 12:02:00 -0500
Subject: [PATCH] wined3d: Use glReadPixels for RT texture download.
Signed-off-by: Andrew Wesie <awesie@gmail.com>
---
dlls/wined3d/texture.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 1ab50a27596..2024f2aba23 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -2832,6 +2832,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context,
struct wined3d_bo *dst_bo;
BOOL srgb = FALSE;
GLenum target;
+ struct wined3d_texture_sub_resource *sub_resource;
TRACE("context %p, src_texture %p, src_sub_resource_idx %u, src_location %s, src_box %s, dst_bo_addr %s, "
"dst_format %s, dst_x %u, dst_y %u, dst_z %u, dst_row_pitch %u, dst_slice_pitch %u.\n",
@@ -2886,6 +2887,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context,
format_gl = wined3d_format_gl(src_texture->resource.format);
target = wined3d_texture_gl_get_sub_resource_target(src_texture_gl, src_sub_resource_idx);
+ sub_resource = &src_texture->sub_resources[src_sub_resource_idx];
if ((src_texture->resource.type == WINED3D_RTYPE_TEXTURE_2D
&& (target == GL_TEXTURE_2D_ARRAY || format_gl->f.conv_byte_count
@@ -2919,6 +2921,23 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context,
GL_EXTCALL(glGetCompressedTexImage(target, src_level, offset));
checkGLcall("glGetCompressedTexImage");
}
+ else if (dst_bo_addr->buffer_object && src_texture->resource.bind_flags & WINED3D_BIND_RENDER_TARGET)
+ {
+ /* PBO texture download is not accelerated on Mesa. Use glReadPixels if possible. */
+ TRACE("Downloading (glReadPixels) texture %p, %u, level %u, format %#x, type %#x, data %p.\n",
+ src_texture, src_sub_resource_idx, src_level, format_gl->format, format_gl->type, dst_bo_addr->addr);
+
+ wined3d_context_gl_apply_fbo_state_explicit(context_gl, GL_READ_FRAMEBUFFER, &src_texture->resource, src_sub_resource_idx, NULL,
+ 0, sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB));
+ wined3d_context_gl_check_fbo_status(context_gl, GL_READ_FRAMEBUFFER);
+ context_invalidate_state(context, STATE_FRAMEBUFFER);
+ gl_info->gl_ops.gl.p_glReadBuffer(GL_COLOR_ATTACHMENT0);
+ checkGLcall("glReadBuffer()");
+
+ gl_info->gl_ops.gl.p_glReadPixels(0, 0, wined3d_texture_get_level_width(src_texture, src_level),
+ wined3d_texture_get_level_height(src_texture, src_level), format_gl->format, format_gl->type, dst_bo_addr->addr);
+ checkGLcall("glReadPixels");
+ }
else
{
TRACE("Downloading texture %p, %u, level %u, format %#x, type %#x, data %p.\n",
--
2.33.0

View File

@ -1 +0,0 @@
Fixes: [45901] Avoid GPU synchronization due to GPU-CPU transfer (Overwatch)