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

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-07-28 13:29:39 +02:00 committed by Alexandre Julliard
parent 858e091389
commit d262a18311
1 changed files with 6 additions and 6 deletions

View File

@ -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
{