diff --git a/patches/d3d11-Depth_Bias/0002-d3d11-tests-Add-some-basic-depth-tests.patch b/patches/d3d11-Depth_Bias/0002-d3d11-tests-Add-some-basic-depth-tests.patch index fa6657bd..372a353d 100644 --- a/patches/d3d11-Depth_Bias/0002-d3d11-tests-Add-some-basic-depth-tests.patch +++ b/patches/d3d11-Depth_Bias/0002-d3d11-tests-Add-some-basic-depth-tests.patch @@ -1,17 +1,17 @@ -From 0ec24dc6590e24a868190811b74bd457d75ad0f5 Mon Sep 17 00:00:00 2001 +From 2c4ebd2e8f4cfdded1b93f26e74139e88ca94f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 7 Jul 2017 05:44:09 +0200 -Subject: d3d11/tests: Add some basic depth tests. +Subject: [PATCH 1/4] d3d11/tests: Add some basic depth tests. --- dlls/d3d11/tests/d3d11.c | 209 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 206 insertions(+), 3 deletions(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c -index 8df683ef1b8..77917f24769 100644 +index 5a36bc2..9d9d74b 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c -@@ -1346,8 +1346,9 @@ static void set_quad_color(struct d3d11_test_context *context, const struct vec4 +@@ -1458,8 +1458,9 @@ static void set_quad_color(struct d3d11_test_context *context, const struct vec4 (ID3D11Resource *)context->ps_cb, 0, NULL, color, 0, 0); } @@ -23,7 +23,7 @@ index 8df683ef1b8..77917f24769 100644 { static const DWORD ps_color_code[] = { -@@ -1389,7 +1390,7 @@ static void draw_color_quad_(unsigned int line, struct d3d11_test_context *conte +@@ -1501,7 +1502,7 @@ static void draw_color_quad_(unsigned int line, struct d3d11_test_context *conte set_quad_color(context, color); @@ -32,7 +32,7 @@ index 8df683ef1b8..77917f24769 100644 } static void test_create_device(void) -@@ -15213,6 +15214,207 @@ static void test_stencil_separate(void) +@@ -16776,6 +16777,207 @@ static void test_stencil_separate(void) release_test_context(&test_context); } @@ -207,7 +207,7 @@ index 8df683ef1b8..77917f24769 100644 + draw_color_quad_z(&test_context, &blue, 0.5f); + get_texture_readback(test_context.backbuffer, 0, &rb); + color = get_readback_color(&rb, 320, 240); -+ todo_wine ok(compare_color(color, blue_d, 1), "Got unexpected color 0x%08x.\n", color); ++ ok(compare_color(color, blue_d, 1), "Got unexpected color 0x%08x.\n", color); + release_resource_readback(&rb); + ID3D11RasterizerState_Release(rs); + rs_desc.DepthBias = -100005; @@ -217,7 +217,7 @@ index 8df683ef1b8..77917f24769 100644 + draw_color_quad_z(&test_context, &white, 0.5f); + get_texture_readback(test_context.backbuffer, 0, &rb); + color = get_readback_color(&rb, 320, 240); -+ todo_wine ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color); ++ ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color); + release_resource_readback(&rb); + ID3D11RasterizerState_Release(rs); + rs_desc.DepthBias = -99995; @@ -227,7 +227,7 @@ index 8df683ef1b8..77917f24769 100644 + draw_color_quad_z(&test_context, &green, 0.5f); + get_texture_readback(test_context.backbuffer, 0, &rb); + color = get_readback_color(&rb, 320, 240); -+ todo_wine ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color); ++ ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color); + release_resource_readback(&rb); + + ID3D11DepthStencilState_Release(ds_state); @@ -240,7 +240,7 @@ index 8df683ef1b8..77917f24769 100644 static void test_uav_load(void) { struct shader -@@ -21362,6 +21564,7 @@ START_TEST(d3d11) +@@ -25115,6 +25317,7 @@ START_TEST(d3d11) test_shader_input_registers_limits(); test_unbind_shader_resource_view(); test_stencil_separate(); @@ -249,5 +249,5 @@ index 8df683ef1b8..77917f24769 100644 test_cs_uav_store(); test_uav_store_immediate_constant(); -- -2.14.2 +2.7.4 diff --git a/patches/d3d11-Depth_Bias/0003-d3d11-Implement-depth-bias-and-slope.patch b/patches/d3d11-Depth_Bias/0003-d3d11-Implement-depth-bias-and-slope.patch deleted file mode 100644 index defac349..00000000 --- a/patches/d3d11-Depth_Bias/0003-d3d11-Implement-depth-bias-and-slope.patch +++ /dev/null @@ -1,137 +0,0 @@ -From 673399c500a4616d18443df206dbdb1d354f912b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Mon, 3 Jul 2017 00:21:12 +0200 -Subject: d3d11: Implement depth bias and slope. - ---- - dlls/d3d11/device.c | 13 ++++++++++--- - dlls/d3d11/tests/d3d11.c | 6 +++--- - dlls/dxgi/factory.c | 2 +- - dlls/wined3d/state.c | 6 ++++++ - include/wine/wined3d.h | 1 + - 5 files changed, 21 insertions(+), 7 deletions(-) - -diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c -index 08a98626f28..4c46c9f235b 100644 ---- a/dlls/d3d11/device.c -+++ b/dlls/d3d11/device.c -@@ -1823,6 +1823,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); - struct d3d_rasterizer_state *rasterizer_state_impl; - const D3D11_RASTERIZER_DESC *desc; -+ union {DWORD d; float f;} slope; - - TRACE("iface %p, rasterizer_state %p.\n", iface, rasterizer_state); - -@@ -1835,6 +1836,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, FALSE); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, FALSE); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ANTIALIASEDLINEENABLE, FALSE); -+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, 0); -+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, 0); - wined3d_mutex_unlock(); - return; - } -@@ -1844,12 +1847,16 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon - desc = &rasterizer_state_impl->desc; - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_FILLMODE, desc->FillMode); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_CULLMODE, desc->CullMode); -+ - /* OpenGL style depth bias. */ -- if (desc->DepthBias || desc->SlopeScaledDepthBias) -- FIXME("Ignoring depth bias.\n"); -- /* GL_DEPTH_CLAMP */ -+ slope.f = desc->SlopeScaledDepthBias; -+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, desc->DepthBias); -+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, slope.d); -+ if (desc->DepthBiasClamp) -+ FIXME("Ignoring DepthBiasClamp %f.\n", desc->DepthBiasClamp); - if (!desc->DepthClipEnable) - FIXME("Ignoring DepthClipEnable %#x.\n", desc->DepthClipEnable); -+ - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, desc->ScissorEnable); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, desc->MultisampleEnable); - wined3d_device_set_render_state(device->wined3d_device, -diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c -index 7c9c8395315..b7b35ef8b85 100644 ---- a/dlls/d3d11/tests/d3d11.c -+++ b/dlls/d3d11/tests/d3d11.c -@@ -15687,7 +15687,7 @@ static void test_depth_separate(void) - draw_color_quad_z(&test_context, &blue, 0.5f); - get_texture_readback(test_context.backbuffer, 0, &rb); - color = get_readback_color(&rb, 320, 240); -- todo_wine ok(compare_color(color, blue_d, 1), "Got unexpected color 0x%08x.\n", color); -+ ok(compare_color(color, blue_d, 1), "Got unexpected color 0x%08x.\n", color); - release_resource_readback(&rb); - ID3D11RasterizerState_Release(rs); - rs_desc.DepthBias = -100005; -@@ -15697,7 +15697,7 @@ static void test_depth_separate(void) - draw_color_quad_z(&test_context, &white, 0.5f); - get_texture_readback(test_context.backbuffer, 0, &rb); - color = get_readback_color(&rb, 320, 240); -- todo_wine ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color); -+ ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color); - release_resource_readback(&rb); - ID3D11RasterizerState_Release(rs); - rs_desc.DepthBias = -99995; -@@ -15707,7 +15707,7 @@ static void test_depth_separate(void) - draw_color_quad_z(&test_context, &green, 0.5f); - get_texture_readback(test_context.backbuffer, 0, &rb); - color = get_readback_color(&rb, 320, 240); -- todo_wine ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color); -+ ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color); - release_resource_readback(&rb); - - ID3D11DepthStencilState_Release(ds_state); -diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c -index 662b0cf3745..c218276a220 100644 ---- a/dlls/dxgi/factory.c -+++ b/dlls/dxgi/factory.c -@@ -318,7 +318,7 @@ static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended) - wined3d_private_store_init(&factory->private_store); - - wined3d_mutex_lock(); -- factory->wined3d = wined3d_create(0); -+ factory->wined3d = wined3d_create(WINED3D_FORWARD_DEPTH_BIAS); - wined3d_mutex_unlock(); - if (!factory->wined3d) - { -diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 950c4d511c3..5b43927fea5 100644 ---- a/dlls/wined3d/state.c -+++ b/dlls/wined3d/state.c -@@ -1726,6 +1726,7 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 - union - { - DWORD d; -+ INT i; - float f; - } scale_bias, const_bias; - -@@ -1741,6 +1742,11 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 - gl_info->gl_ops.gl.p_glPolygonOffset(bias, bias); - checkGLcall("glPolygonOffset"); - } -+ else if (context->d3d_info->wined3d_creation_flags & WINED3D_FORWARD_DEPTH_BIAS) -+ { -+ gl_info->gl_ops.gl.p_glPolygonOffset(scale_bias.f, const_bias.i); -+ checkGLcall("glPolygonOffset(...)"); -+ } - else - { - if (depth) -diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index 653c6a5a904..7491c49587a 100644 ---- a/include/wine/wined3d.h -+++ b/include/wine/wined3d.h -@@ -1310,6 +1310,7 @@ enum wined3d_shader_byte_code_format - #define WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR 0x00000400 - #define WINED3D_NO_PRIMITIVE_RESTART 0x00000800 - #define WINED3D_LEGACY_CUBEMAP_FILTERING 0x00001000 -+#define WINED3D_FORWARD_DEPTH_BIAS 0x00002000 - - #define WINED3D_RESZ_CODE 0x7fa05000 - --- -2.13.1 - diff --git a/patches/d3d11-Depth_Bias/0004-d3d11-Add-support-for-SlopeScaledDepthBias-in-RSSetS.patch b/patches/d3d11-Depth_Bias/0004-d3d11-Add-support-for-DepthClipEnable-in-RSSetState.patch similarity index 81% rename from patches/d3d11-Depth_Bias/0004-d3d11-Add-support-for-SlopeScaledDepthBias-in-RSSetS.patch rename to patches/d3d11-Depth_Bias/0004-d3d11-Add-support-for-DepthClipEnable-in-RSSetState.patch index 3514c6f4..84f16d99 100644 --- a/patches/d3d11-Depth_Bias/0004-d3d11-Add-support-for-SlopeScaledDepthBias-in-RSSetS.patch +++ b/patches/d3d11-Depth_Bias/0004-d3d11-Add-support-for-DepthClipEnable-in-RSSetState.patch @@ -1,7 +1,7 @@ -From b3431c46e215b3ef61955b5a8ed2456c4aaf78cf Mon Sep 17 00:00:00 2001 +From 5fdb9b16c65609e00684062ccf426d19acb75b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 7 Jul 2017 06:10:01 +0200 -Subject: d3d11: Add support for SlopeScaledDepthBias in RSSetState. +Subject: [PATCH 2/4] d3d11: Add support for DepthClipEnable in RSSetState. --- dlls/d3d11/device.c | 4 ++-- @@ -15,34 +15,32 @@ Subject: d3d11: Add support for SlopeScaledDepthBias in RSSetState. 8 files changed, 35 insertions(+), 5 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c -index 4c46c9f235b..3860a768d0f 100644 +index 25308c2..555b05b 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c -@@ -1838,6 +1838,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ANTIALIASEDLINEENABLE, FALSE); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, 0); +@@ -931,6 +931,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_CULLMODE, WINED3D_CULL_BACK); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, 0); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, 0); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHCLIP, TRUE); - wined3d_mutex_unlock(); - return; - } -@@ -1852,10 +1853,9 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon - slope.f = desc->SlopeScaledDepthBias; - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, desc->DepthBias); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, slope.d); -+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHCLIP, (desc->DepthClipEnable != FALSE)); - if (desc->DepthBiasClamp) - FIXME("Ignoring DepthBiasClamp %f.\n", desc->DepthBiasClamp); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, FALSE); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, FALSE); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ANTIALIASEDLINEENABLE, FALSE); +@@ -948,8 +949,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, scale_bias.d); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, const_bias.d); + /* GL_DEPTH_CLAMP */ - if (!desc->DepthClipEnable) - FIXME("Ignoring DepthClipEnable %#x.\n", desc->DepthClipEnable); - ++ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHCLIP, (desc->DepthClipEnable != FALSE)); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, desc->ScissorEnable); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, desc->MultisampleEnable); + wined3d_device_set_render_state(device->wined3d_device, diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c -index b7b35ef8b85..f15d4873ab1 100644 +index 9d9d74b..813660d 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c -@@ -15663,7 +15663,7 @@ static void test_depth_separate(void) +@@ -16924,7 +16924,7 @@ static void test_depth_separate(void) draw_color_quad_z(&test_context, &green, 1.1f); get_texture_readback(test_context.backbuffer, 0, &rb); color = get_readback_color(&rb, 320, 240); @@ -51,7 +49,7 @@ index b7b35ef8b85..f15d4873ab1 100644 release_resource_readback(&rb); ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red); -@@ -15671,7 +15671,7 @@ static void test_depth_separate(void) +@@ -16932,7 +16932,7 @@ static void test_depth_separate(void) draw_color_quad_z(&test_context, &green, -0.1f); get_texture_readback(test_context.backbuffer, 0, &rb); color = get_readback_color(&rb, 320, 240); @@ -61,11 +59,11 @@ index b7b35ef8b85..f15d4873ab1 100644 /* depth bias */ diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index 01131ed8230..68d7e8cba0f 100644 +index f7f6452..b7a318a 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c -@@ -118,6 +118,7 @@ static const struct wined3d_extension_map gl_extension_map[] = - {"GL_ARB_copy_buffer", ARB_COPY_BUFFER }, +@@ -122,6 +122,7 @@ static const struct wined3d_extension_map gl_extension_map[] = + {"GL_ARB_cull_distance", ARB_CULL_DISTANCE }, {"GL_ARB_debug_output", ARB_DEBUG_OUTPUT }, {"GL_ARB_depth_buffer_float", ARB_DEPTH_BUFFER_FLOAT }, + {"GL_ARB_depth_clamp", ARB_DEPTH_CLAMP }, @@ -73,11 +71,11 @@ index 01131ed8230..68d7e8cba0f 100644 {"GL_ARB_derivative_control", ARB_DERIVATIVE_CONTROL }, {"GL_ARB_draw_buffers", ARB_DRAW_BUFFERS }, diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 5b43927fea5..8b1729de2a3 100644 +index 407ad62..25cc7d7 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c -@@ -1777,6 +1777,28 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 - } +@@ -1822,6 +1822,28 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 + checkGLcall("depth bias"); } +static void state_depthclip(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) @@ -105,7 +103,7 @@ index 5b43927fea5..8b1729de2a3 100644 static void state_zvisible(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { if (state->render_states[WINED3D_RS_ZVISIBLE]) -@@ -5220,6 +5242,8 @@ const struct StateEntryTemplate misc_state_template[] = +@@ -5263,6 +5285,8 @@ const struct StateEntryTemplate misc_state_template[] = { STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor_w }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ZVISIBLE), { STATE_RENDER(WINED3D_RS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE }, @@ -115,7 +113,7 @@ index 5b43927fea5..8b1729de2a3 100644 { STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(1), { STATE_SAMPLER(1), sampler }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c -index 40ce7b37a70..e55e2b8abc3 100644 +index 4c28eb5..3dae0d9 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -90,6 +90,7 @@ static const DWORD pixel_states_render[] = @@ -135,10 +133,10 @@ index 40ce7b37a70..e55e2b8abc3 100644 state->render_states[WINED3D_RS_WRAP9] = 0; state->render_states[WINED3D_RS_WRAP10] = 0; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index 77bfd81f73c..7462103aeee 100644 +index 4e1da1c..853feda 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -4291,6 +4291,7 @@ const char *debug_d3drenderstate(enum wined3d_render_state state) +@@ -4446,6 +4446,7 @@ const char *debug_d3drenderstate(enum wined3d_render_state state) D3DSTATE_TO_STR(WINED3D_RS_SRCBLENDALPHA); D3DSTATE_TO_STR(WINED3D_RS_DESTBLENDALPHA); D3DSTATE_TO_STR(WINED3D_RS_BLENDOPALPHA); @@ -147,11 +145,11 @@ index 77bfd81f73c..7462103aeee 100644 default: FIXME("Unrecognized %u render state!\n", state); diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h -index 17d17a1be65..718213cca51 100644 +index cc6f888..b982330 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h -@@ -52,6 +52,7 @@ enum wined3d_gl_extension - ARB_COPY_BUFFER, +@@ -55,6 +55,7 @@ enum wined3d_gl_extension + ARB_CULL_DISTANCE, ARB_DEBUG_OUTPUT, ARB_DEPTH_BUFFER_FLOAT, + ARB_DEPTH_CLAMP, @@ -159,10 +157,10 @@ index 17d17a1be65..718213cca51 100644 ARB_DERIVATIVE_CONTROL, ARB_DRAW_BUFFERS, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index 7491c49587a..90862d61535 100644 +index b6a2ec3..1944a65 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h -@@ -383,8 +383,9 @@ enum wined3d_render_state +@@ -386,8 +386,9 @@ enum wined3d_render_state WINED3D_RS_SRCBLENDALPHA = 207, WINED3D_RS_DESTBLENDALPHA = 208, WINED3D_RS_BLENDOPALPHA = 209, @@ -174,5 +172,5 @@ index 7491c49587a..90862d61535 100644 enum wined3d_blend { -- -2.13.1 +2.7.4 diff --git a/patches/d3d11-Depth_Bias/0005-d3d11-tests-Add-basic-test-for-depth-bias-clamping.patch b/patches/d3d11-Depth_Bias/0005-d3d11-tests-Add-basic-test-for-depth-bias-clamping.patch index 9f516177..7384cd60 100644 --- a/patches/d3d11-Depth_Bias/0005-d3d11-tests-Add-basic-test-for-depth-bias-clamping.patch +++ b/patches/d3d11-Depth_Bias/0005-d3d11-tests-Add-basic-test-for-depth-bias-clamping.patch @@ -1,17 +1,17 @@ -From 2f0910b949940534ca5e2f45773a6be733e8b5b9 Mon Sep 17 00:00:00 2001 +From 45291eca9ac098c90471c179a87f882a73ef10b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 7 Oct 2017 00:39:35 +0200 -Subject: d3d11/tests: Add basic test for depth bias clamping. +Subject: [PATCH 3/4] d3d11/tests: Add basic test for depth bias clamping. --- dlls/d3d11/tests/d3d11.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c -index 8906b9efa7a..ef6eafd11f1 100644 +index 813660d..2a576e5 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c -@@ -16239,6 +16239,47 @@ static void test_depth_separate(void) +@@ -16971,6 +16971,47 @@ static void test_depth_separate(void) ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color); release_resource_readback(&rb); @@ -60,5 +60,5 @@ index 8906b9efa7a..ef6eafd11f1 100644 ID3D11DepthStencilView_Release(ds_view); ID3D11RasterizerState_Release(rs); -- -2.14.1 +2.7.4 diff --git a/patches/d3d11-Depth_Bias/0006-wined3d-Add-support-for-depth-bias-clamping.patch b/patches/d3d11-Depth_Bias/0006-wined3d-Add-support-for-depth-bias-clamping.patch index a6f81346..11dd124e 100644 --- a/patches/d3d11-Depth_Bias/0006-wined3d-Add-support-for-depth-bias-clamping.patch +++ b/patches/d3d11-Depth_Bias/0006-wined3d-Add-support-for-depth-bias-clamping.patch @@ -1,64 +1,59 @@ -From 0895c4bcdcaaa794619c0a67dcede0b2ab24c1fb Mon Sep 17 00:00:00 2001 +From 34656e2180491f3946d1a66a02d55b8b110095fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 7 Oct 2017 00:52:34 +0200 -Subject: wined3d: Add support for depth bias clamping. +Subject: [PATCH 4/4] wined3d: Add support for depth bias clamping. --- - dlls/d3d11/device.c | 12 +++++++----- + dlls/d3d11/device.c | 7 +++++-- dlls/d3d11/tests/d3d11.c | 2 +- dlls/wined3d/cs.c | 1 + dlls/wined3d/directx.c | 3 +++ - dlls/wined3d/state.c | 19 ++++++++++++++++--- + dlls/wined3d/state.c | 17 +++++++++++++++-- dlls/wined3d/stateblock.c | 2 ++ dlls/wined3d/utils.c | 1 + dlls/wined3d/wined3d_gl.h | 1 + include/wine/wined3d.h | 3 ++- - 9 files changed, 34 insertions(+), 10 deletions(-) + 9 files changed, 31 insertions(+), 6 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c -index a144bccce1e..405a678505f 100644 +index 555b05b..835ea8b 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c -@@ -887,7 +887,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); - struct d3d_rasterizer_state *rasterizer_state_impl; - const D3D11_RASTERIZER_DESC *desc; -- union {DWORD d; float f;} slope; -+ union {DWORD d; float f;} tmpfloat; +@@ -919,7 +919,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon + { + DWORD d; + float f; +- } scale_bias, const_bias; ++ } scale_bias, const_bias, bias_clamp; TRACE("iface %p, rasterizer_state %p.\n", iface, rasterizer_state); -@@ -901,6 +901,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon +@@ -932,6 +932,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, 0); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, 0); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHCLIP, TRUE); ++ bias_clamp.f = 0.0f; ++ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIASCLAMP, bias_clamp.d); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, FALSE); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, FALSE); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ANTIALIASEDLINEENABLE, FALSE); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, 0); -+ tmpfloat.f = 0.0f; -+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIASCLAMP, tmpfloat.d); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, 0); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHCLIP, TRUE); - wined3d_mutex_unlock(); -@@ -914,12 +916,12 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon +@@ -946,9 +948,10 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_CULLMODE, desc->CullMode); - - /* OpenGL style depth bias. */ -- slope.f = desc->SlopeScaledDepthBias; - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, desc->DepthBias); -- wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, slope.d); -+ tmpfloat.f = desc->DepthBiasClamp; -+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIASCLAMP, tmpfloat.d); -+ tmpfloat.f = desc->SlopeScaledDepthBias; -+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, tmpfloat.d); + scale_bias.f = desc->SlopeScaledDepthBias; + const_bias.f = desc->DepthBias; ++ bias_clamp.f = desc->DepthBiasClamp; + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, scale_bias.d); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, const_bias.d); +- /* GL_DEPTH_CLAMP */ ++ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIASCLAMP, bias_clamp.d); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHCLIP, (desc->DepthClipEnable != FALSE)); -- if (desc->DepthBiasClamp) -- FIXME("Ignoring DepthBiasClamp %f.\n", desc->DepthBiasClamp); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, desc->ScissorEnable); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, desc->MultisampleEnable); diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c -index cd5103a8367..923da4b38ce 100644 +index 2a576e5..540da93 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c -@@ -15433,7 +15433,7 @@ static void test_depth_separate(void) +@@ -16996,7 +16996,7 @@ static void test_depth_separate(void) draw_color_quad_z(&test_context, &white, 0.5f); get_texture_readback(test_context.backbuffer, 0, &rb); color = get_readback_color(&rb, 320, 240); @@ -68,22 +63,22 @@ index cd5103a8367..923da4b38ce 100644 ID3D11RasterizerState_Release(rs); diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 04e01da9e0a..599d72889d1 100644 +index 2f77c7b..68d5759 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -986,6 +986,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const +@@ -1038,6 +1038,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const device_invalidate_state(device, STATE_RENDER(WINED3D_RS_STENCILENABLE)); device_invalidate_state(device, STATE_RENDER(WINED3D_RS_STENCILWRITEMASK)); device_invalidate_state(device, STATE_RENDER(WINED3D_RS_DEPTHBIAS)); + device_invalidate_state(device, STATE_RENDER(WINED3D_RS_DEPTHBIASCLAMP)); } - else if (prev && (prev->format_flags & WINED3DFMT_FLAG_FLOAT) - != (op->view->format_flags & WINED3DFMT_FLAG_FLOAT)) + else if (prev && prev->format->depth_bias_scale != op->view->format->depth_bias_scale) + { diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index 564078f2905..33eb2d3c0c3 100644 +index b7a318a..e282c10 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c -@@ -225,6 +225,7 @@ static const struct wined3d_extension_map gl_extension_map[] = +@@ -231,6 +231,7 @@ static const struct wined3d_extension_map gl_extension_map[] = {"GL_EXT_packed_depth_stencil", EXT_PACKED_DEPTH_STENCIL }, {"GL_EXT_packed_float", EXT_PACKED_FLOAT }, {"GL_EXT_point_parameters", EXT_POINT_PARAMETERS }, @@ -91,7 +86,7 @@ index 564078f2905..33eb2d3c0c3 100644 {"GL_EXT_provoking_vertex", EXT_PROVOKING_VERTEX }, {"GL_EXT_secondary_color", EXT_SECONDARY_COLOR }, {"GL_EXT_stencil_two_side", EXT_STENCIL_TWO_SIDE }, -@@ -3093,6 +3094,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) +@@ -3114,6 +3115,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) /* GL_EXT_point_parameters */ USE_GL_FUNC(glPointParameterfEXT) USE_GL_FUNC(glPointParameterfvEXT) @@ -101,12 +96,12 @@ index 564078f2905..33eb2d3c0c3 100644 USE_GL_FUNC(glProvokingVertexEXT) /* GL_EXT_secondary_color */ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 8b1729de2a3..df511009833 100644 +index 25cc7d7..3460d69 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c -@@ -1728,10 +1728,11 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 +@@ -1782,10 +1782,11 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 + { DWORD d; - INT i; float f; - } scale_bias, const_bias; + } scale_bias, const_bias, bias_clamp; @@ -115,31 +110,29 @@ index 8b1729de2a3..df511009833 100644 const_bias.d = state->render_states[WINED3D_RS_DEPTHBIAS]; + bias_clamp.d = state->render_states[WINED3D_RS_DEPTHBIASCLAMP]; + if (context->d3d_info->wined3d_creation_flags & WINED3D_LEGACY_DEPTH_BIAS) + { +@@ -1812,7 +1813,18 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 + } + gl_info->gl_ops.gl.p_glEnable(GL_POLYGON_OFFSET_FILL); - checkGLcall("glEnable(GL_POLYGON_OFFSET_FILL)"); -@@ -1744,8 +1745,19 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 - } - else if (context->d3d_info->wined3d_creation_flags & WINED3D_FORWARD_DEPTH_BIAS) - { -- gl_info->gl_ops.gl.p_glPolygonOffset(scale_bias.f, const_bias.i); -- checkGLcall("glPolygonOffset(...)"); -+ if (gl_info->supported[EXT_POLYGON_OFFSET_CLAMP]) -+ { -+ GL_EXTCALL(glPolygonOffsetClampEXT(scale_bias.f, const_bias.i, bias_clamp.f)); -+ checkGLcall("glPolygonOffsetClampEXT(...)"); -+ } -+ else -+ { -+ if (bias_clamp.f) -+ WARN("EXT_polygon_offset_clamp extension missing, no support for depth bias clamping.\n"); +- gl_info->gl_ops.gl.p_glPolygonOffset(factor, units); ++ if (gl_info->supported[EXT_POLYGON_OFFSET_CLAMP]) ++ { ++ GL_EXTCALL(glPolygonOffsetClampEXT(factor, units, bias_clamp.f)); ++ checkGLcall("glPolygonOffsetClampEXT(...)"); ++ } ++ else ++ { ++ if (bias_clamp.f) ++ WARN("EXT_polygon_offset_clamp extension missing, no support for depth bias clamping.\n"); + -+ gl_info->gl_ops.gl.p_glPolygonOffset(scale_bias.f, const_bias.i); -+ checkGLcall("glPolygonOffset(...)"); -+ } - } - else - { -@@ -5241,6 +5253,7 @@ const struct StateEntryTemplate misc_state_template[] = ++ gl_info->gl_ops.gl.p_glPolygonOffset(factor, units); ++ } + } + else + { +@@ -5284,6 +5296,7 @@ const struct StateEntryTemplate misc_state_template[] = { STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor }, EXT_BLEND_COLOR }, { STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor_w }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE }, @@ -148,7 +141,7 @@ index 8b1729de2a3..df511009833 100644 { STATE_RENDER(WINED3D_RS_DEPTHCLIP), { STATE_RENDER(WINED3D_RS_DEPTHCLIP), state_depthclip }, ARB_DEPTH_CLAMP }, { STATE_RENDER(WINED3D_RS_DEPTHCLIP), { STATE_RENDER(WINED3D_RS_DEPTHCLIP), state_depthclip_w }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c -index e55e2b8abc3..71571b24fe5 100644 +index 3dae0d9..b9efcec 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1244,6 +1244,8 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d @@ -161,10 +154,10 @@ index e55e2b8abc3..71571b24fe5 100644 state->render_states[WINED3D_RS_WRAP8] = 0; state->render_states[WINED3D_RS_WRAP9] = 0; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index b234a2e3b44..472ac9ead0b 100644 +index 853feda..5de53d0 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -4299,6 +4299,7 @@ const char *debug_d3drenderstate(enum wined3d_render_state state) +@@ -4434,6 +4434,7 @@ const char *debug_d3drenderstate(enum wined3d_render_state state) D3DSTATE_TO_STR(WINED3D_RS_BLENDFACTOR); D3DSTATE_TO_STR(WINED3D_RS_SRGBWRITEENABLE); D3DSTATE_TO_STR(WINED3D_RS_DEPTHBIAS); @@ -173,10 +166,10 @@ index b234a2e3b44..472ac9ead0b 100644 D3DSTATE_TO_STR(WINED3D_RS_WRAP9); D3DSTATE_TO_STR(WINED3D_RS_WRAP10); diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h -index 084c2d9dc6e..f044c74584e 100644 +index b982330..12e15cc 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h -@@ -156,6 +156,7 @@ enum wined3d_gl_extension +@@ -162,6 +162,7 @@ enum wined3d_gl_extension EXT_PACKED_DEPTH_STENCIL, EXT_PACKED_FLOAT, EXT_POINT_PARAMETERS, @@ -185,10 +178,10 @@ index 084c2d9dc6e..f044c74584e 100644 EXT_SECONDARY_COLOR, EXT_STENCIL_TWO_SIDE, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index 946692fc672..5e9e45942be 100644 +index 1944a65..8864965 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h -@@ -382,8 +382,9 @@ enum wined3d_render_state +@@ -387,8 +387,9 @@ enum wined3d_render_state WINED3D_RS_DESTBLENDALPHA = 208, WINED3D_RS_BLENDOPALPHA = 209, WINED3D_RS_DEPTHCLIP = 210, @@ -200,5 +193,5 @@ index 946692fc672..5e9e45942be 100644 enum wined3d_blend { -- -2.14.1 +2.7.4 diff --git a/patches/d3d11-Depth_Bias/definition b/patches/d3d11-Depth_Bias/definition index 82a33786..f2c5791c 100644 --- a/patches/d3d11-Depth_Bias/definition +++ b/patches/d3d11-Depth_Bias/definition @@ -1,3 +1,2 @@ Fixes: Implement support for more d3d11 depth options in RSSetState. Fixes: [43848] Implement support for depth bias clamping -Disabled: true \ No newline at end of file diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index f6395a22..e420712a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -113,6 +113,7 @@ patch_enable_all () enable_crypt32_MS_Root_Certs="$1" enable_d3d10_1_Forwards="$1" enable_d3d11_Deferred_Context="$1" + enable_d3d11_Depth_Bias="$1" enable_d3d11_ID3D11Texture1D="$1" enable_d3d11_Silence_FIXMEs="$1" enable_d3d8_ValidateShader="$1" @@ -586,6 +587,9 @@ patch_enable () d3d11-Deferred_Context) enable_d3d11_Deferred_Context="$2" ;; + d3d11-Depth_Bias) + enable_d3d11_Depth_Bias="$2" + ;; d3d11-ID3D11Texture1D) enable_d3d11_ID3D11Texture1D="$2" ;; @@ -2135,6 +2139,13 @@ if test "$enable_wined3d_Indexed_Vertex_Blending" -eq 1; then enable_wined3d_WINED3D_RS_COLORWRITEENABLE=1 fi +if test "$enable_wined3d_WINED3D_RS_COLORWRITEENABLE" -eq 1; then + if test "$enable_d3d11_Depth_Bias" -gt 1; then + abort "Patchset d3d11-Depth_Bias disabled, but wined3d-WINED3D_RS_COLORWRITEENABLE depends on that." + fi + enable_d3d11_Depth_Bias=1 +fi + if test "$enable_wined3d_CSMT_Helper" -eq 1; then if test "$enable_d3d11_Deferred_Context" -gt 1; then abort "Patchset d3d11-Deferred_Context disabled, but wined3d-CSMT_Helper depends on that." @@ -2196,6 +2207,13 @@ if test "$enable_wined3d_Viewports" -eq 1; then enable_wined3d_Core_Context=1 fi +if test "$enable_wined3d_Core_Context" -eq 1; then + if test "$enable_d3d11_Depth_Bias" -gt 1; then + abort "Patchset d3d11-Depth_Bias disabled, but wined3d-Core_Context depends on that." + fi + enable_d3d11_Depth_Bias=1 +fi + if test "$enable_winebuild_Fake_Dlls" -eq 1; then if test "$enable_ntdll_User_Shared_Data" -gt 1; then abort "Patchset ntdll-User_Shared_Data disabled, but winebuild-Fake_Dlls depends on that." @@ -3594,6 +3612,28 @@ if test "$enable_d3d11_Deferred_Context" -eq 1; then ) >> "$patchlist" fi +# Patchset d3d11-Depth_Bias +# | +# | This patchset fixes the following Wine bugs: +# | * [#43848] Implement support for depth bias clamping +# | +# | Modified files: +# | * dlls/d3d11/device.c, dlls/d3d11/tests/d3d11.c, dlls/wined3d/cs.c, dlls/wined3d/directx.c, dlls/wined3d/state.c, +# | dlls/wined3d/stateblock.c, dlls/wined3d/utils.c, dlls/wined3d/wined3d_gl.h, include/wine/wined3d.h +# | +if test "$enable_d3d11_Depth_Bias" -eq 1; then + patch_apply d3d11-Depth_Bias/0002-d3d11-tests-Add-some-basic-depth-tests.patch + patch_apply d3d11-Depth_Bias/0004-d3d11-Add-support-for-DepthClipEnable-in-RSSetState.patch + patch_apply d3d11-Depth_Bias/0005-d3d11-tests-Add-basic-test-for-depth-bias-clamping.patch + patch_apply d3d11-Depth_Bias/0006-wined3d-Add-support-for-depth-bias-clamping.patch + ( + printf '%s\n' '+ { "Michael Müller", "d3d11/tests: Add some basic depth tests.", 1 },'; + printf '%s\n' '+ { "Michael Müller", "d3d11: Add support for DepthClipEnable in RSSetState.", 1 },'; + printf '%s\n' '+ { "Michael Müller", "d3d11/tests: Add basic test for depth bias clamping.", 1 },'; + printf '%s\n' '+ { "Michael Müller", "wined3d: Add support for depth bias clamping.", 1 },'; + ) >> "$patchlist" +fi + # Patchset d3d11-ID3D11Texture1D # | # | This patchset has the following (direct or indirect) dependencies: @@ -8984,6 +9024,9 @@ fi # Patchset wined3d-Core_Context # | +# | This patchset has the following (direct or indirect) dependencies: +# | * d3d11-Depth_Bias +# | # | Modified files: # | * dlls/dxgi/factory.c, include/wine/wined3d.h # | @@ -8997,7 +9040,7 @@ fi # Patchset wined3d-Viewports # | # | This patchset has the following (direct or indirect) dependencies: -# | * wined3d-Core_Context +# | * d3d11-Depth_Bias, wined3d-Core_Context # | # | Modified files: # | * dlls/d3d11/tests/d3d11.c, dlls/d3d8/directx.c, dlls/d3d9/directx.c, dlls/ddraw/ddraw_private.h, dlls/wined3d/state.c, @@ -9013,7 +9056,7 @@ fi # Patchset wined3d-Dual_Source_Blending # | # | This patchset has the following (direct or indirect) dependencies: -# | * wined3d-Core_Context, wined3d-Viewports +# | * d3d11-Depth_Bias, wined3d-Core_Context, wined3d-Viewports # | # | Modified files: # | * dlls/d3d11/tests/d3d11.c, dlls/wined3d/context.c, dlls/wined3d/directx.c, dlls/wined3d/glsl_shader.c, @@ -9079,8 +9122,8 @@ fi # | # | This patchset has the following (direct or indirect) dependencies: # | * wined3d-1DTextures, d3d11-Deferred_Context, d3d9-Tests, makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll- -# | Loader_Machine_Type, ntdll-DllRedirects, wined3d-Accounting, wined3d-DXTn, wined3d-Core_Context, wined3d-Viewports, -# | wined3d-Dual_Source_Blending, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs, wined3d-UAV_Counters +# | Loader_Machine_Type, ntdll-DllRedirects, wined3d-Accounting, wined3d-DXTn, d3d11-Depth_Bias, wined3d-Core_Context, +# | wined3d-Viewports, wined3d-Dual_Source_Blending, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs, wined3d-UAV_Counters # | # | Modified files: # | * configure.ac, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc @@ -9106,6 +9149,9 @@ fi # Patchset wined3d-WINED3D_RS_COLORWRITEENABLE # | +# | This patchset has the following (direct or indirect) dependencies: +# | * d3d11-Depth_Bias +# | # | Modified files: # | * dlls/d3d11/device.c, dlls/d3d11/state.c, dlls/wined3d/context.c, dlls/wined3d/device.c, dlls/wined3d/drawprim.c, # | dlls/wined3d/state.c, dlls/wined3d/stateblock.c, dlls/wined3d/surface.c, dlls/wined3d/utils.c, @@ -9121,7 +9167,7 @@ fi # Patchset wined3d-Indexed_Vertex_Blending # | # | This patchset has the following (direct or indirect) dependencies: -# | * wined3d-WINED3D_RS_COLORWRITEENABLE +# | * d3d11-Depth_Bias, wined3d-WINED3D_RS_COLORWRITEENABLE # | # | This patchset fixes the following Wine bugs: # | * [#39057] Support for indexed vertex blending @@ -9242,8 +9288,9 @@ fi # | # | This patchset has the following (direct or indirect) dependencies: # | * wined3d-1DTextures, d3d11-Deferred_Context, d3d9-Tests, makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll- -# | Loader_Machine_Type, ntdll-DllRedirects, wined3d-Accounting, wined3d-DXTn, wined3d-Core_Context, wined3d-Viewports, -# | wined3d-Dual_Source_Blending, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs, wined3d-UAV_Counters, wined3d-CSMT_Helper +# | Loader_Machine_Type, ntdll-DllRedirects, wined3d-Accounting, wined3d-DXTn, d3d11-Depth_Bias, wined3d-Core_Context, +# | wined3d-Viewports, wined3d-Dual_Source_Blending, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs, wined3d-UAV_Counters, +# | wined3d-CSMT_Helper # | # | This patchset fixes the following Wine bugs: # | * [#11674] Support for CSMT (command stream) to increase graphic performance diff --git a/patches/wined3d-Core_Context/definition b/patches/wined3d-Core_Context/definition index f7c3c8ae..24c67796 100644 --- a/patches/wined3d-Core_Context/definition +++ b/patches/wined3d-Core_Context/definition @@ -1,2 +1,2 @@ Fixes: Use OpenGL core context for D3D10/11 when necessary -#Depends: d3d11-Depth_Bias +Depends: d3d11-Depth_Bias diff --git a/patches/wined3d-WINED3D_RS_COLORWRITEENABLE/0001-wined3d-Implement-all-8-d3d11-color-write-masks.patch b/patches/wined3d-WINED3D_RS_COLORWRITEENABLE/0001-wined3d-Implement-all-8-d3d11-color-write-masks.patch index 7c28f98c..7701215e 100644 --- a/patches/wined3d-WINED3D_RS_COLORWRITEENABLE/0001-wined3d-Implement-all-8-d3d11-color-write-masks.patch +++ b/patches/wined3d-WINED3D_RS_COLORWRITEENABLE/0001-wined3d-Implement-all-8-d3d11-color-write-masks.patch @@ -1,4 +1,4 @@ -From 3b113e46e5f947d837f15ee1ae287f15493666a3 Mon Sep 17 00:00:00 2001 +From 109b6e5af50662ad34c61943cccace4686ae8ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 20 Jul 2017 13:50:07 +0200 Subject: [PATCH] wined3d: Implement all 8 d3d11 color write masks. @@ -18,7 +18,7 @@ Subject: [PATCH] wined3d: Implement all 8 d3d11 color write masks. 11 files changed, 72 insertions(+), 70 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c -index 25308c2..b380301 100644 +index 835ea8b..2ef9b46 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -688,6 +688,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi @@ -87,10 +87,10 @@ index a14c9d3..2bec92e 100644 /* glEnableIndexedEXT(GL_BLEND, ...) */ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index b97dff5..7bed2b3 100644 +index 4929b84..1daf7c0 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -2586,10 +2586,8 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con +@@ -2578,10 +2578,8 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con } gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE,GL_TRUE,GL_TRUE); checkGLcall("glColorMask"); @@ -104,7 +104,7 @@ index b97dff5..7bed2b3 100644 { gl_info->gl_ops.gl.p_glDisable(GL_COLOR_SUM_EXT); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 17103cc..dabb5e2 100644 +index 6e275e1..cef05cc 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -378,10 +378,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c @@ -134,7 +134,7 @@ index 7eccc8f..8f9e929 100644 wined3d_rendertarget_view_load_location(rtv, context, rtv->resource->draw_binding); wined3d_rendertarget_view_invalidate_location(rtv, ~rtv->resource->draw_binding); diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 407ad62..e1408de 100644 +index 3460d69..26c5815 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1556,9 +1556,6 @@ static void state_debug_monitor(struct wined3d_context *context, const struct wi @@ -197,7 +197,7 @@ index 407ad62..e1408de 100644 } static void state_localviewer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -@@ -5247,18 +5234,26 @@ const struct StateEntryTemplate misc_state_template[] = +@@ -5281,18 +5268,26 @@ const struct StateEntryTemplate misc_state_template[] = { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), state_msaa_w }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), { STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), state_multisampmask }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), state_debug_monitor }, WINED3D_GL_EXT_NONE }, @@ -232,7 +232,7 @@ index 407ad62..e1408de 100644 { STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor_w }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c -index 4c28eb5..f02da5c 100644 +index b9efcec..c9b3527 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -45,6 +45,10 @@ static const DWORD pixel_states_render[] = @@ -246,7 +246,7 @@ index 4c28eb5..f02da5c 100644 WINED3D_RS_DEPTHBIAS, WINED3D_RS_DESTBLEND, WINED3D_RS_DESTBLENDALPHA, -@@ -1211,7 +1215,6 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d +@@ -1212,7 +1216,6 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d tmpfloat.f = gl_info->limits.pointsize_max; state->render_states[WINED3D_RS_POINTSIZE_MAX] = tmpfloat.d; state->render_states[WINED3D_RS_INDEXEDVERTEXBLENDENABLE] = FALSE; @@ -254,7 +254,7 @@ index 4c28eb5..f02da5c 100644 tmpfloat.f = 0.0f; state->render_states[WINED3D_RS_TWEENFACTOR] = tmpfloat.d; state->render_states[WINED3D_RS_BLENDOP] = WINED3D_BLEND_OP_ADD; -@@ -1237,9 +1240,6 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d +@@ -1238,9 +1241,6 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d state->render_states[WINED3D_RS_BACK_STENCILZFAIL] = WINED3D_STENCIL_OP_KEEP; state->render_states[WINED3D_RS_BACK_STENCILPASS] = WINED3D_STENCIL_OP_KEEP; state->render_states[WINED3D_RS_BACK_STENCILFUNC] = WINED3D_CMP_ALWAYS; @@ -264,7 +264,7 @@ index 4c28eb5..f02da5c 100644 state->render_states[WINED3D_RS_BLENDFACTOR] = 0xffffffff; state->render_states[WINED3D_RS_SRGBWRITEENABLE] = 0; state->render_states[WINED3D_RS_DEPTHBIAS] = 0; -@@ -1255,6 +1255,8 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d +@@ -1259,6 +1259,8 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d state->render_states[WINED3D_RS_SRCBLENDALPHA] = WINED3D_BLEND_ONE; state->render_states[WINED3D_RS_DESTBLENDALPHA] = WINED3D_BLEND_ZERO; state->render_states[WINED3D_RS_BLENDOPALPHA] = WINED3D_BLEND_OP_ADD; @@ -274,7 +274,7 @@ index 4c28eb5..f02da5c 100644 /* Texture Stage States - Put directly into state block, we will call function below */ for (i = 0; i < MAX_TEXTURES; ++i) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 5cb9cda..24a3d24 100644 +index 6e80f85..c8cceb9 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -376,6 +376,7 @@ static void surface_blt_fbo(const struct wined3d_device *device, @@ -299,10 +299,10 @@ index 5cb9cda..24a3d24 100644 gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST); context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE)); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index 78934af..04c1a35 100644 +index 5de53d0..d6f3e91 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -4407,7 +4407,6 @@ const char *debug_d3drenderstate(enum wined3d_render_state state) +@@ -4408,7 +4408,6 @@ const char *debug_d3drenderstate(enum wined3d_render_state state) D3DSTATE_TO_STR(WINED3D_RS_DEBUGMONITORTOKEN); D3DSTATE_TO_STR(WINED3D_RS_POINTSIZE_MAX); D3DSTATE_TO_STR(WINED3D_RS_INDEXEDVERTEXBLENDENABLE); @@ -310,7 +310,7 @@ index 78934af..04c1a35 100644 D3DSTATE_TO_STR(WINED3D_RS_TWEENFACTOR); D3DSTATE_TO_STR(WINED3D_RS_BLENDOP); D3DSTATE_TO_STR(WINED3D_RS_POSITIONDEGREE); -@@ -4427,9 +4426,14 @@ const char *debug_d3drenderstate(enum wined3d_render_state state) +@@ -4428,9 +4427,14 @@ const char *debug_d3drenderstate(enum wined3d_render_state state) D3DSTATE_TO_STR(WINED3D_RS_BACK_STENCILZFAIL); D3DSTATE_TO_STR(WINED3D_RS_BACK_STENCILPASS); D3DSTATE_TO_STR(WINED3D_RS_BACK_STENCILFUNC); @@ -326,7 +326,7 @@ index 78934af..04c1a35 100644 D3DSTATE_TO_STR(WINED3D_RS_SRGBWRITEENABLE); D3DSTATE_TO_STR(WINED3D_RS_DEPTHBIAS); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7a606a7..fe14c2e 100644 +index 021c274..3183a0f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -275,6 +275,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup @@ -338,19 +338,19 @@ index 7a606a7..fe14c2e 100644 struct min_lookup { diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index 1e3c08b..f21cc94 100644 +index 8864965..58da08c 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h -@@ -385,8 +385,20 @@ enum wined3d_render_state - WINED3D_RS_SRCBLENDALPHA = 207, - WINED3D_RS_DESTBLENDALPHA = 208, +@@ -388,8 +388,20 @@ enum wined3d_render_state WINED3D_RS_BLENDOPALPHA = 209, -+ WINED3D_RS_COLORWRITEENABLE4 = 210, -+ WINED3D_RS_COLORWRITEENABLE5 = 211, -+ WINED3D_RS_COLORWRITEENABLE6 = 212, -+ WINED3D_RS_COLORWRITEENABLE7 = 213, + WINED3D_RS_DEPTHCLIP = 210, + WINED3D_RS_DEPTHBIASCLAMP = 211, ++ WINED3D_RS_COLORWRITEENABLE4 = 212, ++ WINED3D_RS_COLORWRITEENABLE5 = 213, ++ WINED3D_RS_COLORWRITEENABLE6 = 214, ++ WINED3D_RS_COLORWRITEENABLE7 = 215, }; --#define WINEHIGHEST_RENDER_STATE WINED3D_RS_BLENDOPALPHA +-#define WINEHIGHEST_RENDER_STATE WINED3D_RS_DEPTHBIASCLAMP +#define WINEHIGHEST_RENDER_STATE WINED3D_RS_COLORWRITEENABLE7 + +static inline enum wined3d_render_state WINED3D_RS_COLORWRITE(int index) diff --git a/patches/wined3d-WINED3D_RS_COLORWRITEENABLE/definition b/patches/wined3d-WINED3D_RS_COLORWRITEENABLE/definition index 8310554c..79eeed42 100644 --- a/patches/wined3d-WINED3D_RS_COLORWRITEENABLE/definition +++ b/patches/wined3d-WINED3D_RS_COLORWRITEENABLE/definition @@ -1,2 +1,2 @@ Fixes: Implement support for all d3d11 color write masks in wined3d -#Depends: d3d11-Depth_Bias +Depends: d3d11-Depth_Bias