Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/stateblock.c | 9 +++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 1 + 3 files changed, 11 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 98986c735b..24fd551adc 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1537,6 +1537,15 @@ HRESULT CDECL wined3d_stateblock_set_clip_plane(struct wined3d_stateblock *state return S_OK; }
+void CDECL wined3d_stateblock_set_material(struct wined3d_stateblock *stateblock, + const struct wined3d_material *material) +{ + TRACE("stateblock %p, material %p.\n", stateblock, material); + + stateblock->stateblock_state.material = *material; + stateblock->changed.material = TRUE; +} + 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 43b6112714..4f3cdf9b7b 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -265,6 +265,7 @@ @ 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_material(ptr 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 fabcdcb0d7..27a0e58a28 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2670,6 +2670,7 @@ void __cdecl wined3d_stateblock_set_blend_factor(struct wined3d_stateblock *stat 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_material(struct wined3d_stateblock *stateblock, const struct wined3d_material *material); 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 7b9be1fc46..7224c31e6e 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2158,7 +2158,9 @@ static HRESULT WINAPI d3d9_device_SetMaterial(IDirect3DDevice9Ex *iface, const D
/* Note: D3DMATERIAL9 is compatible with struct wined3d_material. */ wined3d_mutex_lock(); - wined3d_device_set_material(device->wined3d_device, (const struct wined3d_material *)material); + 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
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 680c75cb0f..0aa326fad5 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1717,7 +1717,9 @@ static HRESULT WINAPI d3d8_device_SetMaterial(IDirect3DDevice8 *iface, const D3D
/* Note: D3DMATERIAL8 is compatible with struct wined3d_material. */ wined3d_mutex_lock(); - wined3d_device_set_material(device->wined3d_device, (const struct wined3d_material *)material); + 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;
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=58776
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 WoW 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 525dd98d78..cef865948b 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -5448,7 +5448,9 @@ static HRESULT d3d_device7_SetMaterial(IDirect3DDevice7 *iface, D3DMATERIAL7 *ma
wined3d_mutex_lock(); /* Note: D3DMATERIAL7 is compatible with struct wined3d_material. */ - wined3d_device_set_material(device->wined3d_device, (struct wined3d_material *)material); + 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