Commit f04d870a authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

wined3d: Remove a PBO when a converted surface is detected.

This can happen e.g. when suddenly color keying is activated and at some stages we don't know if we will need conversion at PBO creation time.
parent 0efefef3
...@@ -36,6 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); ...@@ -36,6 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface);
HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UINT height, UINT outpitch, CONVERT_TYPES convert, IWineD3DSurfaceImpl *surf); HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UINT height, UINT outpitch, CONVERT_TYPES convert, IWineD3DSurfaceImpl *surf);
static void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4], BOOL colorkey); static void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4], BOOL colorkey);
static inline void clear_unused_channels(IWineD3DSurfaceImpl *This); static inline void clear_unused_channels(IWineD3DSurfaceImpl *This);
static void surface_remove_pbo(IWineD3DSurfaceImpl *This);
static void surface_bind_and_dirtify(IWineD3DSurfaceImpl *This) { static void surface_bind_and_dirtify(IWineD3DSurfaceImpl *This) {
GLint active_texture; GLint active_texture;
...@@ -4038,6 +4039,13 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D ...@@ -4038,6 +4039,13 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
width = This->currentDesc.Width; width = This->currentDesc.Width;
pitch = IWineD3DSurface_GetPitch(iface); pitch = IWineD3DSurface_GetPitch(iface);
/* Don't use PBOs for converted surfaces. During PBO conversion we look at SFLAG_CONVERTED
* but it isn't set (yet) in all cases it is getting called. */
if((convert != NO_CONVERSION) && (This->Flags & SFLAG_PBO)) {
TRACE("Removing the pbo attached to surface %p\n", This);
surface_remove_pbo(This);
}
if((convert != NO_CONVERSION) && This->resource.allocatedMemory) { if((convert != NO_CONVERSION) && This->resource.allocatedMemory) {
int height = This->currentDesc.Height; int height = This->currentDesc.Height;
...@@ -4092,6 +4100,13 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D ...@@ -4092,6 +4100,13 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
width = This->currentDesc.Width; width = This->currentDesc.Width;
pitch = IWineD3DSurface_GetPitch(iface); pitch = IWineD3DSurface_GetPitch(iface);
/* Don't use PBOs for converted surfaces. During PBO conversion we look at SFLAG_CONVERTED
* but it isn't set (yet) in all cases it is getting called. */
if((convert != NO_CONVERSION) && (This->Flags & SFLAG_PBO)) {
TRACE("Removing the pbo attached to surface %p\n", This);
surface_remove_pbo(This);
}
if((convert != NO_CONVERSION) && This->resource.allocatedMemory) { if((convert != NO_CONVERSION) && This->resource.allocatedMemory) {
int height = This->currentDesc.Height; int height = This->currentDesc.Height;
......
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