Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 5e18f64550..8ce38e2d9e 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1636,7 +1636,7 @@ static HRESULT WINAPI d3d8_device_GetTransform(IDirect3DDevice8 *iface,
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); - wined3d_device_get_transform(device->wined3d_device, state, (struct wined3d_matrix *)matrix); + memcpy(matrix, &wined3d_stateblock_get_state(device->state)->transforms[state], sizeof(*matrix)); wined3d_mutex_unlock();
return D3D_OK;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 8ce38e2d9e..725286cd16 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1620,8 +1620,6 @@ static HRESULT WINAPI d3d8_device_SetTransform(IDirect3DDevice8 *iface, /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); wined3d_stateblock_set_transform(device->update_state, state, (const struct wined3d_matrix *)matrix); - if (!device->recording) - wined3d_device_set_transform(device->wined3d_device, state, (const struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK; @@ -1652,7 +1650,6 @@ static HRESULT WINAPI d3d8_device_MultiplyTransform(IDirect3DDevice8 *iface, /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); wined3d_stateblock_multiply_transform(device->state, state, (const struct wined3d_matrix *)matrix); - wined3d_device_multiply_transform(device->wined3d_device, state, (const struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/d3d8_private.h | 2 +- dlls/d3d8/device.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index 0fcc8bd7a0..9bf92af7c9 100644 --- a/dlls/d3d8/d3d8_private.h +++ b/dlls/d3d8/d3d8_private.h @@ -131,7 +131,7 @@ struct d3d8_device DWORD in_destruction : 1; DWORD padding : 14;
- unsigned int vs_uniform_count; + unsigned int max_user_clip_planes, vs_uniform_count;
/* The d3d8 API supports only one implicit swapchain (no D3DCREATE_ADAPTERGROUP_DEVICE, * no GetSwapchain, GetBackBuffer doesn't accept a swapchain number). */ diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 725286cd16..17ce954a7d 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1829,15 +1829,20 @@ static HRESULT WINAPI d3d8_device_SetClipPlane(IDirect3DDevice8 *iface, DWORD in static HRESULT WINAPI d3d8_device_GetClipPlane(IDirect3DDevice8 *iface, DWORD index, float *plane) { struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); - HRESULT hr;
TRACE("iface %p, index %u, plane %p.\n", iface, index, plane);
+ if (index >= device->max_user_clip_planes) + { + TRACE("Plane %u requested, but only %u planes are supported.\n", index, device->max_user_clip_planes); + return WINED3DERR_INVALIDCALL; + } + wined3d_mutex_lock(); - hr = wined3d_device_get_clip_plane(device->wined3d_device, index, (struct wined3d_vec4 *)plane); + memcpy(plane, &wined3d_stateblock_get_state(device->state)->clip_planes[index], sizeof(struct wined3d_vec4)); wined3d_mutex_unlock();
- return hr; + return D3D_OK; }
static void resolve_depth_buffer(struct d3d8_device *device) @@ -3710,6 +3715,7 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine }
wined3d_get_device_caps(wined3d, adapter, device_type, &caps); + device->max_user_clip_planes = caps.MaxUserClipPlanes; device->vs_uniform_count = caps.MaxVertexShaderConst;
if (FAILED(hr = wined3d_stateblock_create(device->wined3d_device, NULL, WINED3D_SBT_PRIMARY, &device->state)))
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 17ce954a7d..aaf5b62e86 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1819,8 +1819,6 @@ static HRESULT WINAPI d3d8_device_SetClipPlane(IDirect3DDevice8 *iface, DWORD in
wined3d_mutex_lock(); hr = wined3d_stateblock_set_clip_plane(device->update_state, index, (const struct wined3d_vec4 *)plane); - if (SUCCEEDED(hr) && !device->recording) - hr = wined3d_device_set_clip_plane(device->wined3d_device, index, (const struct wined3d_vec4 *)plane); wined3d_mutex_unlock();
return hr;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index aaf5b62e86..8fe43c0cca 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1742,7 +1742,7 @@ static HRESULT WINAPI d3d8_device_GetMaterial(IDirect3DDevice8 *iface, D3DMATERI
/* Note: D3DMATERIAL8 is compatible with struct wined3d_material. */ wined3d_mutex_lock(); - wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material); + memcpy(material, &wined3d_stateblock_get_state(device->state)->material, sizeof(*material)); wined3d_mutex_unlock();
return D3D_OK;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 8fe43c0cca..e7c79d54a0 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1727,8 +1727,6 @@ static HRESULT WINAPI d3d8_device_SetMaterial(IDirect3DDevice8 *iface, const D3D /* Note: D3DMATERIAL8 is compatible with struct wined3d_material. */ wined3d_mutex_lock(); wined3d_stateblock_set_material(device->update_state, (const struct wined3d_material *)material); - if (!device->recording) - wined3d_device_set_material(device->wined3d_device, (const struct wined3d_material *)material); wined3d_mutex_unlock();
return D3D_OK;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com