winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2016
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
342 discussions
Start a n
N
ew thread
Józef Kucia : d3d10core/tests: Print expected result in case of failures in check_texture_sub_resource_* () functions.
by Alexandre Julliard
08 Dec '16
08 Dec '16
Module: wine Branch: master Commit: 1e7b52c5c1e070995798372c0efdc919f5e53f51 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e7b52c5c1e070995798372c0…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Dec 7 12:57:52 2016 +0100 d3d10core/tests: Print expected result in case of failures in check_texture_sub_resource_*() functions. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10core/tests/device.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 778f33c..784a086 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -643,8 +643,8 @@ static void check_texture_sub_resource_color_(unsigned int line, ID3D10Texture2D } release_resource_readback(&rb); ok_(__FILE__, line)(all_match, - "Got unexpected color 0x%08x at (%u, %u), sub-resource %u.\n", - color, x, y, sub_resource_idx); + "Got 0x%08x, expected 0x%08x at (%u, %u), sub-resource %u.\n", + color, expected_color, x, y, sub_resource_idx); } #define check_texture_color(t, c, d) check_texture_color_(__LINE__, t, c, d) @@ -686,8 +686,8 @@ static void check_texture_sub_resource_float_(unsigned int line, ID3D10Texture2D } release_resource_readback(&rb); ok_(__FILE__, line)(all_match, - "Got unexpected value %.8e at (%u, %u), sub-resource %u.\n", - value, x, y, sub_resource_idx); + "Got %.8e, expected %.8e at (%u, %u), sub-resource %u.\n", + value, expected_value, x, y, sub_resource_idx); } #define check_texture_float(r, f, d) check_texture_float_(__LINE__, r, f, d) @@ -729,8 +729,10 @@ static void check_texture_sub_resource_vec4_(unsigned int line, ID3D10Texture2D } release_resource_readback(&rb); ok_(__FILE__, line)(all_match, - "Got unexpected value {%.8e, %.8e, %.8e, %.8e} at (%u, %u), sub-resource %u.\n", - value.x, value.y, value.z, value.w, x, y, sub_resource_idx); + "Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e} at (%u, %u), sub-resource %u.\n", + value.x, value.y, value.z, value.w, + expected_value->x, expected_value->y, expected_value->z, expected_value->w, + x, y, sub_resource_idx); } #define check_texture_vec4(a, b, c) check_texture_vec4_(__LINE__, a, b, c)
1
0
0
0
Józef Kucia : d3d11/tests: Print expected result in case of failures in check_texture_sub_resource_* () functions.
by Alexandre Julliard
08 Dec '16
08 Dec '16
Module: wine Branch: master Commit: 22aa67e8abe227ab5eb3ab05262945afc8328850 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=22aa67e8abe227ab5eb3ab052…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Dec 7 12:57:51 2016 +0100 d3d11/tests: Print expected result in case of failures in check_texture_sub_resource_*() functions. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 0b3cb10..898e3b8 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -775,8 +775,8 @@ static void check_texture_sub_resource_color_(unsigned int line, ID3D11Texture2D } release_resource_readback(&rb); ok_(__FILE__, line)(all_match, - "Got unexpected color 0x%08x at (%u, %u), sub-resource %u.\n", - color, x, y, sub_resource_idx); + "Got 0x%08x, expected 0x%08x at (%u, %u), sub-resource %u.\n", + color, expected_color, x, y, sub_resource_idx); } #define check_texture_color(t, c, d) check_texture_color_(__LINE__, t, c, d) @@ -818,8 +818,8 @@ static void check_texture_sub_resource_float_(unsigned int line, ID3D11Texture2D } release_resource_readback(&rb); ok_(__FILE__, line)(all_match, - "Got unexpected value %.8e at (%u, %u), sub-resource %u.\n", - value, x, y, sub_resource_idx); + "Got %.8e, expected %.8e at (%u, %u), sub-resource %u.\n", + value, expected_value, x, y, sub_resource_idx); } #define check_texture_float(r, f, d) check_texture_float_(__LINE__, r, f, d) @@ -861,8 +861,10 @@ static void check_texture_sub_resource_vec4_(unsigned int line, ID3D11Texture2D } release_resource_readback(&rb); ok_(__FILE__, line)(all_match, - "Got unexpected value {%.8e, %.8e, %.8e, %.8e} at (%u, %u), sub-resource %u.\n", - value.x, value.y, value.z, value.w, x, y, sub_resource_idx); + "Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e} at (%u, %u), sub-resource %u.\n", + value.x, value.y, value.z, value.w, + expected_value->x, expected_value->y, expected_value->z, expected_value->w, + x, y, sub_resource_idx); } #define check_texture_vec4(a, b, c) check_texture_vec4_(__LINE__, a, b, c)
1
0
0
0
Józef Kucia : wined3d: Rename WINED3D_RS_CCW_STENCIL* render states to WINED3D_RS_BACK_STENCIL*.
by Alexandre Julliard
08 Dec '16
08 Dec '16
Module: wine Branch: master Commit: 4972cc89ce7bd0490cbb9deff01c337141144628 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4972cc89ce7bd0490cbb9deff…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Dec 7 12:43:05 2016 +0100 wined3d: Rename WINED3D_RS_CCW_STENCIL* render states to WINED3D_RS_BACK_STENCIL*. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 8 ++++---- dlls/wined3d/state.c | 48 +++++++++++++++++++++++------------------------ dlls/wined3d/stateblock.c | 14 +++++++------- dlls/wined3d/utils.c | 8 ++++---- include/wine/wined3d.h | 8 ++++---- 5 files changed, 43 insertions(+), 43 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=4972cc89ce7bd0490cbb9…
1
0
0
0
Józef Kucia : wined3d: Use opaque data type for stream output registers.
by Alexandre Julliard
08 Dec '16
08 Dec '16
Module: wine Branch: master Commit: 81e50b6d4126b4b811e98e1004788544eb4863fe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=81e50b6d4126b4b811e98e100…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Dec 7 12:43:04 2016 +0100 wined3d: Use opaque data type for stream output registers. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/shader_sm4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index 00fb4c0..4a4926b 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -922,7 +922,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = {WINED3D_SM5_OP_BFI, WINED3DSIH_BFI, "u", "iiuu"}, {WINED3D_SM5_OP_BFREV, WINED3DSIH_BFREV, "u", "u"}, {WINED3D_SM5_OP_SWAPC, WINED3DSIH_SWAPC, "ff", "uff"}, - {WINED3D_SM5_OP_DCL_STREAM, WINED3DSIH_DCL_STREAM, "", "f"}, + {WINED3D_SM5_OP_DCL_STREAM, WINED3DSIH_DCL_STREAM, "", "O"}, {WINED3D_SM5_OP_DCL_FUNCTION_BODY, WINED3DSIH_DCL_FUNCTION_BODY, "", "", shader_sm5_read_dcl_function_body}, {WINED3D_SM5_OP_DCL_FUNCTION_TABLE, WINED3DSIH_DCL_FUNCTION_TABLE, "", "",
1
0
0
0
Józef Kucia : wined3d: Recognize dynamic linking shader instructions.
by Alexandre Julliard
08 Dec '16
08 Dec '16
Module: wine Branch: master Commit: 875636980395e3ba02bc9bfc0229f77d358734cb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=875636980395e3ba02bc9bfc0…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Dec 7 12:43:03 2016 +0100 wined3d: Recognize dynamic linking shader instructions. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/arb_program_shader.c | 4 +++ dlls/wined3d/glsl_shader.c | 32 +++++++++-------- dlls/wined3d/shader.c | 73 ++++++++++++++++++++++++++++----------- dlls/wined3d/shader_sm1.c | 2 +- dlls/wined3d/shader_sm4.c | 64 +++++++++++++++++++++++++++++++--- dlls/wined3d/wined3d_private.h | 25 ++++++++++++-- 6 files changed, 158 insertions(+), 42 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=875636980395e3ba02bc9…
1
0
0
0
Andrew Wesie : d3d11/tests: Add test for primitive restart.
by Alexandre Julliard
08 Dec '16
08 Dec '16
Module: wine Branch: master Commit: fe5b03beb5922f39ce1fa709984e4c2c98948061 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fe5b03beb5922f39ce1fa7099…
Author: Andrew Wesie <awesie(a)gmail.com> Date: Wed Dec 7 12:43:02 2016 +0100 d3d11/tests: Add test for primitive restart. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 161 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 7c6e875..0b3cb10 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -11774,6 +11774,166 @@ static void test_sm4_ret_instruction(void) release_test_context(&test_context); } +static void test_primitive_restart(void) +{ + struct d3d11_test_context test_context; + unsigned int stride, offset, x, y; + ID3D11Buffer *ib32, *ib16, *vb; + ID3D11DeviceContext *context; + struct resource_readback rb; + ID3D11InputLayout *layout; + ID3D11VertexShader *vs; + ID3D11PixelShader *ps; + ID3D11Device *device; + unsigned int i; + HRESULT hr; + + static const DWORD ps_code[] = + { +#if 0 + struct vs_out + { + float4 position : SV_Position; + float4 color : color; + }; + + float4 main(vs_out input) : SV_TARGET + { + return input.color; + } +#endif + 0x43425844, 0x119e48d1, 0x468aecb3, 0x0a405be5, 0x4e203b82, 0x00000001, 0x000000f4, 0x00000003, + 0x0000002c, 0x00000080, 0x000000b4, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x6f6c6f63, 0xabab0072, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000038, 0x00000040, + 0x0000000e, 0x03001062, 0x001010f2, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x05000036, + 0x001020f2, 0x00000000, 0x00101e46, 0x00000001, 0x0100003e, + }; + static const DWORD vs_code[] = + { +#if 0 + struct vs_out + { + float4 position : SV_Position; + float4 color : color; + }; + + void main(float4 position : POSITION, uint vertex_id : SV_VertexID, out vs_out output) + { + output.position = position; + output.color = vertex_id < 4 ? float4(0.0, 1.0, 1.0, 1.0) : float4(1.0, 0.0, 0.0, 1.0); + } +#endif + 0x43425844, 0x2fa57573, 0xdb71c15f, 0x2641b028, 0xa8f87ccc, 0x00000001, 0x00000198, 0x00000003, + 0x0000002c, 0x00000084, 0x000000d8, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000041, 0x00000000, 0x00000006, + 0x00000001, 0x00000001, 0x00000101, 0x49534f50, 0x4e4f4954, 0x5f565300, 0x74726556, 0x44497865, + 0xababab00, 0x4e47534f, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, + 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, + 0x0000000f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x6f6c6f63, 0xabab0072, 0x52444853, 0x000000b8, + 0x00010040, 0x0000002e, 0x0300005f, 0x001010f2, 0x00000000, 0x04000060, 0x00101012, 0x00000001, + 0x00000006, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000001, + 0x02000068, 0x00000001, 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0700004f, + 0x00100012, 0x00000000, 0x0010100a, 0x00000001, 0x00004001, 0x00000004, 0x0f000037, 0x001020f2, + 0x00000001, 0x00100006, 0x00000000, 0x00004002, 0x00000000, 0x3f800000, 0x3f800000, 0x3f800000, + 0x00004002, 0x3f800000, 0x00000000, 0x00000000, 0x3f800000, 0x0100003e, + }; + static const D3D11_INPUT_ELEMENT_DESC layout_desc[] = + { + {"position", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, + }; + static const struct vec2 vertices[] = + { + {-1.00f, -1.0f}, + {-1.00f, 1.0f}, + {-0.25f, -1.0f}, + {-0.25f, 1.0f}, + { 0.25f, -1.0f}, + { 0.25f, 1.0f}, + { 1.00f, -1.0f}, + { 1.00f, 1.0f}, + }; + static const float black[] = {0.0f, 0.0f, 0.0f, 0.0f}; + static const unsigned short indices16[] = + { + 0, 1, 2, 3, 0xffff, 4, 5, 6, 7 + }; + static const unsigned int indices32[] = + { + 0, 1, 2, 3, 0xffffffff, 4, 5, 6, 7 + }; + + if (!init_test_context(&test_context, NULL)) + return; + + device = test_context.device; + context = test_context.immediate_context; + + hr = ID3D11Device_CreateVertexShader(device, vs_code, sizeof(vs_code), NULL, &vs); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_code, sizeof(ps_code), NULL, &ps); + ok(SUCCEEDED(hr), "Failed to create return pixel shader, hr %#x.\n", hr); + + ib16 = create_buffer(device, D3D11_BIND_INDEX_BUFFER, sizeof(indices16), indices16); + ib32 = create_buffer(device, D3D11_BIND_INDEX_BUFFER, sizeof(indices32), indices32); + + hr = ID3D11Device_CreateInputLayout(device, layout_desc, + sizeof(layout_desc) / sizeof(*layout_desc), + vs_code, sizeof(vs_code), &layout); + ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); + + vb = create_buffer(device, D3D11_BIND_VERTEX_BUFFER, sizeof(vertices), vertices); + + ID3D11DeviceContext_VSSetShader(context, vs, NULL, 0); + ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); + + ID3D11DeviceContext_IASetInputLayout(context, layout); + ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + stride = sizeof(*vertices); + offset = 0; + ID3D11DeviceContext_IASetVertexBuffers(context, 0, 1, &vb, &stride, &offset); + + for (i = 0; i < 2; ++i) + { + if (!i) + ID3D11DeviceContext_IASetIndexBuffer(context, ib32, DXGI_FORMAT_R32_UINT, 0); + else + ID3D11DeviceContext_IASetIndexBuffer(context, ib16, DXGI_FORMAT_R16_UINT, 0); + + ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, black); + ID3D11DeviceContext_DrawIndexed(context, 9, 0, 0); + get_texture_readback(test_context.backbuffer, 0, &rb); + for (y = 0; y < 480; ++y) + { + for (x = 0; x < 640; ++x) + { + DWORD color = get_readback_color(&rb, x, y); + DWORD expected_color; + if (x < 240) + expected_color = 0xffffff00; + else if (x >= 640 - 240) + expected_color = 0xff0000ff; + else + expected_color = 0x00000000; + ok(compare_color(color, expected_color, 1), + "Test %u: Got 0x%08x, expected 0x%08x at (%u, %u).\n", + i, color, expected_color, x, y); + } + } + release_resource_readback(&rb); + } + + ID3D11Buffer_Release(ib16); + ID3D11Buffer_Release(ib32); + ID3D11Buffer_Release(vb); + ID3D11InputLayout_Release(layout); + ID3D11PixelShader_Release(ps); + ID3D11VertexShader_Release(vs); + release_test_context(&test_context); +} + START_TEST(d3d11) { test_create_device(); @@ -11839,4 +11999,5 @@ START_TEST(d3d11) test_stencil_separate(); test_uav_load(); test_sm4_ret_instruction(); + test_primitive_restart(); }
1
0
0
0
Józef Kucia : wined3d: Implement primitive restart.
by Alexandre Julliard
08 Dec '16
08 Dec '16
Module: wine Branch: master Commit: ffcea8af7720007c5cd58f796fc3d6e672ec26da URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ffcea8af7720007c5cd58f796…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Dec 7 12:43:01 2016 +0100 wined3d: Implement primitive restart. Based on a patch by Andrew Wesie. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d8/directx.c | 2 +- dlls/d3d9/directx.c | 3 ++- dlls/ddraw/ddraw_private.h | 2 +- dlls/wined3d/context.c | 17 +++++++++++++++-- dlls/wined3d/directx.c | 2 ++ dlls/wined3d/wined3d_gl.h | 1 + include/wine/wined3d.h | 1 + 7 files changed, 23 insertions(+), 5 deletions(-) diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c index 18753cd..d307265 100644 --- a/dlls/d3d8/directx.c +++ b/dlls/d3d8/directx.c @@ -432,7 +432,7 @@ BOOL d3d8_init(struct d3d8 *d3d8) { DWORD flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING | WINED3D_HANDLE_RESTORE | WINED3D_PIXEL_CENTER_INTEGER - | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR; + | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR | WINED3D_NO_PRIMITIVE_RESTART; d3d8->IDirect3D8_iface.lpVtbl = &d3d8_vtbl; d3d8->refcount = 1; diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index 5772c11..c377992 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -664,7 +664,8 @@ static const struct IDirect3D9ExVtbl d3d9_vtbl = BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended) { DWORD flags = WINED3D_PRESENT_CONVERSION | WINED3D_HANDLE_RESTORE | WINED3D_PIXEL_CENTER_INTEGER - | WINED3D_SRGB_READ_WRITE_CONTROL | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR; + | WINED3D_SRGB_READ_WRITE_CONTROL | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR + | WINED3D_NO_PRIMITIVE_RESTART; if (!extended) flags |= WINED3D_VIDMEM_ACCOUNTING; diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index fe4603b..731d441 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -61,7 +61,7 @@ struct FvfToDecl #define DDRAW_WINED3D_FLAGS (WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING \ | WINED3D_RESTORE_MODE_ON_ACTIVATE | WINED3D_FOCUS_MESSAGES | WINED3D_PIXEL_CENTER_INTEGER \ - | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR) + | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR | WINED3D_NO_PRIMITIVE_RESTART) enum ddraw_device_state { diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 727f074..2ce99cb 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1634,16 +1634,17 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, struct wined3d_texture *target, const struct wined3d_format *ds_format) { struct wined3d_device *device = swapchain->device; + const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_format *color_format; struct wined3d_context *ret; + BOOL hdc_is_private = FALSE; BOOL auxBuffers = FALSE; HGLRC ctx, share_ctx; int pixel_format; unsigned int s; DWORD state; HDC hdc = 0; - BOOL hdc_is_private = FALSE; TRACE("swapchain %p, target %p, window %p.\n", swapchain, target, swapchain->win_handle); @@ -1823,7 +1824,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, goto out; } - ret->d3d_info = &device->adapter->d3d_info; + ret->d3d_info = d3d_info; ret->state_table = device->StateTable; /* Mark all states dirty to force a proper initialization of the states @@ -1979,6 +1980,18 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, { GL_EXTCALL(glProvokingVertexEXT(GL_FIRST_VERTEX_CONVENTION_EXT)); } + if (!(d3d_info->wined3d_creation_flags & WINED3D_NO_PRIMITIVE_RESTART)) + { + if (gl_info->supported[ARB_ES3_COMPATIBILITY]) + { + gl_info->gl_ops.gl.p_glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX); + checkGLcall("Enable GL_PRIMITIVE_RESTART_FIXED_INDEX"); + } + else + { + FIXME("OpenGL implementation does not support GL_PRIMITIVE_RESTART_FIXED_INDEX.\n"); + } + } if (gl_info->supported[ARB_CLIP_CONTROL]) GL_EXTCALL(glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT)); device->shader_backend->shader_init_context_state(ret); diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 5787c22..34c42be 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -122,6 +122,7 @@ static const struct wined3d_extension_map gl_extension_map[] = {"GL_ARB_draw_elements_base_vertex", ARB_DRAW_ELEMENTS_BASE_VERTEX }, {"GL_ARB_draw_instanced", ARB_DRAW_INSTANCED }, {"GL_ARB_ES2_compatibility", ARB_ES2_COMPATIBILITY }, + {"GL_ARB_ES3_compatibility", ARB_ES3_COMPATIBILITY }, {"GL_ARB_explicit_attrib_location", ARB_EXPLICIT_ATTRIB_LOCATION }, {"GL_ARB_fragment_coord_conventions", ARB_FRAGMENT_COORD_CONVENTIONS}, {"GL_ARB_fragment_program", ARB_FRAGMENT_PROGRAM }, @@ -3635,6 +3636,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, DWORD {ARB_TEXTURE_STORAGE, MAKEDWORD_VERSION(4, 2)}, {ARB_DEBUG_OUTPUT, MAKEDWORD_VERSION(4, 3)}, + {ARB_ES3_COMPATIBILITY, MAKEDWORD_VERSION(4, 3)}, {ARB_INTERNALFORMAT_QUERY2, MAKEDWORD_VERSION(4, 3)}, {ARB_SHADER_IMAGE_SIZE, MAKEDWORD_VERSION(4, 3)}, {ARB_STENCIL_TEXTURING, MAKEDWORD_VERSION(4, 3)}, diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 26089ad..cb1647c 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -55,6 +55,7 @@ enum wined3d_gl_extension ARB_DRAW_ELEMENTS_BASE_VERTEX, ARB_DRAW_INSTANCED, ARB_ES2_COMPATIBILITY, + ARB_ES3_COMPATIBILITY, ARB_EXPLICIT_ATTRIB_LOCATION, ARB_FRAGMENT_COORD_CONVENTIONS, ARB_FRAGMENT_PROGRAM, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 6a720d0..6bbb672 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -1267,6 +1267,7 @@ enum wined3d_display_rotation #define WINED3D_LEGACY_FFP_LIGHTING 0x00000100 #define WINED3D_SRGB_READ_WRITE_CONTROL 0x00000200 #define WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR 0x00000400 +#define WINED3D_NO_PRIMITIVE_RESTART 0x00000800 #define WINED3D_RESZ_CODE 0x7fa05000
1
0
0
0
Józef Kucia : d3d9/tests: Add test showing that primitive restart must be disabled.
by Alexandre Julliard
08 Dec '16
08 Dec '16
Module: wine Branch: master Commit: 49f6aa32ef088460f982250d344db8a0e96307e6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=49f6aa32ef088460f982250d3…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Dec 7 12:43:00 2016 +0100 d3d9/tests: Add test showing that primitive restart must be disabled. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/visual.c | 158 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 155 insertions(+), 3 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index e25e85c..b1916c4 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -22018,13 +22018,13 @@ static void test_evict_bound_resources(void) hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); - hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(green_quad), (void **)&data, 0); + hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(green_quad), &data, 0); ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); memcpy(data, green_quad, sizeof(green_quad)); hr = IDirect3DVertexBuffer9_Unlock(vb); ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); - hr = IDirect3DIndexBuffer9_Lock(ib, 0, sizeof(indices), (void **)&data, 0); + hr = IDirect3DIndexBuffer9_Lock(ib, 0, sizeof(indices), &data, 0); ok(hr == D3D_OK, "Failed to lock index buffer, hr %#x.\n", hr); memcpy(data, indices, sizeof(indices)); hr = IDirect3DIndexBuffer9_Unlock(ib); @@ -22032,7 +22032,7 @@ static void test_evict_bound_resources(void) hr = IDirect3DDevice9_SetIndices(device, ib); ok(hr == D3D_OK, "Failed to set index buffer, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, 4 * sizeof(DWORD)); + hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(*green_quad)); ok(hr == D3D_OK, "Failed to set stream source, hr %#x.\n", hr); hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); @@ -22068,6 +22068,157 @@ static void test_evict_bound_resources(void) DestroyWindow(window); } +/* This test shows that 0xffff is valid index in D3D9. */ +static void test_max_index16(void) +{ + static const D3DMATRIX mat = + {{{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, + }}}; + static const struct vertex + { + struct vec3 position; + DWORD diffuse; + } + green_quad[] = + { + {{-1.0f, -1.0f, 0.1f}, D3DCOLOR_ARGB(0xff, 0x00, 0xff, 0x00)}, + {{-1.0f, 1.0f, 0.1f}, D3DCOLOR_ARGB(0xff, 0x00, 0xff, 0x00)}, + {{ 1.0f, -1.0f, 0.1f}, D3DCOLOR_ARGB(0xff, 0x00, 0xff, 0x00)}, + {{ 1.0f, 1.0f, 0.1f}, D3DCOLOR_ARGB(0xff, 0x00, 0xff, 0x00)}, + }; + static const unsigned short indices[] = {0, 1, 2, 0xffff}; + static const unsigned int vertex_count = 0xffff + 1; + + D3DADAPTER_IDENTIFIER9 identifier; + IDirect3DVertexBuffer9 *vb; + IDirect3DIndexBuffer9 *ib; + IDirect3DDevice9 *device; + struct vertex *vb_data; + IDirect3D9 *d3d9; + ULONG refcount; + D3DCOLOR color; + D3DCAPS9 caps; + HWND window; + void *data; + HRESULT hr; + BOOL warp; + + window = create_window(); + d3d9 = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d9, "Failed to create a D3D object.\n"); + + hr = IDirect3D9_GetAdapterIdentifier(d3d9, D3DADAPTER_DEFAULT, 0, &identifier); + ok(SUCCEEDED(hr), "Failed to get adapter identifier, hr %#x.\n", hr); + warp = adapter_is_warp(&identifier); + + if (!(device = create_device(d3d9, window, window, TRUE))) + { + skip("Failed to create a D3D device.\n"); + IDirect3D9_Release(d3d9); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.MaxVertexIndex < 0xffff) + { + skip("Max vertex index is lower than 0xffff (%#x).\n", caps.MaxVertexIndex); + IDirect3DDevice9_Release(device); + IDirect3D9_Release(d3d9); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_CreateVertexBuffer(device, vertex_count * sizeof(*green_quad), 0, + D3DFVF_XYZ | D3DFVF_DIFFUSE, D3DPOOL_MANAGED, &vb, NULL); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + + hr = IDirect3DDevice9_CreateIndexBuffer(device, sizeof(indices), 0, + D3DFMT_INDEX16, D3DPOOL_MANAGED, &ib, NULL); + ok(SUCCEEDED(hr), "Failed to create index buffer, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLD, &mat); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_VIEW, &mat); + ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &mat); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CLIPPING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable Z test, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE); + ok(SUCCEEDED(hr), "Failed to disable culling, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHABLENDENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable blending, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); + ok(SUCCEEDED(hr), "Failed to set alpha op, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set alpha arg, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + + hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(green_quad), (void **)&vb_data, 0); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + vb_data[0] = green_quad[0]; + vb_data[1] = green_quad[1]; + vb_data[2] = green_quad[2]; + vb_data[0xffff] = green_quad[3]; + hr = IDirect3DVertexBuffer9_Unlock(vb); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + + hr = IDirect3DIndexBuffer9_Lock(ib, 0, sizeof(indices), &data, 0); + ok(hr == D3D_OK, "Failed to lock index buffer, hr %#x.\n", hr); + memcpy(data, indices, sizeof(indices)); + hr = IDirect3DIndexBuffer9_Unlock(ib); + ok(hr == D3D_OK, "Failed to unlock index buffer, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetIndices(device, ib); + ok(hr == D3D_OK, "Failed to set index buffer, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(struct vertex)); + ok(hr == D3D_OK, "Failed to set stream source, hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 0, vertex_count, 0, 2); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + color = getPixelColor(device, 20, 20); + ok(color_match(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x0000ff00, 1) || broken(warp), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 620, 460); + ok(color_match(color, 0x0000ff00, 1) || broken(warp), "Got unexpected color 0x%08x.\n", color); + + IDirect3DIndexBuffer9_Release(ib); + IDirect3DVertexBuffer9_Release(vb); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d9); + DestroyWindow(window); +} + START_TEST(visual) { D3DADAPTER_IDENTIFIER9 identifier; @@ -22194,4 +22345,5 @@ START_TEST(visual) test_line_antialiasing_blending(); test_dsy(); test_evict_bound_resources(); + test_max_index16(); }
1
0
0
0
Józef Kucia : d3d8/tests: Add test showing that primitive restart must be disabled.
by Alexandre Julliard
08 Dec '16
08 Dec '16
Module: wine Branch: master Commit: 30b8fb0f76d0941fd609365c755d857d42cd9cbb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=30b8fb0f76d0941fd609365c7…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Dec 7 12:42:59 2016 +0100 d3d8/tests: Add test showing that primitive restart must be disabled. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d8/tests/visual.c | 153 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 34d34b1..bf7058c 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -9528,6 +9528,158 @@ static void test_edge_antialiasing_blending(void) DestroyWindow(window); } +/* This test shows that 0xffff is valid index in D3D8. */ +static void test_max_index16(void) +{ + static const D3DMATRIX mat = + {{{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, + }}}; + static const struct vertex + { + struct vec3 position; + DWORD diffuse; + } + green_quad[] = + { + {{-1.0f, -1.0f, 0.1f}, D3DCOLOR_ARGB(0xff, 0x00, 0xff, 0x00)}, + {{-1.0f, 1.0f, 0.1f}, D3DCOLOR_ARGB(0xff, 0x00, 0xff, 0x00)}, + {{ 1.0f, -1.0f, 0.1f}, D3DCOLOR_ARGB(0xff, 0x00, 0xff, 0x00)}, + {{ 1.0f, 1.0f, 0.1f}, D3DCOLOR_ARGB(0xff, 0x00, 0xff, 0x00)}, + }; + static const unsigned short indices[] = {0, 1, 2, 0xffff}; + static const unsigned int vertex_count = 0xffff + 1; + + D3DADAPTER_IDENTIFIER8 identifier; + IDirect3DVertexBuffer8 *vb; + IDirect3DIndexBuffer8 *ib; + IDirect3DDevice8 *device; + struct vertex *vb_data; + IDirect3D8 *d3d8; + ULONG refcount; + D3DCOLOR color; + D3DCAPS8 caps; + HWND window; + BYTE *data; + HRESULT hr; + BOOL warp; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d8 = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d8, "Failed to create a D3D object.\n"); + + hr = IDirect3D8_GetAdapterIdentifier(d3d8, D3DADAPTER_DEFAULT, 0, &identifier); + ok(SUCCEEDED(hr), "Failed to get adapter identifier, hr %#x.\n", hr); + warp = adapter_is_warp(&identifier); + + if (!(device = create_device(d3d8, window, window, TRUE))) + { + skip("Failed to create a D3D device.\n"); + IDirect3D8_Release(d3d8); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.MaxVertexIndex < 0xffff) + { + skip("Max vertex index is lower than 0xffff (%#x).\n", caps.MaxVertexIndex); + IDirect3DDevice8_Release(device); + IDirect3D8_Release(d3d8); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice8_CreateVertexBuffer(device, vertex_count * sizeof(*green_quad), 0, + D3DFVF_XYZ | D3DFVF_DIFFUSE, D3DPOOL_MANAGED, &vb); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + + hr = IDirect3DDevice8_CreateIndexBuffer(device, sizeof(indices), 0, + D3DFMT_INDEX16, D3DPOOL_MANAGED, &ib); + ok(SUCCEEDED(hr), "Failed to create index buffer, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetTransform(device, D3DTS_WORLD, &mat); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTransform(device, D3DTS_VIEW, &mat); + ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, &mat); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_CLIPPING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable Z test, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_STENCILENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE); + ok(SUCCEEDED(hr), "Failed to disable culling, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ALPHABLENDENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable blending, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); + ok(SUCCEEDED(hr), "Failed to set alpha op, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set alpha arg, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + + hr = IDirect3DVertexBuffer8_Lock(vb, 0, sizeof(green_quad), (BYTE **)&vb_data, 0); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + vb_data[0] = green_quad[0]; + vb_data[1] = green_quad[1]; + vb_data[2] = green_quad[2]; + vb_data[0xffff] = green_quad[3]; + hr = IDirect3DVertexBuffer8_Unlock(vb); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + + hr = IDirect3DIndexBuffer8_Lock(ib, 0, sizeof(indices), &data, 0); + ok(hr == D3D_OK, "Failed to lock index buffer, hr %#x.\n", hr); + memcpy(data, indices, sizeof(indices)); + hr = IDirect3DIndexBuffer8_Unlock(ib); + ok(hr == D3D_OK, "Failed to unlock index buffer, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetIndices(device, ib, 0); + ok(hr == D3D_OK, "Failed to set index buffer, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetStreamSource(device, 0, vb, sizeof(struct vertex)); + ok(hr == D3D_OK, "Failed to set stream source, hr %#x.\n", hr); + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + hr = IDirect3DDevice8_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, 0, vertex_count, 0, 2); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice8_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + color = getPixelColor(device, 20, 20); + ok(color_match(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x0000ff00, 1) || broken(warp), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 620, 460); + ok(color_match(color, 0x0000ff00, 1) || broken(warp), "Got unexpected color 0x%08x.\n", color); + + IDirect3DIndexBuffer8_Release(ib); + IDirect3DVertexBuffer8_Release(vb); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d8); + DestroyWindow(window); +} + START_TEST(visual) { D3DADAPTER_IDENTIFIER8 identifier; @@ -9596,4 +9748,5 @@ START_TEST(visual) test_texture_blending(); test_color_clamping(); test_edge_antialiasing_blending(); + test_max_index16(); }
1
0
0
0
Józef Kucia : wined3d: Do not generate shader epilogue in subroutines.
by Alexandre Julliard
08 Dec '16
08 Dec '16
Module: wine Branch: master Commit: 4e2ee0e452c7060a120dd6edff7ac9fdd13b2808 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4e2ee0e452c7060a120dd6edf…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Dec 7 12:42:58 2016 +0100 wined3d: Do not generate shader epilogue in subroutines. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/glsl_shader.c | 57 ++++++++++++++++++++++-------------------- dlls/wined3d/shader.c | 9 ++++--- dlls/wined3d/wined3d_private.h | 9 ++++--- 3 files changed, 40 insertions(+), 35 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index b3e7607..88f4465 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -2625,7 +2625,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * break; case WINED3DSPR_LOOP: - sprintf(register_name, "aL%u", ins->ctx->loop_state->current_reg - 1); + sprintf(register_name, "aL%u", ins->ctx->state->current_loop_reg - 1); break; case WINED3DSPR_SAMPLER: @@ -4309,7 +4309,7 @@ static void shader_glsl_sgn(const struct wined3d_shader_instruction *ins) /* FIXME: I don't think nested loops will work correctly this way. */ static void shader_glsl_loop(const struct wined3d_shader_instruction *ins) { - struct wined3d_shader_loop_state *loop_state = ins->ctx->loop_state; + struct wined3d_shader_parser_state *state = ins->ctx->state; struct wined3d_string_buffer *buffer = ins->ctx->buffer; const struct wined3d_shader *shader = ins->ctx->shader; const struct wined3d_shader_lconst *constant; @@ -4347,65 +4347,65 @@ static void shader_glsl_loop(const struct wined3d_shader_instruction *ins) if (loop_control.step > 0) { shader_addline(buffer, "for (aL%u = %u; aL%u < (%u * %d + %u); aL%u += %d)\n{\n", - loop_state->current_depth, loop_control.start, - loop_state->current_depth, loop_control.count, loop_control.step, loop_control.start, - loop_state->current_depth, loop_control.step); + state->current_loop_depth, loop_control.start, + state->current_loop_depth, loop_control.count, loop_control.step, loop_control.start, + state->current_loop_depth, loop_control.step); } else if (loop_control.step < 0) { shader_addline(buffer, "for (aL%u = %u; aL%u > (%u * %d + %u); aL%u += %d)\n{\n", - loop_state->current_depth, loop_control.start, - loop_state->current_depth, loop_control.count, loop_control.step, loop_control.start, - loop_state->current_depth, loop_control.step); + state->current_loop_depth, loop_control.start, + state->current_loop_depth, loop_control.count, loop_control.step, loop_control.start, + state->current_loop_depth, loop_control.step); } else { shader_addline(buffer, "for (aL%u = %u, tmpInt%u = 0; tmpInt%u < %u; tmpInt%u++)\n{\n", - loop_state->current_depth, loop_control.start, loop_state->current_depth, - loop_state->current_depth, loop_control.count, - loop_state->current_depth); + state->current_loop_depth, loop_control.start, state->current_loop_depth, + state->current_loop_depth, loop_control.count, + state->current_loop_depth); } } else { shader_addline(buffer, "for (tmpInt%u = 0, aL%u = %s.y; tmpInt%u < %s.x; tmpInt%u++, aL%u += %s.z)\n{\n", - loop_state->current_depth, loop_state->current_reg, - src1_param.reg_name, loop_state->current_depth, src1_param.reg_name, - loop_state->current_depth, loop_state->current_reg, src1_param.reg_name); + state->current_loop_depth, state->current_loop_reg, + src1_param.reg_name, state->current_loop_depth, src1_param.reg_name, + state->current_loop_depth, state->current_loop_reg, src1_param.reg_name); } - ++loop_state->current_reg; + ++state->current_loop_reg; } else { shader_addline(buffer, "for (;;)\n{\n"); } - ++loop_state->current_depth; + ++state->current_loop_depth; } static void shader_glsl_end(const struct wined3d_shader_instruction *ins) { - struct wined3d_shader_loop_state *loop_state = ins->ctx->loop_state; + struct wined3d_shader_parser_state *state = ins->ctx->state; shader_addline(ins->ctx->buffer, "}\n"); if (ins->handler_idx == WINED3DSIH_ENDLOOP) { - --loop_state->current_depth; - --loop_state->current_reg; + --state->current_loop_depth; + --state->current_loop_reg; } if (ins->handler_idx == WINED3DSIH_ENDREP) { - --loop_state->current_depth; + --state->current_loop_depth; } } static void shader_glsl_rep(const struct wined3d_shader_instruction *ins) { + struct wined3d_shader_parser_state *state = ins->ctx->state; const struct wined3d_shader *shader = ins->ctx->shader; - struct wined3d_shader_loop_state *loop_state = ins->ctx->loop_state; const struct wined3d_shader_lconst *constant; struct glsl_src_param src0_param; const DWORD *control_values = NULL; @@ -4426,18 +4426,18 @@ static void shader_glsl_rep(const struct wined3d_shader_instruction *ins) if (control_values) { shader_addline(ins->ctx->buffer, "for (tmpInt%d = 0; tmpInt%d < %d; tmpInt%d++) {\n", - loop_state->current_depth, loop_state->current_depth, - control_values[0], loop_state->current_depth); + state->current_loop_depth, state->current_loop_depth, + control_values[0], state->current_loop_depth); } else { shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_0, &src0_param); shader_addline(ins->ctx->buffer, "for (tmpInt%d = 0; tmpInt%d < %s; tmpInt%d++) {\n", - loop_state->current_depth, loop_state->current_depth, - src0_param.param_str, loop_state->current_depth); + state->current_loop_depth, state->current_loop_depth, + src0_param.param_str, state->current_loop_depth); } - ++loop_state->current_depth; + ++state->current_loop_depth; } static void shader_glsl_switch(const struct wined3d_shader_instruction *ins) @@ -4537,6 +4537,9 @@ static void shader_glsl_label(const struct wined3d_shader_instruction *ins) { shader_addline(ins->ctx->buffer, "}\n"); shader_addline(ins->ctx->buffer, "void subroutine%u()\n{\n", ins->src[0].reg.idx[0].offset); + + /* Subroutines appear at the end of the shader. */ + ins->ctx->state->in_subroutine = TRUE; } static void shader_glsl_call(const struct wined3d_shader_instruction *ins) @@ -4557,7 +4560,7 @@ static void shader_glsl_ret(const struct wined3d_shader_instruction *ins) { const struct wined3d_shader_version *version = &ins->ctx->shader->reg_maps.shader_version; - if (version->major >= 4) + if (version->major >= 4 && !ins->ctx->state->in_subroutine) { shader_glsl_generate_shader_epilogue(ins->ctx); shader_addline(ins->ctx->buffer, "return;\n"); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index a34694b..d434a64 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -2104,7 +2104,7 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_st const struct wined3d_shader_frontend *fe = shader->frontend; void *fe_data = shader->frontend_data; struct wined3d_shader_version shader_version; - struct wined3d_shader_loop_state loop_state; + struct wined3d_shader_parser_state state; struct wined3d_shader_instruction ins; struct wined3d_shader_tex_mx tex_mx; struct wined3d_shader_context ctx; @@ -2112,15 +2112,16 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_st /* Initialize current parsing state. */ tex_mx.current_row = 0; - loop_state.current_depth = 0; - loop_state.current_reg = 0; + state.current_loop_depth = 0; + state.current_loop_reg = 0; + state.in_subroutine = FALSE; ctx.shader = shader; ctx.gl_info = &device->adapter->gl_info; ctx.reg_maps = reg_maps; ctx.buffer = buffer; ctx.tex_mx = &tex_mx; - ctx.loop_state = &loop_state; + ctx.state = &state; ctx.backend_data = backend_ctx; ins.ctx = &ctx; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 0e6dcb0..859b89f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -900,10 +900,11 @@ struct wined3d_shader_tex_mx DWORD texcoord_w[2]; }; -struct wined3d_shader_loop_state +struct wined3d_shader_parser_state { - UINT current_depth; - UINT current_reg; + unsigned int current_loop_depth; + unsigned int current_loop_reg; + BOOL in_subroutine; }; struct wined3d_shader_context @@ -913,7 +914,7 @@ struct wined3d_shader_context const struct wined3d_shader_reg_maps *reg_maps; struct wined3d_string_buffer *buffer; struct wined3d_shader_tex_mx *tex_mx; - struct wined3d_shader_loop_state *loop_state; + struct wined3d_shader_parser_state *state; void *backend_data; };
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
35
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Results per page:
10
25
50
100
200