Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/surface.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 79dc0bd06b6..9c6f5e18c28 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -419,8 +419,8 @@ void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned i unsigned int restore_idx; BYTE *row, *top, *bottom; BOOL src_is_upside_down; + BYTE *mem = NULL; unsigned int i; - BYTE *mem;
wined3d_texture_get_memory(texture, sub_resource_idx, &data, dst_location);
@@ -504,8 +504,7 @@ void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned i mem = GL_EXTCALL(glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_WRITE)); checkGLcall("glMapBuffer"); } - else - mem = data.addr; + mem += (uintptr_t)data.addr;
top = mem; bottom = mem + row_pitch * (height - 1);
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/surface.c | 7 +++++-- dlls/wined3d/texture.c | 15 +++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 9c6f5e18c28..060ac84b8b7 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -420,9 +420,11 @@ void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned i BYTE *row, *top, *bottom; BOOL src_is_upside_down; BYTE *mem = NULL; + uint8_t *offset; unsigned int i;
wined3d_texture_get_memory(texture, sub_resource_idx, &data, dst_location); + offset = data.addr;
restore_texture = context->current_rt.texture; restore_idx = context->current_rt.sub_resource_idx; @@ -471,6 +473,7 @@ void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned i { GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, wined3d_bo_gl(data.buffer_object)->id)); checkGLcall("glBindBuffer"); + offset += data.buffer_object->buffer_offset; }
level = sub_resource_idx % texture->level_count; @@ -484,7 +487,7 @@ void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned i width = wined3d_texture_get_level_width(texture, level); height = wined3d_texture_get_level_height(texture, level); gl_info->gl_ops.gl.p_glReadPixels(0, 0, width, height, - format_gl->format, format_gl->type, data.addr); + format_gl->format, format_gl->type, offset); checkGLcall("glReadPixels");
/* Reset previous pixel store pack state */ @@ -504,7 +507,7 @@ void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned i mem = GL_EXTCALL(glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_WRITE)); checkGLcall("glMapBuffer"); } - mem += (uintptr_t)data.addr; + mem += (uintptr_t)offset;
top = mem; bottom = mem + row_pitch * (height - 1); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 072092e73be..1ab50a27596 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -2693,7 +2693,7 @@ static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl { GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, bo->id)); checkGLcall("glBindBuffer"); - mem = data->addr; + mem = (uint8_t *)data->addr + bo->b.buffer_offset; } else { @@ -2796,7 +2796,8 @@ static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl { GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, bo->id)); checkGLcall("glBindBuffer"); - GL_EXTCALL(glBufferSubData(GL_PIXEL_PACK_BUFFER, (GLintptr)data->addr, sub_resource->size, src_data)); + GL_EXTCALL(glBufferSubData(GL_PIXEL_PACK_BUFFER, + (GLintptr)data->addr + bo->b.buffer_offset, sub_resource->size, src_data)); checkGLcall("glBufferSubData"); } else @@ -2827,6 +2828,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context, unsigned int src_level, src_width, src_height, src_depth; unsigned int src_row_pitch, src_slice_pitch; const struct wined3d_format_gl *format_gl; + uint8_t *offset = dst_bo_addr->addr; struct wined3d_bo *dst_bo; BOOL srgb = FALSE; GLenum target; @@ -2906,22 +2908,23 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context, { GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, wined3d_bo_gl(dst_bo)->id)); checkGLcall("glBindBuffer"); + offset += dst_bo->buffer_offset; }
if (src_texture->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { TRACE("Downloading compressed 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); + src_texture, src_sub_resource_idx, src_level, format_gl->format, format_gl->type, offset);
- GL_EXTCALL(glGetCompressedTexImage(target, src_level, dst_bo_addr->addr)); + GL_EXTCALL(glGetCompressedTexImage(target, src_level, offset)); checkGLcall("glGetCompressedTexImage"); } else { TRACE("Downloading 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); + src_texture, src_sub_resource_idx, src_level, format_gl->format, format_gl->type, offset);
- gl_info->gl_ops.gl.p_glGetTexImage(target, src_level, format_gl->format, format_gl->type, dst_bo_addr->addr); + gl_info->gl_ops.gl.p_glGetTexImage(target, src_level, format_gl->format, format_gl->type, offset); checkGLcall("glGetTexImage"); }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
From: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/view.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index b981602f1a2..0ea14531766 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -257,6 +257,10 @@ static void create_buffer_texture(struct wined3d_gl_view *view, struct wined3d_c return; }
+ wined3d_buffer_load_location(buffer, &context_gl->c, WINED3D_LOCATION_BUFFER); + bo_gl = wined3d_bo_gl(buffer->buffer_object); + offset += bo_gl->b.buffer_offset; + if ((offset & (gl_info->limits.texture_buffer_offset_alignment - 1))) { FIXME("Buffer offset %u is not %u byte aligned.\n", @@ -264,9 +268,6 @@ static void create_buffer_texture(struct wined3d_gl_view *view, struct wined3d_c return; }
- wined3d_buffer_load_location(buffer, &context_gl->c, WINED3D_LOCATION_BUFFER); - bo_gl = wined3d_bo_gl(buffer->buffer_object); - view->target = GL_TEXTURE_BUFFER; if (!view->name) gl_info->gl_ops.gl.p_glGenTextures(1, &view->name);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=102487
Your paranoid android.
=== debiant2 (build log) ===
Task: Patch failed to apply
=== debiant2 (build log) ===
Task: Patch failed to apply
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
From: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 0ea14531766..5905a4bcfb5 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1598,7 +1598,7 @@ void wined3d_unordered_access_view_gl_clear(struct wined3d_unordered_access_view get_buffer_view_range(buffer, &view_gl->v.desc, &format_gl->f, &offset, &size); wined3d_context_gl_bind_bo(context_gl, bo_gl->binding, bo_gl->id); GL_EXTCALL(glClearBufferSubData(bo_gl->binding, format_gl->internal, - offset, size, format_gl->format, format_gl->type, clear_value)); + bo_gl->b.buffer_offset + offset, size, format_gl->format, format_gl->type, clear_value)); wined3d_context_gl_reference_bo(context_gl, bo_gl); checkGLcall("clear unordered access view"); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=102488
Your paranoid android.
=== debiant2 (build log) ===
Task: Patch failed to apply
=== debiant2 (build log) ===
Task: Patch failed to apply
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
From: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index d3aeb2e76f4..cd277433c91 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1387,8 +1387,8 @@ static void wined3d_buffer_gl_upload_ranges(struct wined3d_buffer *buffer, struc while (range_count--) { range = &ranges[range_count]; - GL_EXTCALL(glBufferSubData(bo_gl->binding, - range->offset, range->size, (BYTE *)data + range->offset - data_offset)); + GL_EXTCALL(glBufferSubData(bo_gl->binding, bo_gl->b.buffer_offset + range->offset, + range->size, (BYTE *)data + range->offset - data_offset)); } wined3d_context_gl_reference_bo(context_gl, bo_gl); checkGLcall("buffer upload");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=102489
Your paranoid android.
=== debiant2 (build log) ===
Task: Patch failed to apply
=== debiant2 (build log) ===
Task: Patch failed to apply
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index cd277433c91..e5bc4c92e6b 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1412,8 +1412,8 @@ static void wined3d_buffer_gl_download_ranges(struct wined3d_buffer *buffer, str while (range_count--) { range = &ranges[range_count]; - GL_EXTCALL(glGetBufferSubData(bo_gl->binding, - range->offset, range->size, (BYTE *)data + range->offset - data_offset)); + GL_EXTCALL(glGetBufferSubData(bo_gl->binding, bo_gl->b.buffer_offset + range->offset, + range->size, (BYTE *)data + range->offset - data_offset)); } checkGLcall("buffer download"); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=102490
Your paranoid android.
=== debiant2 (build log) ===
Task: Patch failed to apply
=== debiant2 (build log) ===
Task: Patch failed to apply
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com