Henri Verbeet : wined3d: Pass a texture and sub-resource index to wined3d_volume_srgb_transfer().
Alexandre Julliard
julliard at winehq.org
Thu Jul 28 09:38:54 CDT 2016
Module: wine
Branch: master
Commit: d262a183116dedfbeedc2d1ec2ea597673bfcd86
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d262a183116dedfbeedc2d1ec2ea597673bfcd86
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu Jul 28 13:29:39 2016 +0200
wined3d: Pass a texture and sub-resource index to wined3d_volume_srgb_transfer().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/volume.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 72ebd19..2e38aa7 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -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
{
More information about the wine-cvs
mailing list