Commit 6cab4c80 authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

wined3d: Move binding the texture and dirtifying the sampler to its own function…

wined3d: Move binding the texture and dirtifying the sampler to its own function from surface_download_data().
parent 2820ecc5
...@@ -36,6 +36,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); ...@@ -36,6 +36,17 @@ 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 void surface_bind_and_dirtify(IWineD3DSurfaceImpl *This) {
/* Make sure that a proper texture unit is selected, bind the texture
* and dirtify the sampler to restore the texture on the next draw. */
if (GL_SUPPORT(ARB_MULTITEXTURE)) {
GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB));
checkGLcall("glActiveTextureARB");
}
IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(0));
IWineD3DSurface_BindTexture((IWineD3DSurface *)This);
}
static void surface_download_data(IWineD3DSurfaceImpl *This) { static void surface_download_data(IWineD3DSurfaceImpl *This) {
IWineD3DDeviceImpl *myDevice = This->resource.wineD3DDevice; IWineD3DDeviceImpl *myDevice = This->resource.wineD3DDevice;
...@@ -52,15 +63,8 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) { ...@@ -52,15 +63,8 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) {
} }
ENTER_GL(); ENTER_GL();
/* Make sure that a proper texture unit is selected, bind the texture
* and dirtify the sampler to restore the texture on the next draw surface_bind_and_dirtify(This);
*/
if (GL_SUPPORT(ARB_MULTITEXTURE)) {
GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB));
checkGLcall("glActiveTextureARB");
}
IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(0));
IWineD3DSurface_BindTexture((IWineD3DSurface *) This);
if (This->resource.format == WINED3DFMT_DXT1 || if (This->resource.format == WINED3DFMT_DXT1 ||
This->resource.format == WINED3DFMT_DXT2 || This->resource.format == WINED3DFMT_DXT3 || This->resource.format == WINED3DFMT_DXT2 || This->resource.format == WINED3DFMT_DXT3 ||
......
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