Commit 67ec18ba authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass wined3d_vec4 structures to wined3d_device_get_vs_consts_f().

parent d3a32607
...@@ -2457,7 +2457,7 @@ static HRESULT WINAPI d3d8_device_GetVertexShaderConstant(IDirect3DDevice8 *ifac ...@@ -2457,7 +2457,7 @@ static HRESULT WINAPI d3d8_device_GetVertexShaderConstant(IDirect3DDevice8 *ifac
} }
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_device_get_vs_consts_f(device->wined3d_device, start_register, data, count); hr = wined3d_device_get_vs_consts_f(device->wined3d_device, start_register, count, data);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -2836,7 +2836,8 @@ static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF(IDirect3DDevice9Ex *i ...@@ -2836,7 +2836,8 @@ static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF(IDirect3DDevice9Ex *i
} }
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_device_get_vs_consts_f(device->wined3d_device, reg_idx, data, count); hr = wined3d_device_get_vs_consts_f(device->wined3d_device,
reg_idx, count, (struct wined3d_vec4 *)data);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -2494,18 +2494,18 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, ...@@ -2494,18 +2494,18 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device,
} }
HRESULT CDECL wined3d_device_get_vs_consts_f(const struct wined3d_device *device, HRESULT CDECL wined3d_device_get_vs_consts_f(const struct wined3d_device *device,
UINT start_register, float *constants, UINT vector4f_count) unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants)
{ {
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
int count = min(vector4f_count, d3d_info->limits.vs_uniform_count - start_register);
TRACE("device %p, start_register %u, constants %p, vector4f_count %u.\n", TRACE("device %p, start_idx %u, count %u, constants %p.\n",
device, start_register, constants, vector4f_count); device, start_idx, count, constants);
if (!constants || count < 0) if (!constants || start_idx >= d3d_info->limits.vs_uniform_count
|| count > d3d_info->limits.vs_uniform_count - start_idx)
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
memcpy(constants, &device->state.vs_consts_f[start_register], count * sizeof(float) * 4); memcpy(constants, &device->state.vs_consts_f[start_idx], count * sizeof(*constants));
return WINED3D_OK; return WINED3D_OK;
} }
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
@ cdecl wined3d_device_get_viewport(ptr ptr) @ cdecl wined3d_device_get_viewport(ptr ptr)
@ cdecl wined3d_device_get_vs_cb(ptr long) @ 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_b(ptr long ptr long)
@ cdecl wined3d_device_get_vs_consts_f(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 ptr long)
@ cdecl wined3d_device_get_vs_resource_view(ptr long) @ cdecl wined3d_device_get_vs_resource_view(ptr long)
@ cdecl wined3d_device_get_vs_sampler(ptr long) @ cdecl wined3d_device_get_vs_sampler(ptr long)
......
...@@ -2153,7 +2153,7 @@ struct wined3d_buffer * __cdecl wined3d_device_get_vs_cb(const struct wined3d_de ...@@ -2153,7 +2153,7 @@ struct wined3d_buffer * __cdecl wined3d_device_get_vs_cb(const struct wined3d_de
HRESULT __cdecl wined3d_device_get_vs_consts_b(const struct wined3d_device *device, HRESULT __cdecl wined3d_device_get_vs_consts_b(const struct wined3d_device *device,
UINT start_register, BOOL *constants, UINT bool_count); UINT start_register, BOOL *constants, UINT bool_count);
HRESULT __cdecl wined3d_device_get_vs_consts_f(const struct wined3d_device *device, HRESULT __cdecl wined3d_device_get_vs_consts_f(const struct wined3d_device *device,
UINT start_register, float *constants, UINT vector4f_count); unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants);
HRESULT __cdecl wined3d_device_get_vs_consts_i(const 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); UINT start_register, int *constants, UINT vector4i_count);
struct wined3d_shader_resource_view * __cdecl wined3d_device_get_vs_resource_view(const struct wined3d_device *device, struct wined3d_shader_resource_view * __cdecl wined3d_device_get_vs_resource_view(const struct wined3d_device *device,
......
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