Module: wine Branch: master Commit: 6e4c40689cf72fe5a7e3e38f5367b1152e756387 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6e4c40689cf72fe5a7e3e38f53...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Sep 25 10:34:43 2012 +0200
wined3d: Just return the shader from wined3d_device_get_pixel_shader().
---
dlls/d3d8/device.c | 10 ++-------- dlls/d3d9/device.c | 4 +--- dlls/wined3d/device.c | 9 +-------- 3 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index a313654..4a96c2f 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2463,7 +2463,6 @@ static HRESULT WINAPI d3d8_device_GetPixelShader(IDirect3DDevice8 *iface, DWORD { struct d3d8_pixel_shader *d3d8_shader; d3d8_shader = wined3d_shader_get_parent(object); - wined3d_shader_decref(object); *shader = d3d8_shader->handle; } else @@ -2481,7 +2480,6 @@ static HRESULT WINAPI d3d8_device_DeletePixelShader(IDirect3DDevice8 *iface, DWO { struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); struct d3d8_pixel_shader *shader_impl; - struct wined3d_shader *cur;
TRACE("iface %p, shader %#x.\n", iface, shader);
@@ -2494,12 +2492,8 @@ static HRESULT WINAPI d3d8_device_DeletePixelShader(IDirect3DDevice8 *iface, DWO return D3DERR_INVALIDCALL; }
- if ((cur = wined3d_device_get_pixel_shader(device->wined3d_device))) - { - if (cur == shader_impl->wined3d_shader) - IDirect3DDevice8_SetPixelShader(iface, 0); - wined3d_shader_decref(cur); - } + if (wined3d_device_get_pixel_shader(device->wined3d_device) == shader_impl->wined3d_shader) + IDirect3DDevice8_SetPixelShader(iface, 0);
wined3d_mutex_unlock();
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index c166ad4..d194642 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2586,13 +2586,11 @@ static HRESULT WINAPI d3d9_device_GetPixelShader(IDirect3DDevice9Ex *iface, IDir if (!shader) return D3DERR_INVALIDCALL;
wined3d_mutex_lock(); - wined3d_shader = wined3d_device_get_pixel_shader(device->wined3d_device); - if (wined3d_shader) + if ((wined3d_shader = wined3d_device_get_pixel_shader(device->wined3d_device))) { shader_impl = wined3d_shader_get_parent(wined3d_shader); *shader = &shader_impl->IDirect3DPixelShader9_iface; IDirect3DPixelShader9_AddRef(*shader); - wined3d_shader_decref(wined3d_shader); } else { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 19e21a0..0d78257 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2862,16 +2862,9 @@ void CDECL wined3d_device_set_pixel_shader(struct wined3d_device *device, struct
struct wined3d_shader * CDECL wined3d_device_get_pixel_shader(const struct wined3d_device *device) { - struct wined3d_shader *shader; - TRACE("device %p.\n", device);
- shader = device->stateBlock->state.pixel_shader; - if (shader) - wined3d_shader_incref(shader); - - TRACE("Returning %p.\n", shader); - return shader; + return device->stateBlock->state.pixel_shader; }
HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device,