Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/stateblock.c | 16 ++++++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 2 ++ 3 files changed, 19 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 41c97b5020..98986c735b 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1521,6 +1521,22 @@ void CDECL wined3d_stateblock_set_transform(struct wined3d_stateblock *statebloc stateblock->changed.transform[d3dts >> 5] |= 1u << (d3dts & 0x1f); }
+HRESULT CDECL wined3d_stateblock_set_clip_plane(struct wined3d_stateblock *stateblock, + UINT plane_idx, const struct wined3d_vec4 *plane) +{ + TRACE("stateblock %p, plane_idx %u, plane %p.\n", stateblock, plane_idx, plane); + + if (plane_idx >= stateblock->device->adapter->d3d_info.limits.max_clip_distances) + { + TRACE("Application has requested clipplane this device doesn't support.\n"); + return WINED3DERR_INVALIDCALL; + } + + stateblock->stateblock_state.clip_planes[plane_idx] = *plane; + stateblock->changed.clipplane |= 1u << plane_idx; + return S_OK; +} + static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info) { union diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 297d3a0410..2b5b6c7667 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -260,6 +260,7 @@ @ cdecl wined3d_stateblock_incref(ptr) @ cdecl wined3d_stateblock_reset(ptr) @ cdecl wined3d_stateblock_set_blend_factor(ptr ptr) +@ cdecl wined3d_stateblock_set_clip_plane(ptr long ptr) @ cdecl wined3d_stateblock_set_pixel_shader(ptr ptr) @ cdecl wined3d_stateblock_set_ps_consts_b(ptr long long ptr) @ cdecl wined3d_stateblock_set_ps_consts_f(ptr long long ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 298cb3b270..cedbb09eba 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2663,6 +2663,8 @@ ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock); void __cdecl wined3d_stateblock_reset(struct wined3d_stateblock *stateblock); void __cdecl wined3d_stateblock_set_blend_factor(struct wined3d_stateblock *stateblock, const struct wined3d_color *blend_factor); +HRESULT __cdecl wined3d_stateblock_set_clip_plane(struct wined3d_stateblock *stateblock, + UINT plane_idx, const struct wined3d_vec4 *plane); void __cdecl wined3d_stateblock_set_pixel_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader); HRESULT __cdecl wined3d_stateblock_set_ps_consts_b(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, const BOOL *constants);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index aa742c8c1f..7b9be1fc46 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2246,7 +2246,9 @@ static HRESULT WINAPI d3d9_device_SetClipPlane(IDirect3DDevice9Ex *iface, DWORD index = min(index, device->max_user_clip_planes - 1);
wined3d_mutex_lock(); - hr = wined3d_device_set_clip_plane(device->wined3d_device, index, (const struct wined3d_vec4 *)plane); + 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;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58680
Your paranoid android.
=== debian10 (32 bit WoW report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 90bcfae498..680c75cb0f 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1803,7 +1803,9 @@ static HRESULT WINAPI d3d8_device_SetClipPlane(IDirect3DDevice8 *iface, DWORD in TRACE("iface %p, index %u, plane %p.\n", iface, index, plane);
wined3d_mutex_lock(); - hr = wined3d_device_set_clip_plane(device->wined3d_device, index, (const struct wined3d_vec4 *)plane); + 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;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58682
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===
d3d8: device.c:3165: Test failed: Expected message 0x1c for window 0x1, but didn't receive it
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ddraw/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 599e45c24f..182fc18ae6 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -6528,7 +6528,9 @@ static HRESULT d3d_device7_SetClipPlane(IDirect3DDevice7 *iface, DWORD idx, D3DV wined3d_plane = (struct wined3d_vec4 *)plane;
wined3d_mutex_lock(); - hr = wined3d_device_set_clip_plane(device->wined3d_device, idx, wined3d_plane); + hr = wined3d_stateblock_set_clip_plane(device->update_state, idx, wined3d_plane); + if (!device->recording) + hr = wined3d_device_set_clip_plane(device->wined3d_device, idx, wined3d_plane); if (idx < ARRAY_SIZE(device->user_clip_planes)) { device->user_clip_planes[idx] = *wined3d_plane;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58683
Your paranoid android.
=== debian10 (32 bit report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
=== debian10 (32 bit Chinese:China report) ===
d3d8: device.c:3165: Test failed: Expected message 0x1c for window 0x1, but didn't receive it
=== debian10 (32 bit WoW report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
On Wed, 30 Oct 2019 at 05:28, Zebediah Figura z.figura12@gmail.com wrote:
wined3d_mutex_lock();
- hr = wined3d_device_set_clip_plane(device->wined3d_device, idx, wined3d_plane);
- hr = wined3d_stateblock_set_clip_plane(device->update_state, idx, wined3d_plane);
- if (!device->recording)
Shouldn't this check hr as well?