Module: wine Branch: master Commit: 37e8cf5d451e2d166aacfba5e1826197cac489c5 URL: https://source.winehq.org/git/wine.git/?a=commit;h=37e8cf5d451e2d166aacfba5e...
Author: Chip Davis cdavis@codeweavers.com Date: Tue Mar 31 19:57:19 2020 +0430
d3d8: Introduce a helper to convert d3d8 render states to wined3d states.
Signed-off-by: Chip Davis cdavis@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/d3d8/device.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 5f929ec0cc..ea1aec1f6b 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -442,6 +442,13 @@ static enum wined3d_transform_state wined3d_transform_state_from_d3d(D3DTRANSFOR return (enum wined3d_transform_state)state; }
+static enum wined3d_render_state wined3d_render_state_from_d3d(D3DRENDERSTATETYPE state) +{ + if (state == D3DRS_ZBIAS) + return WINED3D_RS_DEPTHBIAS; + return (enum wined3d_render_state)state; +} + /* Handle table functions */ static DWORD d3d8_allocate_handle(struct d3d8_handle_table *t, void *object, enum d3d8_handle_type type) { @@ -1910,9 +1917,7 @@ static HRESULT WINAPI d3d8_device_SetRenderState(IDirect3DDevice8 *iface, TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
wined3d_mutex_lock(); - if (state == D3DRS_ZBIAS) - state = WINED3D_RS_DEPTHBIAS; - wined3d_stateblock_set_render_state(device->update_state, state, value); + wined3d_stateblock_set_render_state(device->update_state, wined3d_render_state_from_d3d(state), value); if (state == D3DRS_POINTSIZE && value == D3D8_RESZ_CODE) resolve_depth_buffer(device); wined3d_mutex_unlock();