Commit 88a2decc authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Source and destination formats should match in IWineD3DDeviceImpl_UpdateSurface().

parent 0eae42dd
......@@ -5194,6 +5194,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
return WINED3DERR_INVALIDCALL;
}
if (srcFormat != destFormat)
{
WARN("Source and destination surfaces should have the same format.\n");
return WINED3DERR_INVALIDCALL;
}
/* This call loads the opengl surface directly, instead of copying the surface to the
* destination's sysmem copy. If surface conversion is needed, use BltFast instead to
* copy in sysmem and use regular surface loading.
......@@ -5206,14 +5212,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
pSourceSurface, pSourceRect, 0);
}
if (destFormat == WINED3DFMT_UNKNOWN) {
TRACE("(%p) : Converting destination surface from WINED3DFMT_UNKNOWN to the source format\n", This);
IWineD3DSurface_SetFormat(pDestinationSurface, srcFormat);
/* Get the update surface description */
IWineD3DSurface_GetDesc(pDestinationSurface, &winedesc);
}
context = context_acquire(This, NULL, CTXUSAGE_RESOURCELOAD);
ENTER_GL();
......@@ -5292,15 +5290,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
/* FIXME: The easy way to do this is to lock the destination, and copy the bits across. */
FIXME("Updating part of a compressed texture is not supported.\n");
}
if (destFormat != srcFormat)
{
FIXME("Updating mixed format compressed textures is not supported.\n");
}
else
{
GL_EXTCALL(glCompressedTexImage2DARB(dst_impl->texture_target, dst_impl->texture_level,
dst_format_desc->glInternal, srcWidth, srcHeight, 0, destSize, data));
}
GL_EXTCALL(glCompressedTexImage2DARB(dst_impl->texture_target, dst_impl->texture_level,
dst_format_desc->glInternal, srcWidth, srcHeight, 0, destSize, data));
}
checkGLcall("glCompressedTexSubImage2DARB");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment