Module: wine Branch: master Commit: f6b5dc246a0d34779338be108d8a155d3bfce47e URL: http://source.winehq.org/git/wine.git/?a=commit;h=f6b5dc246a0d34779338be108d...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Fri Nov 22 10:45:04 2013 +0100
wined3d: Get rid of the WINED3DSRGB enum.
---
dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/context.c | 10 ++++------ dlls/wined3d/device.c | 2 +- dlls/wined3d/surface.c | 8 ++++---- dlls/wined3d/texture.c | 26 +++++--------------------- dlls/wined3d/wined3d_private.h | 9 +-------- 6 files changed, 16 insertions(+), 41 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 96bd1b6..470d9a0 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -7469,7 +7469,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter, src_rect.bottom = src_surface->resource.height - src_rect.bottom; } else - wined3d_texture_load(src_surface->container, context, SRGB_RGB); + wined3d_texture_load(src_surface->container, context, FALSE);
context_apply_blit_state(context, device);
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 3e62839..129926a 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2124,7 +2124,7 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wine
if (context->render_offscreen) { - wined3d_texture_load(rt->container, context, SRGB_RGB); + wined3d_texture_load(rt->container, context, FALSE);
context_apply_fbo_state_blit(context, GL_FRAMEBUFFER, rt, NULL, rt->draw_binding); if (rt->resource.format->id != WINED3DFMT_NULL) @@ -2791,13 +2791,11 @@ static void context_preload_texture(struct wined3d_context *context, const struct wined3d_state *state, unsigned int idx) { struct wined3d_texture *texture; - enum WINED3DSRGB srgb;
if (!(texture = state->textures[idx])) return;
- srgb = state->sampler_states[idx][WINED3D_SAMP_SRGB_TEXTURE] ? SRGB_SRGB : SRGB_RGB; - wined3d_texture_load(texture, context, srgb); + wined3d_texture_load(texture, context, state->sampler_states[idx][WINED3D_SAMP_SRGB_TEXTURE]); }
/* Context activation is done by the caller. */ @@ -2942,8 +2940,8 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
/* Read the back buffer of the old drawable into the destination texture. */ if (texture->texture_srgb.name) - wined3d_texture_load(texture, context, SRGB_SRGB); - wined3d_texture_load(texture, context, SRGB_RGB); + wined3d_texture_load(texture, context, TRUE); + wined3d_texture_load(texture, context, FALSE); surface_invalidate_location(context->current_rt, SFLAG_INDRAWABLE); } } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index ed5e61c..83b97e7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3402,7 +3402,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
/* Make sure that the destination texture is loaded. */ context = context_acquire(device, NULL); - wined3d_texture_load(dst_texture, context, SRGB_RGB); + wined3d_texture_load(dst_texture, context, FALSE); context_release(context);
/* Update every surface level of the texture. */ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index df83fc6..6f6b5de 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -4085,7 +4085,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc context = context_acquire(device, src_surface); gl_info = context->gl_info; context_apply_blit_state(context, device); - wined3d_texture_load(dst_surface->container, context, SRGB_RGB); + wined3d_texture_load(dst_surface->container, context, FALSE);
/* Bind the target texture */ context_bind_texture(context, dst_surface->container->target, dst_surface->container->texture_rgb.name); @@ -4193,14 +4193,14 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st context = context_acquire(device, src_surface); gl_info = context->gl_info; context_apply_blit_state(context, device); - wined3d_texture_load(dst_surface->container, context, SRGB_RGB); + wined3d_texture_load(dst_surface->container, context, FALSE);
src_offscreen = surface_is_offscreen(src_surface); noBackBufferBackup = src_offscreen && wined3d_settings.offscreen_rendering_mode == ORM_FBO; if (!noBackBufferBackup && !src_surface->container->texture_rgb.name) { /* Get it a description */ - wined3d_texture_load(src_surface->container, context, SRGB_RGB); + wined3d_texture_load(src_surface->container, context, FALSE); }
/* Try to use an aux buffer for drawing the rectangle. This way it doesn't need restoring. @@ -4489,7 +4489,7 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, /* Make sure the surface is up-to-date. This should probably use * surface_load_location() and worry about the destination surface too, * unless we're overwriting it completely. */ - wined3d_texture_load(src_surface->container, context, SRGB_RGB); + wined3d_texture_load(src_surface->container, context, FALSE);
/* Activate the destination context, set it up for blitting */ context_apply_blit_state(context, device); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 755335f..6256b91 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -510,35 +510,19 @@ DWORD CDECL wined3d_texture_get_priority(const struct wined3d_texture *texture)
/* Context activation is done by the caller */ void wined3d_texture_load(struct wined3d_texture *texture, - struct wined3d_context *context, enum WINED3DSRGB srgb) + struct wined3d_context *context, BOOL srgb) { UINT sub_count = texture->level_count * texture->layer_count; const struct wined3d_gl_info *gl_info = context->gl_info; - BOOL srgb_mode; DWORD flag; UINT i;
TRACE("texture %p, srgb %#x.\n", texture, srgb);
if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) - srgb = SRGB_RGB; - - switch (srgb) - { - case SRGB_RGB: - srgb_mode = FALSE; - break; - - case SRGB_SRGB: - srgb_mode = TRUE; - break; - - default: - srgb_mode = texture->flags & WINED3D_TEXTURE_IS_SRGB; - break; - } + srgb = FALSE;
- if (srgb_mode) + if (srgb) flag = WINED3D_TEXTURE_SRGB_VALID; else flag = WINED3D_TEXTURE_RGB_VALID; @@ -552,7 +536,7 @@ void wined3d_texture_load(struct wined3d_texture *texture, /* Reload the surfaces if the texture is marked dirty. */ for (i = 0; i < sub_count; ++i) { - texture->texture_ops->texture_sub_resource_load(texture->sub_resources[i], context, srgb_mode); + texture->texture_ops->texture_sub_resource_load(texture->sub_resources[i], context, srgb); } texture->flags |= flag; } @@ -561,7 +545,7 @@ void CDECL wined3d_texture_preload(struct wined3d_texture *texture) { struct wined3d_context *context; context = context_acquire(texture->resource.device, NULL); - wined3d_texture_load(texture, context, SRGB_ANY); + wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); context_release(context); }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 93e4a90..d7e1c5f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2043,13 +2043,6 @@ enum wined3d_texture_state MAX_WINETEXTURESTATES = 11, };
-enum WINED3DSRGB -{ - SRGB_ANY = 0, /* Uses the cached value(e.g. external calls) */ - SRGB_RGB = 1, /* Loads the rgb texture */ - SRGB_SRGB = 2, /* Loads the srgb texture */ -}; - struct gl_texture { DWORD states[MAX_WINETEXTURESTATES]; @@ -2108,7 +2101,7 @@ void wined3d_texture_bind(struct wined3d_texture *texture, void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_load(struct wined3d_texture *texture, - struct wined3d_context *context, enum WINED3DSRGB srgb) DECLSPEC_HIDDEN; + struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_set_dirty(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
#define WINED3D_VFLAG_ALLOCATED 0x00000001