Most of the information in "desc" is already stored in the wined3d_resource structure.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/buffer.c | 4 ++-- dlls/wined3d/view.c | 8 ++++---- dlls/wined3d/wined3d_private.h | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 58e56857b4c..8c7a23fd461 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1302,7 +1302,7 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc offset = size = 0; }
- map_desc->row_pitch = map_desc->slice_pitch = buffer_gl->b.desc.byte_width; + map_desc->row_pitch = map_desc->slice_pitch = resource->size; return wined3d_buffer_gl_map(buffer_gl, offset, size, (BYTE **)&map_desc->data, flags); }
@@ -1385,8 +1385,8 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d WARN("Failed to initialize resource, hr %#x.\n", hr); return hr; } - buffer->desc = *desc; buffer->bind_flags = desc->bind_flags; + buffer->structure_byte_stride = desc->structure_byte_stride; buffer->locations = data ? WINED3D_LOCATION_DISCARDED : WINED3D_LOCATION_SYSMEM;
TRACE("buffer %p, size %#x, usage %#x, format %s, memory @ %p.\n", diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 004611eb2c7..59a30eadf53 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -110,7 +110,7 @@ static const struct wined3d_format *validate_resource_view(const struct wined3d_ struct wined3d_buffer *buffer = buffer_from_resource(resource); unsigned int buffer_size, element_size;
- if (buffer->desc.structure_byte_stride) + if (buffer->structure_byte_stride) { if (desc->format_id != WINED3DFMT_UNKNOWN) { @@ -119,7 +119,7 @@ static const struct wined3d_format *validate_resource_view(const struct wined3d_ }
format = wined3d_get_format(adapter, WINED3DFMT_R32_UINT, resource->usage); - element_size = buffer->desc.structure_byte_stride; + element_size = buffer->structure_byte_stride; } else { @@ -293,8 +293,8 @@ static void get_buffer_view_range(const struct wined3d_buffer *buffer, { if (desc->format_id == WINED3DFMT_UNKNOWN) { - *offset = desc->u.buffer.start_idx * buffer->desc.structure_byte_stride; - *size = desc->u.buffer.count * buffer->desc.structure_byte_stride; + *offset = desc->u.buffer.start_idx * buffer->structure_byte_stride; + *size = desc->u.buffer.count * buffer->structure_byte_stride; } else { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 84bf14d51f4..87541aa545e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3772,9 +3772,8 @@ struct wined3d_buffer { struct wined3d_resource resource;
- struct wined3d_buffer_desc desc; - unsigned int bind_flags; + unsigned int structure_byte_stride; DWORD flags; DWORD locations; void *map_ptr;
Hi,
While running your changed tests on Windows, 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=43664
Your paranoid android.
=== debian9 (build log) ===
Global symbol "$Running" requires explicit package name (did you forget to declare "my $Running"?) at ../bin/build/WineTest.pl line 87.
=== debian9 (build log) ===
Global symbol "$Running" requires explicit package name (did you forget to declare "my $Running"?) at ../bin/build/WineTest.pl line 87.