Commit 07079d11 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Remove locked and dirty boxes from volumes.

parent 518ac4c2
......@@ -1095,7 +1095,6 @@ static void texture3d_preload(struct wined3d_texture *texture, enum WINED3DSRGB
for (i = 0; i < texture->level_count; ++i)
{
struct wined3d_volume *volume = volume_from_resource(texture->sub_resources[i]);
volume_add_dirty_box(volume, NULL);
wined3d_volume_load(volume, context, texture->flags & WINED3D_TEXTURE_IS_SRGB);
}
}
......@@ -1113,7 +1112,6 @@ static void texture3d_preload(struct wined3d_texture *texture, enum WINED3DSRGB
static void texture3d_sub_resource_add_dirty_region(struct wined3d_resource *sub_resource,
const struct wined3d_box *dirty_region)
{
volume_add_dirty_box(volume_from_resource(sub_resource), dirty_region);
}
static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource)
......
......@@ -48,28 +48,6 @@ static void volume_bind_and_dirtify(const struct wined3d_volume *volume, struct
container->texture_ops->texture_bind(container, context, FALSE);
}
void volume_add_dirty_box(struct wined3d_volume *volume, const struct wined3d_box *dirty_box)
{
if (dirty_box)
{
volume->lockedBox.left = min(volume->lockedBox.left, dirty_box->left);
volume->lockedBox.top = min(volume->lockedBox.top, dirty_box->top);
volume->lockedBox.front = min(volume->lockedBox.front, dirty_box->front);
volume->lockedBox.right = max(volume->lockedBox.right, dirty_box->right);
volume->lockedBox.bottom = max(volume->lockedBox.bottom, dirty_box->bottom);
volume->lockedBox.back = max(volume->lockedBox.back, dirty_box->back);
}
else
{
volume->lockedBox.left = 0;
volume->lockedBox.top = 0;
volume->lockedBox.front = 0;
volume->lockedBox.right = volume->resource.width;
volume->lockedBox.bottom = volume->resource.height;
volume->lockedBox.back = volume->resource.depth;
}
}
void volume_set_container(struct wined3d_volume *volume, struct wined3d_texture *container)
{
TRACE("volume %p, container %p.\n", volume, container);
......@@ -248,12 +226,6 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
{
TRACE("No box supplied - all is ok\n");
map_desc->data = volume->resource.allocatedMemory;
volume->lockedBox.left = 0;
volume->lockedBox.top = 0;
volume->lockedBox.front = 0;
volume->lockedBox.right = volume->resource.width;
volume->lockedBox.bottom = volume->resource.height;
volume->lockedBox.back = volume->resource.depth;
}
else
{
......@@ -263,17 +235,10 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
+ (map_desc->slice_pitch * box->front) /* FIXME: is front < back or vica versa? */
+ (map_desc->row_pitch * box->top)
+ (box->left * volume->resource.format->byte_count);
volume->lockedBox.left = box->left;
volume->lockedBox.top = box->top;
volume->lockedBox.front = box->front;
volume->lockedBox.right = box->right;
volume->lockedBox.bottom = box->bottom;
volume->lockedBox.back = box->back;
}
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
{
volume_add_dirty_box(volume, &volume->lockedBox);
wined3d_texture_set_dirty(volume->container, TRUE);
}
......@@ -301,7 +266,6 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
}
volume->flags &= ~WINED3D_VFLAG_LOCKED;
memset(&volume->lockedBox, 0, sizeof(volume->lockedBox));
return WINED3D_OK;
}
......@@ -337,12 +301,8 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_device
return hr;
}
memset(&volume->lockedBox, 0, sizeof(volume->lockedBox));
volume_add_dirty_box(volume, NULL);
volume->texture_level = level;
return WINED3D_OK;
}
......
......@@ -2058,9 +2058,6 @@ struct wined3d_volume
struct wined3d_resource resource;
struct wined3d_texture *container;
struct wined3d_box lockedBox;
struct wined3d_box dirtyBox;
DWORD flags;
GLint texture_level;
};
......@@ -2070,7 +2067,6 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc
return CONTAINING_RECORD(resource, struct wined3d_volume, resource);
}
void volume_add_dirty_box(struct wined3d_volume *volume, const struct wined3d_box *dirty_box) DECLSPEC_HIDDEN;
void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) DECLSPEC_HIDDEN;
void volume_set_container(struct wined3d_volume *volume, struct wined3d_texture *container) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment