wined3d: Implement support for gamma corrected (sRGB) texture loading

H. Verbeet hverbeet at
Sun May 27 05:04:37 CDT 2007

On 27/05/07, Phil Costin <philcostin at> wrote:
> Hi,
> This patch has been a long time in the making. The following test was used
> during the creation of the patch:
If it's not too much trouble, a proper wine test would be nice.

The changes to surface_upload_data and surface_download_data look like
they should be separate changes.

In cubetexture.c, and similar code in texture.c and volume.c:
> +    } else if (GL_SUPPORT(EXT_TEXTURE_SRGB) && This->baseTexture.bindCount > 0) {
> +        currentSrgbMode = This->resource.wineD3DDevice->stateBlock->samplerState[This->baseTexture.sampler][WINED3DSAMP_SRGBTEXTURE];
> +        srgbModeChanged = (This->baseTexture.srgbWhenLoaded != currentSrgbMode);
> +        This->baseTexture.srgbWhenLoaded = currentSrgbMode;
You've got "device" here, no need to use "This->resource.wineD3DDevice"

sRGBmode looks a bit awkward as a variable name, I'd rather see
something like srgb_mode, but I guess that's more a personal

It would also probably be better to submit/commit this right after a
release instead of right before one.

More information about the wine-patches mailing list