wined3d: Get rid of the "desc" field in struct wined3d_buffer.
Most of the information in "desc" is already stored in the wined3d_resource structure. Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f8ba91ac75
commit
22b3a4f044
|
@ -1302,7 +1302,7 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc
|
||||||
offset = size = 0;
|
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);
|
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);
|
WARN("Failed to initialize resource, hr %#x.\n", hr);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
buffer->desc = *desc;
|
|
||||||
buffer->bind_flags = desc->bind_flags;
|
buffer->bind_flags = desc->bind_flags;
|
||||||
|
buffer->structure_byte_stride = desc->structure_byte_stride;
|
||||||
buffer->locations = data ? WINED3D_LOCATION_DISCARDED : WINED3D_LOCATION_SYSMEM;
|
buffer->locations = data ? WINED3D_LOCATION_DISCARDED : WINED3D_LOCATION_SYSMEM;
|
||||||
|
|
||||||
TRACE("buffer %p, size %#x, usage %#x, format %s, memory @ %p.\n",
|
TRACE("buffer %p, size %#x, usage %#x, format %s, memory @ %p.\n",
|
||||||
|
|
|
@ -110,7 +110,7 @@ static const struct wined3d_format *validate_resource_view(const struct wined3d_
|
||||||
struct wined3d_buffer *buffer = buffer_from_resource(resource);
|
struct wined3d_buffer *buffer = buffer_from_resource(resource);
|
||||||
unsigned int buffer_size, element_size;
|
unsigned int buffer_size, element_size;
|
||||||
|
|
||||||
if (buffer->desc.structure_byte_stride)
|
if (buffer->structure_byte_stride)
|
||||||
{
|
{
|
||||||
if (desc->format_id != WINED3DFMT_UNKNOWN)
|
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);
|
format = wined3d_get_format(adapter, WINED3DFMT_R32_UINT, resource->usage);
|
||||||
element_size = buffer->desc.structure_byte_stride;
|
element_size = buffer->structure_byte_stride;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -293,8 +293,8 @@ static void get_buffer_view_range(const struct wined3d_buffer *buffer,
|
||||||
{
|
{
|
||||||
if (desc->format_id == WINED3DFMT_UNKNOWN)
|
if (desc->format_id == WINED3DFMT_UNKNOWN)
|
||||||
{
|
{
|
||||||
*offset = desc->u.buffer.start_idx * buffer->desc.structure_byte_stride;
|
*offset = desc->u.buffer.start_idx * buffer->structure_byte_stride;
|
||||||
*size = desc->u.buffer.count * buffer->desc.structure_byte_stride;
|
*size = desc->u.buffer.count * buffer->structure_byte_stride;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -3772,9 +3772,8 @@ struct wined3d_buffer
|
||||||
{
|
{
|
||||||
struct wined3d_resource resource;
|
struct wined3d_resource resource;
|
||||||
|
|
||||||
struct wined3d_buffer_desc desc;
|
|
||||||
|
|
||||||
unsigned int bind_flags;
|
unsigned int bind_flags;
|
||||||
|
unsigned int structure_byte_stride;
|
||||||
DWORD flags;
|
DWORD flags;
|
||||||
DWORD locations;
|
DWORD locations;
|
||||||
void *map_ptr;
|
void *map_ptr;
|
||||||
|
|
Loading…
Reference in New Issue