Commit d262a183 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass a texture and sub-resource index to wined3d_volume_srgb_transfer().

parent 858e0913
......@@ -141,12 +141,12 @@ static DWORD volume_access_from_location(DWORD location)
}
/* Context activation is done by the caller. */
static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume,
static void texture3d_srgb_transfer(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context, BOOL dest_is_srgb)
{
unsigned int sub_resource_idx = volume->texture_level;
struct wined3d_texture *texture = volume->container;
struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx];
struct wined3d_bo_address data;
/* Optimizations are possible, but the effort should be put into either
* implementing EXT_SRGB_DECODE in the driver or finding out why we
* picked the wrong copy for the original upload and fixing that.
......@@ -156,7 +156,7 @@ static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume,
WARN_(d3d_perf)("Performing slow rgb/srgb volume transfer.\n");
data.buffer_object = 0;
if (!(data.addr = HeapAlloc(GetProcessHeap(), 0, texture->sub_resources[sub_resource_idx].size)))
if (!(data.addr = HeapAlloc(GetProcessHeap(), 0, sub_resource->size)))
return;
wined3d_texture_bind_and_dirtify(texture, context, !dest_is_srgb);
......@@ -225,11 +225,11 @@ BOOL wined3d_volume_load_location(struct wined3d_volume *volume,
}
else if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
{
wined3d_volume_srgb_transfer(volume, context, TRUE);
texture3d_srgb_transfer(texture, sub_resource_idx, context, TRUE);
}
else if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_SRGB)
{
wined3d_volume_srgb_transfer(volume, context, FALSE);
texture3d_srgb_transfer(texture, sub_resource_idx, context, FALSE);
}
else
{
......
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