Module: wine
Branch: master
Commit: d49c9bbcbe5b2461ca685f45da740b8f0ff400c8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d49c9bbcbe5b2461ca685f45d…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Mon Feb 11 01:18:06 2008 +0100
wined3d: Do not change the texture unit when binding surfaces.
Changing the texture unit when binding a surface for loading can break
the state manager in the way that it changes the currently active
texture unit while it is setting up a texture that has to be loaded.
Instead find out the current unit to dirtify the correct sampler.
---
dlls/wined3d/surface.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 5f8fd93..be464eb 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -38,13 +38,21 @@ static void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4]
static inline void clear_unused_channels(IWineD3DSurfaceImpl *This);
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. */
+ GLint active_texture;
+
+ /* We don't need a specific texture unit, but after binding the texture the current unit is dirty.
+ * Read the unit back instead of switching to 0, this avoids messing around with the state manager's
+ * gl states. The current texture unit should always be a valid one.
+ *
+ * TODO: Track the current active texture per GL context instead of using glGet
+ */
if (GL_SUPPORT(ARB_MULTITEXTURE)) {
- GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB));
- checkGLcall("glActiveTextureARB");
+ glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture);
+ active_texture -= GL_TEXTURE0_ARB;
+ } else {
+ active_texture = 0;
}
- IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(0));
+ IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(active_texture));
IWineD3DSurface_BindTexture((IWineD3DSurface *)This);
}
Module: wine
Branch: master
Commit: 628183c2f9e3e82462e0625407877898636726df
URL: http://source.winehq.org/git/wine.git/?a=commit;h=628183c2f9e3e82462e062540…
Author: Rob Shearman <rob(a)codeweavers.com>
Date: Sat Feb 16 15:36:13 2008 +0000
advapi32: Document that the cbData parameter of RegSetValueA/W is ignored.
---
dlls/advapi32/registry.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index dbc7723..40994fc 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -1065,7 +1065,7 @@ LSTATUS WINAPI RegSetValueExA( HKEY hkey, LPCSTR name, DWORD reserved, DWORD typ
* lpSubKey [I] Name of a subkey of hKey.
* dwType [I] Type of information to store.
* lpData [I] String that contains the data to set for the default value.
- * cbData [I] Size of lpData.
+ * cbData [I] Ignored.
*
* RETURNS
* Success: ERROR_SUCCESS