Henri Verbeet : wined3d: Pass wined3d_ivec4 structures to wined3d_device_get_vs_consts_i().
Alexandre Julliard
julliard at wine.codeweavers.com
Tue May 17 11:19:39 CDT 2016
Module: wine
Branch: master
Commit: 3ae7ab95838837a64b6226efc6778d271f2bed6d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3ae7ab95838837a64b6226efc6778d271f2bed6d
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Tue May 17 14:01:51 2016 +0200
wined3d: Pass wined3d_ivec4 structures to wined3d_device_get_vs_consts_i().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d9/device.c | 3 ++-
dlls/wined3d/device.c | 14 +++++++-------
dlls/wined3d/wined3d.spec | 2 +-
include/wine/wined3d.h | 2 +-
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 0c099e0..8f46fcd 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -2868,7 +2868,8 @@ static HRESULT WINAPI d3d9_device_GetVertexShaderConstantI(IDirect3DDevice9Ex *i
TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
wined3d_mutex_lock();
- hr = wined3d_device_get_vs_consts_i(device->wined3d_device, reg_idx, data, count);
+ hr = wined3d_device_get_vs_consts_i(device->wined3d_device,
+ reg_idx, count, (struct wined3d_ivec4 *)data);
wined3d_mutex_unlock();
return hr;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 59a5c8c..19e819c 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2452,17 +2452,17 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device,
}
HRESULT CDECL wined3d_device_get_vs_consts_i(const struct wined3d_device *device,
- UINT start_register, int *constants, UINT vector4i_count)
+ unsigned int start_idx, unsigned int count, struct wined3d_ivec4 *constants)
{
- UINT count = min(vector4i_count, WINED3D_MAX_CONSTS_I - start_register);
-
- TRACE("device %p, start_register %u, constants %p, vector4i_count %u.\n",
- device, start_register, constants, vector4i_count);
+ TRACE("device %p, start_idx %u, count %u, constants %p.\n",
+ device, start_idx, count, constants);
- if (!constants || start_register >= WINED3D_MAX_CONSTS_I)
+ if (!constants || start_idx >= WINED3D_MAX_CONSTS_I)
return WINED3DERR_INVALIDCALL;
- memcpy(constants, &device->state.vs_consts_i[start_register], count * sizeof(int) * 4);
+ if (count > WINED3D_MAX_CONSTS_I - start_idx)
+ count = WINED3D_MAX_CONSTS_I - start_idx;
+ memcpy(constants, &device->state.vs_consts_i[start_idx], count * sizeof(*constants));
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 3831a65..d81e065 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -95,7 +95,7 @@
@ cdecl wined3d_device_get_vs_cb(ptr long)
@ cdecl wined3d_device_get_vs_consts_b(ptr long ptr long)
@ cdecl wined3d_device_get_vs_consts_f(ptr long long ptr)
-@ cdecl wined3d_device_get_vs_consts_i(ptr long ptr long)
+@ cdecl wined3d_device_get_vs_consts_i(ptr long long ptr)
@ cdecl wined3d_device_get_vs_resource_view(ptr long)
@ cdecl wined3d_device_get_vs_sampler(ptr long)
@ cdecl wined3d_device_get_wined3d(ptr)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 31aba7a..8ddf560 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2163,7 +2163,7 @@ HRESULT __cdecl wined3d_device_get_vs_consts_b(const struct wined3d_device *devi
HRESULT __cdecl wined3d_device_get_vs_consts_f(const struct wined3d_device *device,
unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants);
HRESULT __cdecl wined3d_device_get_vs_consts_i(const struct wined3d_device *device,
- UINT start_register, int *constants, UINT vector4i_count);
+ unsigned int start_idx, unsigned int count, struct wined3d_ivec4 *constants);
struct wined3d_shader_resource_view * __cdecl wined3d_device_get_vs_resource_view(const struct wined3d_device *device,
UINT idx);
struct wined3d_sampler * __cdecl wined3d_device_get_vs_sampler(const struct wined3d_device *device, UINT idx);
More information about the wine-cvs
mailing list