wined3d: Get rid of d3dfmt_get_conv in RealizePalette.
This commit is contained in:
parent
27a96e477a
commit
fb8812db89
|
@ -4354,20 +4354,11 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface)
|
||||||
|
|
||||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|
||||||
|| This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)
|
|| This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)
|
||||||
{
|
|
||||||
int bpp;
|
|
||||||
GLenum format, internal, type;
|
|
||||||
CONVERT_TYPES convert;
|
|
||||||
|
|
||||||
/* Check if we are using a RTL mode which uses texturing for uploads */
|
|
||||||
BOOL use_texture = (wined3d_settings.rendertargetlock_mode == RTL_READTEX);
|
|
||||||
|
|
||||||
/* Check if we have hardware palette conversion if we have convert is set to NO_CONVERSION */
|
|
||||||
d3dfmt_get_conv(This, TRUE, use_texture, &format, &internal, &type, &convert, &bpp, FALSE);
|
|
||||||
|
|
||||||
if((This->resource.usage & WINED3DUSAGE_RENDERTARGET) && (convert == NO_CONVERSION))
|
|
||||||
{
|
{
|
||||||
IWineD3DDeviceImpl *device = This->resource.device;
|
IWineD3DDeviceImpl *device = This->resource.device;
|
||||||
|
if((This->resource.usage & WINED3DUSAGE_RENDERTARGET) &&
|
||||||
|
device->blitter->color_fixup_supported(&device->adapter->gl_info, This->resource.format_desc->color_fixup))
|
||||||
|
{
|
||||||
struct wined3d_context *context;
|
struct wined3d_context *context;
|
||||||
|
|
||||||
/* Make sure the texture is up to date. This call doesn't do anything if the texture is already up to date. */
|
/* Make sure the texture is up to date. This call doesn't do anything if the texture is already up to date. */
|
||||||
|
@ -4378,7 +4369,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface)
|
||||||
|
|
||||||
/* Re-upload the palette */
|
/* Re-upload the palette */
|
||||||
context = context_acquire(device, NULL, CTXUSAGE_RESOURCELOAD);
|
context = context_acquire(device, NULL, CTXUSAGE_RESOURCELOAD);
|
||||||
d3dfmt_p8_upload_palette(iface, context->gl_info, convert);
|
d3dfmt_p8_upload_palette(iface, context->gl_info, NO_CONVERSION);
|
||||||
context_release(context);
|
context_release(context);
|
||||||
} else {
|
} else {
|
||||||
if(!(This->Flags & SFLAG_INSYSMEM)) {
|
if(!(This->Flags & SFLAG_INSYSMEM)) {
|
||||||
|
|
Loading…
Reference in New Issue