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
May 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
4 participants
542 discussions
Start a n
N
ew thread
Markus Heidelberg : jscript: Date.parse: make "UTC"/"GMT" optional before the timezone offset.
by Alexandre Julliard
24 May '16
24 May '16
Module: wine Branch: master Commit: 74257d59405898730eac3dffbdd9f7c4ec3b2935 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=74257d59405898730eac3dffb…
Author: Markus Heidelberg <markus.heidelberg(a)web.de> Date: Sat May 21 12:41:40 2016 +0200 jscript: Date.parse: make "UTC"/"GMT" optional before the timezone offset. Signed-off-by: Markus Heidelberg <markus.heidelberg(a)web.de> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/date.c | 38 ++++++++++++++++++++++---------------- dlls/jscript/tests/api.js | 4 ++++ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index 6d98fcd..a80690c 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c @@ -2174,6 +2174,28 @@ static inline HRESULT date_parse(jsstr_t *input_str, double *ret) { year = tmp; } } + else if(parse[i]=='+' || parse[i]=='-') { + /* Timezone offset */ + BOOL positive = TRUE; + + if(set_offset && set_hour_adjust) break; + set_offset = TRUE; + set_hour_adjust = FALSE; + + if(parse[i] == '-') positive = FALSE; + + i++; + while(isspaceW(parse[i])) i++; + if(parse[i]<'0' || parse[i]>'9') break; + offset = atoiW(&parse[i]); + while(parse[i]>='0' && parse[i]<='9') i++; + + if(offset<24) offset *= 60; + else offset = (offset/100)*60 + offset%100; + + if(positive) offset = -offset; + + } else { if(parse[i]<'A' || parse[i]>'Z') break; else if(parse[i]=='B' && (parse[i+1]=='C' || @@ -2230,27 +2252,11 @@ static inline HRESULT date_parse(jsstr_t *input_str, double *ret) { else if((parse[i]=='U' && parse[i+1]=='T' && parse[i+2]=='C') || (parse[i]=='G' && parse[i+1]=='M' && parse[i+2]=='T')) { /* Timezone */ - BOOL positive = TRUE; - if(set_offset) break; set_offset = TRUE; set_hour_adjust = FALSE; i += 3; - while(isspaceW(parse[i])) i++; - if(parse[i] == '-') positive = FALSE; - else if(parse[i] != '+') continue; - - i++; - while(isspaceW(parse[i])) i++; - if(parse[i]<'0' || parse[i]>'9') break; - offset = atoiW(&parse[i]); - while(parse[i]>='0' && parse[i]<='9') i++; - - if(offset<24) offset *= 60; - else offset = (offset/100)*60 + offset%100; - - if(positive) offset = -offset; } else { /* Month or garbage */ diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index dacacc4..e5e6350 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -2108,6 +2108,10 @@ ok(Date.parse("71 11:32AM Dec 12 UTC BC ") === -64346358480000, "Date.parse(\"71 ok(Date.parse("23/71/2000 11::32::UTC") === 1010662320000, "Date.parse(\"23/71/2000 11::32::UTC\") = " + Date.parse("23/71/2000 11::32::UTC")); ok(Date.parse("1970/01/01") === Date.parse("01/01/1970"), "Date.parse(\"1970/01/01\") = " + Date.parse("1970/01/01")); ok(Date.parse("71/12/14") === Date.parse("12/14/1971"), "Date.parse(\"71/12/14\") = " + Date.parse("71/12/14")); +ok(Date.parse("Tue, 22 Mar 2016 09:57:55 -0300") === Date.parse("Tue, 22 Mar 2016 09:57:55 GMT-0300"), + "Date.parse(\"Tue, 22 Mar 2016 09:57:55 -0300\") = " + Date.parse("Tue, 22 Mar 2016 09:57:55 -0300")); +ok(Date.parse("Tue, 22 Mar 2016 09:57:55 +0400") === Date.parse("Tue, 22 Mar 2016 09:57:55 UTC+0400"), + "Date.parse(\"Tue, 22 Mar 2016 09:57:55 +0400\") = " + Date.parse("Tue, 22 Mar 2016 09:57:55 +0400")); ok(typeof(Math.PI) === "number", "typeof(Math.PI) = " + typeof(Math.PI)); ok(Math.floor(Math.PI*100) === 314, "Math.PI = " + Math.PI);
1
0
0
0
Józef Kucia : d3d10core/tests: Add test showing that inputs aren't matched with outputs.
by Alexandre Julliard
24 May '16
24 May '16
Module: wine Branch: master Commit: 7b5c0e7a307bce8e6a3e71ad46fda17bc6439eee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7b5c0e7a307bce8e6a3e71ad4…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue May 24 10:17:51 2016 +0200 d3d10core/tests: Add test showing that inputs aren't matched with outputs. 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 | 118 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 36878ed..f768773 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -6609,6 +6609,123 @@ static void test_draw_depth_only(void) release_test_context(&test_context); } +static void test_shader_stage_input_output_matching(void) +{ + struct d3d10core_test_context test_context; + D3D10_TEXTURE2D_DESC texture_desc; + ID3D10Texture2D *render_target; + ID3D10RenderTargetView *rtv[2]; + ID3D10VertexShader *vs; + ID3D10PixelShader *ps; + ID3D10Device *device; + HRESULT hr; + + static const DWORD vs_code[] = + { +#if 0 + struct output + { + float4 position : SV_PoSiTion; + float4 color0 : COLOR0; + float4 color1 : COLOR1; + }; + + void main(uint id : SV_VertexID, out output o) + { + float2 coords = float2((id << 1) & 2, id & 2); + o.position = float4(coords * float2(2, -2) + float2(-1, 1), 0, 1); + o.color0 = float4(1.0f, 0.0f, 0.0f, 1.0f); + o.color1 = float4(0.0f, 1.0f, 0.0f, 1.0f); + } +#endif + 0x43425844, 0x93c216a1, 0xbaa7e8d4, 0xd5368c6a, 0x4e889e07, 0x00000001, 0x00000224, 0x00000003, + 0x0000002c, 0x00000060, 0x000000cc, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000006, 0x00000001, 0x00000000, 0x00000101, 0x565f5653, 0x65747265, 0x00444978, + 0x4e47534f, 0x00000064, 0x00000003, 0x00000008, 0x00000050, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x0000005c, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, + 0x0000005c, 0x00000001, 0x00000000, 0x00000003, 0x00000002, 0x0000000f, 0x505f5653, 0x5469536f, + 0x006e6f69, 0x4f4c4f43, 0xabab0052, 0x52444853, 0x00000150, 0x00010040, 0x00000054, 0x04000060, + 0x00101012, 0x00000000, 0x00000006, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x03000065, + 0x001020f2, 0x00000001, 0x03000065, 0x001020f2, 0x00000002, 0x02000068, 0x00000001, 0x07000029, + 0x00100012, 0x00000000, 0x0010100a, 0x00000000, 0x00004001, 0x00000001, 0x07000001, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0x00000002, 0x07000001, 0x00100042, 0x00000000, + 0x0010100a, 0x00000000, 0x00004001, 0x00000002, 0x05000056, 0x00100032, 0x00000000, 0x00100086, + 0x00000000, 0x0f000032, 0x00102032, 0x00000000, 0x00100046, 0x00000000, 0x00004002, 0x40000000, + 0xc0000000, 0x00000000, 0x00000000, 0x00004002, 0xbf800000, 0x3f800000, 0x00000000, 0x00000000, + 0x08000036, 0x001020c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, + 0x08000036, 0x001020f2, 0x00000001, 0x00004002, 0x3f800000, 0x00000000, 0x00000000, 0x3f800000, + 0x08000036, 0x001020f2, 0x00000002, 0x00004002, 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, + 0x0100003e, + }; + static const DWORD ps_code[] = + { +#if 0 + struct input + { + float4 position : SV_PoSiTiOn; + float4 color1 : COLOR1; + float4 color0 : COLOR0; + }; + + struct output + { + float4 target0 : SV_Target0; + float4 target1 : SV_Target1; + }; + + void main(const in input i, out output o) + { + o.target0 = i.color0; + o.target1 = i.color1; + } +#endif + 0x43425844, 0x620ef963, 0xed8f19fe, 0x7b3a0a53, 0x126ce021, 0x00000001, 0x00000150, 0x00000003, + 0x0000002c, 0x00000098, 0x000000e4, 0x4e475349, 0x00000064, 0x00000003, 0x00000008, 0x00000050, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x0000005c, 0x00000001, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x0000005c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, + 0x00000f0f, 0x505f5653, 0x5469536f, 0x006e4f69, 0x4f4c4f43, 0xabab0052, 0x4e47534f, 0x00000044, + 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, + 0x00000038, 0x00000001, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, 0x545f5653, 0x65677261, + 0xabab0074, 0x52444853, 0x00000064, 0x00000040, 0x00000019, 0x03001062, 0x001010f2, 0x00000001, + 0x03001062, 0x001010f2, 0x00000002, 0x03000065, 0x001020f2, 0x00000000, 0x03000065, 0x001020f2, + 0x00000001, 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000002, 0x05000036, 0x001020f2, + 0x00000001, 0x00101e46, 0x00000001, 0x0100003e, + }; + + if (!init_test_context(&test_context)) + return; + + device = test_context.device; + + hr = ID3D10Device_CreateVertexShader(device, vs_code, sizeof(vs_code), &vs); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); + hr = ID3D10Device_CreatePixelShader(device, ps_code, sizeof(ps_code), &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + + ID3D10Texture2D_GetDesc(test_context.backbuffer, &texture_desc); + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &render_target); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + rtv[0] = test_context.backbuffer_rtv; + hr = ID3D10Device_CreateRenderTargetView(device, (ID3D10Resource *)render_target, NULL, &rtv[1]); + ok(SUCCEEDED(hr), "Failed to create render target view, hr %#x.\n", hr); + + ID3D10Device_VSSetShader(device, vs); + ID3D10Device_PSSetShader(device, ps); + ID3D10Device_IASetPrimitiveTopology(device, D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST); + ID3D10Device_OMSetRenderTargets(device, 2, rtv, NULL); + ID3D10Device_Draw(device, 3, 0); + + check_texture_color(test_context.backbuffer, 0xff00ff00, 0); + check_texture_color(render_target, 0xff0000ff, 0); + + ID3D10RenderTargetView_Release(rtv[1]); + ID3D10Texture2D_Release(render_target); + ID3D10PixelShader_Release(ps); + ID3D10VertexShader_Release(vs); + release_test_context(&test_context); +} + START_TEST(device) { test_feature_level(); @@ -6646,4 +6763,5 @@ START_TEST(device) test_clear_render_target_view(); test_clear_depth_stencil_view(); test_draw_depth_only(); + test_shader_stage_input_output_matching(); }
1
0
0
0
Józef Kucia : d3d11/tests: Add test showing that inputs aren't matched with outputs.
by Alexandre Julliard
24 May '16
24 May '16
Module: wine Branch: master Commit: 8b6f8c1eaf3dda7fd33cc0930780dabab426c1ce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b6f8c1eaf3dda7fd33cc0930…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue May 24 10:17:50 2016 +0200 d3d11/tests: Add test showing that inputs aren't matched with outputs. 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 | 120 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index a959c0b..85ec201 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6756,6 +6756,125 @@ static void test_getdc(void) ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_shader_stage_input_output_matching(void) +{ + struct d3d11_test_context test_context; + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11Texture2D *render_target; + ID3D11RenderTargetView *rtv[2]; + ID3D11DeviceContext *context; + ID3D11VertexShader *vs; + ID3D11PixelShader *ps; + ID3D11Device *device; + HRESULT hr; + + static const DWORD vs_code[] = + { +#if 0 + struct output + { + float4 position : SV_PoSiTion; + float4 color0 : COLOR0; + float4 color1 : COLOR1; + }; + + void main(uint id : SV_VertexID, out output o) + { + float2 coords = float2((id << 1) & 2, id & 2); + o.position = float4(coords * float2(2, -2) + float2(-1, 1), 0, 1); + o.color0 = float4(1.0f, 0.0f, 0.0f, 1.0f); + o.color1 = float4(0.0f, 1.0f, 0.0f, 1.0f); + } +#endif + 0x43425844, 0x93c216a1, 0xbaa7e8d4, 0xd5368c6a, 0x4e889e07, 0x00000001, 0x00000224, 0x00000003, + 0x0000002c, 0x00000060, 0x000000cc, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000006, 0x00000001, 0x00000000, 0x00000101, 0x565f5653, 0x65747265, 0x00444978, + 0x4e47534f, 0x00000064, 0x00000003, 0x00000008, 0x00000050, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x0000005c, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, + 0x0000005c, 0x00000001, 0x00000000, 0x00000003, 0x00000002, 0x0000000f, 0x505f5653, 0x5469536f, + 0x006e6f69, 0x4f4c4f43, 0xabab0052, 0x52444853, 0x00000150, 0x00010040, 0x00000054, 0x04000060, + 0x00101012, 0x00000000, 0x00000006, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x03000065, + 0x001020f2, 0x00000001, 0x03000065, 0x001020f2, 0x00000002, 0x02000068, 0x00000001, 0x07000029, + 0x00100012, 0x00000000, 0x0010100a, 0x00000000, 0x00004001, 0x00000001, 0x07000001, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0x00000002, 0x07000001, 0x00100042, 0x00000000, + 0x0010100a, 0x00000000, 0x00004001, 0x00000002, 0x05000056, 0x00100032, 0x00000000, 0x00100086, + 0x00000000, 0x0f000032, 0x00102032, 0x00000000, 0x00100046, 0x00000000, 0x00004002, 0x40000000, + 0xc0000000, 0x00000000, 0x00000000, 0x00004002, 0xbf800000, 0x3f800000, 0x00000000, 0x00000000, + 0x08000036, 0x001020c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, + 0x08000036, 0x001020f2, 0x00000001, 0x00004002, 0x3f800000, 0x00000000, 0x00000000, 0x3f800000, + 0x08000036, 0x001020f2, 0x00000002, 0x00004002, 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, + 0x0100003e, + }; + static const DWORD ps_code[] = + { +#if 0 + struct input + { + float4 position : SV_PoSiTiOn; + float4 color1 : COLOR1; + float4 color0 : COLOR0; + }; + + struct output + { + float4 target0 : SV_Target0; + float4 target1 : SV_Target1; + }; + + void main(const in input i, out output o) + { + o.target0 = i.color0; + o.target1 = i.color1; + } +#endif + 0x43425844, 0x620ef963, 0xed8f19fe, 0x7b3a0a53, 0x126ce021, 0x00000001, 0x00000150, 0x00000003, + 0x0000002c, 0x00000098, 0x000000e4, 0x4e475349, 0x00000064, 0x00000003, 0x00000008, 0x00000050, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x0000005c, 0x00000001, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x0000005c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, + 0x00000f0f, 0x505f5653, 0x5469536f, 0x006e4f69, 0x4f4c4f43, 0xabab0052, 0x4e47534f, 0x00000044, + 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, + 0x00000038, 0x00000001, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, 0x545f5653, 0x65677261, + 0xabab0074, 0x52444853, 0x00000064, 0x00000040, 0x00000019, 0x03001062, 0x001010f2, 0x00000001, + 0x03001062, 0x001010f2, 0x00000002, 0x03000065, 0x001020f2, 0x00000000, 0x03000065, 0x001020f2, + 0x00000001, 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000002, 0x05000036, 0x001020f2, + 0x00000001, 0x00101e46, 0x00000001, 0x0100003e, + }; + + 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 pixel shader, hr %#x.\n", hr); + + ID3D11Texture2D_GetDesc(test_context.backbuffer, &texture_desc); + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &render_target); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + rtv[0] = test_context.backbuffer_rtv; + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)render_target, NULL, &rtv[1]); + ok(SUCCEEDED(hr), "Failed to create render target view, hr %#x.\n", hr); + + ID3D11DeviceContext_VSSetShader(context, vs, NULL, 0); + ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); + ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); + ID3D11DeviceContext_OMSetRenderTargets(context, 2, rtv, NULL); + ID3D11DeviceContext_Draw(context, 3, 0); + + check_texture_color(test_context.backbuffer, 0xff00ff00, 0); + check_texture_color(render_target, 0xff0000ff, 0); + + ID3D11RenderTargetView_Release(rtv[1]); + ID3D11Texture2D_Release(render_target); + ID3D11PixelShader_Release(ps); + ID3D11VertexShader_Release(vs); + release_test_context(&test_context); +} + START_TEST(d3d11) { test_create_device(); @@ -6796,4 +6915,5 @@ START_TEST(d3d11) test_draw_depth_only(); test_cb_relative_addressing(); test_getdc(); + test_shader_stage_input_output_matching(); }
1
0
0
0
Józef Kucia : wined3d: Allow draw calls without vertex declaration.
by Alexandre Julliard
24 May '16
24 May '16
Module: wine Branch: master Commit: b18d8ec04ae842c668f0f8c9bc35f3fa6575477e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b18d8ec04ae842c668f0f8c9b…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue May 24 10:17:49 2016 +0200 wined3d: Allow draw calls without vertex declaration. 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/context.c | 34 +++++++++++++++++++--------------- dlls/wined3d/device.c | 14 +------------- dlls/wined3d/wined3d_private.h | 3 ++- 3 files changed, 22 insertions(+), 29 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index d5dfa61..f07b3ab 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -3013,12 +3013,17 @@ void context_stream_info_from_declaration(struct wined3d_context *context, { /* We need to deal with frequency data! */ struct wined3d_vertex_declaration *declaration = state->vertex_declaration; - BOOL use_vshader = use_vs(state); BOOL generic_attributes = context->d3d_info->ffp_generic_attributes; + BOOL use_vshader = use_vs(state); unsigned int i; stream_info->use_map = 0; stream_info->swizzle_map = 0; + stream_info->position_transformed = 0; + + if (!declaration) + return; + stream_info->position_transformed = declaration->position_transformed; /* Translate the declaration into strided data. */ @@ -3113,9 +3118,9 @@ void context_stream_info_from_declaration(struct wined3d_context *context, /* Context activation is done by the caller. */ static void context_update_stream_info(struct wined3d_context *context, const struct wined3d_state *state) { - const struct wined3d_gl_info *gl_info = context->gl_info; - const struct wined3d_d3d_info *d3d_info = context->d3d_info; struct wined3d_stream_info *stream_info = &context->stream_info; + const struct wined3d_d3d_info *d3d_info = context->d3d_info; + const struct wined3d_gl_info *gl_info = context->gl_info; DWORD prev_all_vbo = stream_info->all_vbo; unsigned int i; WORD map; @@ -3170,17 +3175,21 @@ static void context_update_stream_info(struct wined3d_context *context, const st TRACE("Load array %u {%#x:%p}.\n", i, element->data.buffer_object, element->data.addr); } + if (prev_all_vbo != stream_info->all_vbo) + context_invalidate_state(context, STATE_INDEXBUFFER); + + context->use_immediate_mode_draw = FALSE; + + if (stream_info->all_vbo) + return; + if (use_vs(state)) { - if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo) + if (state->vertex_declaration->half_float_conv_needed) { TRACE("Using immediate mode draw with vertex shaders for FLOAT16 conversion.\n"); context->use_immediate_mode_draw = TRUE; } - else - { - context->use_immediate_mode_draw = FALSE; - } } else { @@ -3188,15 +3197,10 @@ static void context_update_stream_info(struct wined3d_context *context, const st slow_mask |= -!gl_info->supported[ARB_VERTEX_ARRAY_BGRA] & ((1u << WINED3D_FFP_DIFFUSE) | (1u << WINED3D_FFP_SPECULAR)); - if (((stream_info->position_transformed && !d3d_info->xyzrhw) - || (stream_info->use_map & slow_mask)) && !stream_info->all_vbo) + if ((stream_info->position_transformed && !d3d_info->xyzrhw) + || (stream_info->use_map & slow_mask)) context->use_immediate_mode_draw = TRUE; - else - context->use_immediate_mode_draw = FALSE; } - - if (prev_all_vbo != stream_info->all_vbo) - context_invalidate_state(context, STATE_INDEXBUFFER); } /* Context activation is done by the caller. */ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 5171a8e..84834a4 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3482,12 +3482,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT { TRACE("device %p, start_vertex %u, vertex_count %u.\n", device, start_vertex, vertex_count); - if (!device->state.vertex_declaration) - { - WARN("Called without a valid vertex declaration set.\n"); - return WINED3DERR_INVALIDCALL; - } - if (device->state.load_base_vertex_index) { device->state.load_base_vertex_index = 0; @@ -3524,14 +3518,8 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic return WINED3DERR_INVALIDCALL; } - if (!device->state.vertex_declaration) - { - WARN("Called without a valid vertex declaration set.\n"); - return WINED3DERR_INVALIDCALL; - } - if (!gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX] && - device->state.load_base_vertex_index != device->state.base_vertex_index) + device->state.load_base_vertex_index != device->state.base_vertex_index) { device->state.load_base_vertex_index = device->state.base_vertex_index; device_invalidate_state(device, STATE_BASEVERTEXINDEX); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f3ad8ef..b5a2732 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3544,7 +3544,8 @@ static inline BOOL use_vs(const struct wined3d_state *state) { /* Check state->vertex_declaration to allow this to be used before the * stream info is validated, for example in device_update_tex_unit_map(). */ - return state->shader[WINED3D_SHADER_TYPE_VERTEX] && !state->vertex_declaration->position_transformed; + return state->shader[WINED3D_SHADER_TYPE_VERTEX] + && (!state->vertex_declaration || !state->vertex_declaration->position_transformed); } static inline BOOL use_ps(const struct wined3d_state *state)
1
0
0
0
Józef Kucia : d3d9: Check if valid vertex declaration is set before issuing draw call.
by Alexandre Julliard
24 May '16
24 May '16
Module: wine Branch: master Commit: bd41d53a2334efe1b6d86296e971f0d34de22ad1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bd41d53a2334efe1b6d86296e…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue May 24 10:17:48 2016 +0200 d3d9: Check if valid vertex declaration is set before issuing draw call. 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/d3d9_private.h | 1 + dlls/d3d9/device.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index a0703ab..b618ff4 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -167,6 +167,7 @@ struct d3d9_device LONG device_state; BOOL in_destruction; BOOL in_scene; + BOOL has_vertex_declaration; UINT implicit_swapchain_count; struct d3d9_swapchain **implicit_swapchains; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 4bbdd42..6301ae9 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2292,6 +2292,12 @@ static HRESULT WINAPI d3d9_device_DrawPrimitive(IDirect3DDevice9Ex *iface, iface, primitive_type, start_vertex, primitive_count); wined3d_mutex_lock(); + if (!device->has_vertex_declaration) + { + wined3d_mutex_unlock(); + WARN("Called without a valid vertex declaration set.\n"); + return D3DERR_INVALIDCALL; + } wined3d_device_set_primitive_type(device->wined3d_device, primitive_type); hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex, vertex_count_from_primitive_count(primitive_type, primitive_count)); @@ -2313,6 +2319,12 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitive(IDirect3DDevice9Ex *iface vertex_count, start_idx, primitive_count); wined3d_mutex_lock(); + if (!device->has_vertex_declaration) + { + wined3d_mutex_unlock(); + WARN("Called without a valid vertex declaration set.\n"); + return D3DERR_INVALIDCALL; + } wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_idx); wined3d_device_set_primitive_type(device->wined3d_device, primitive_type); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx, @@ -2373,6 +2385,13 @@ static HRESULT WINAPI d3d9_device_DrawPrimitiveUP(IDirect3DDevice9Ex *iface, wined3d_mutex_lock(); + if (!device->has_vertex_declaration) + { + wined3d_mutex_unlock(); + WARN("Called without a valid vertex declaration set.\n"); + return D3DERR_INVALIDCALL; + } + hr = d3d9_device_prepare_vertex_buffer(device, size); if (FAILED(hr)) goto done; @@ -2466,6 +2485,13 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa wined3d_mutex_lock(); + if (!device->has_vertex_declaration) + { + wined3d_mutex_unlock(); + WARN("Called without a valid vertex declaration set.\n"); + return D3DERR_INVALIDCALL; + } + hr = d3d9_device_prepare_vertex_buffer(device, vtx_size); if (FAILED(hr)) goto done; @@ -2579,6 +2605,7 @@ static HRESULT WINAPI d3d9_device_SetVertexDeclaration(IDirect3DDevice9Ex *iface wined3d_mutex_lock(); wined3d_device_set_vertex_declaration(device->wined3d_device, decl_impl ? decl_impl->wined3d_declaration : NULL); + device->has_vertex_declaration = !!decl_impl; wined3d_mutex_unlock(); return D3D_OK; @@ -2702,6 +2729,7 @@ static HRESULT WINAPI d3d9_device_SetFVF(IDirect3DDevice9Ex *iface, DWORD fvf) } wined3d_device_set_vertex_declaration(device->wined3d_device, decl); + device->has_vertex_declaration = TRUE; wined3d_mutex_unlock(); return D3D_OK;
1
0
0
0
Józef Kucia : d3d9/tests: Add some tests for draw methods.
by Alexandre Julliard
24 May '16
24 May '16
Module: wine Branch: master Commit: e8aa575ff657c4ed9a1405388be5a46db2188b87 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8aa575ff657c4ed9a1405388…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue May 24 10:17:47 2016 +0200 d3d9/tests: Add some tests for draw methods. 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/device.c | 126 ++++++++++++++++++++++++++++++----------------- 1 file changed, 80 insertions(+), 46 deletions(-) diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 4302f76..71af012 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -2764,21 +2764,23 @@ done: DestroyWindow(window); } -/* Test what happens when IDirect3DDevice9_DrawIndexedPrimitive is called without a valid index buffer set. */ -static void test_draw_indexed(void) +static void test_draw_primitive(void) { - static const struct { + static const struct + { float position[3]; DWORD color; - } quad[] = { + } + quad[] = + { {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, {{-1.0f, 1.0f, 0.0f}, 0xffff0000}, {{ 1.0f, 1.0f, 0.0f}, 0xffff0000}, {{ 1.0f, -1.0f, 0.0f}, 0xffff0000}, }; - WORD indices[] = {0, 1, 2, 3, 0, 2}; - - static const D3DVERTEXELEMENT9 decl_elements[] = { + static const WORD indices[] = {0, 1, 2, 3, 0, 2}; + static const D3DVERTEXELEMENT9 decl_elements[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END() @@ -2794,79 +2796,111 @@ static void test_draw_indexed(void) HRESULT hr; void *ptr; - window = CreateWindowA("d3d9_test_wc", "d3d9_test", 0, - 0, 0, 640, 480, 0, 0, 0, 0); - ok(!!window, "Failed to create a window.\n"); + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); d3d9 = Direct3DCreate9(D3D_SDK_VERSION); ok(!!d3d9, "Failed to create a D3D object.\n"); if (!(device = create_device(d3d9, window, NULL))) { - skip("Failed to create a 3D device, skipping test.\n"); - goto cleanup; + skip("Failed to create a D3D device.\n"); + IDirect3D9_Release(d3d9); + DestroyWindow(window); + return; } hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &vertex_declaration); - ok(SUCCEEDED(hr), "CreateVertexDeclaration failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "CreateVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad), 0, 0, D3DPOOL_DEFAULT, &vertex_buffer, NULL); - ok(SUCCEEDED(hr), "CreateVertexBuffer failed (0x%08x)\n", hr); + hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad), 0, 0, + D3DPOOL_DEFAULT, &vertex_buffer, NULL); + ok(SUCCEEDED(hr), "CreateVertexBuffer failed, hr %#x.\n", hr); hr = IDirect3DVertexBuffer9_Lock(vertex_buffer, 0, 0, &ptr, D3DLOCK_DISCARD); - ok(SUCCEEDED(hr), "Lock failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "Lock failed, hr %#x.\n", hr); memcpy(ptr, quad, sizeof(quad)); hr = IDirect3DVertexBuffer9_Unlock(vertex_buffer); - ok(SUCCEEDED(hr), "Unlock failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "Unlock failed, hr %#x.\n", hr); hr = IDirect3DDevice9_SetStreamSource(device, 0, vertex_buffer, 0, sizeof(*quad)); - ok(SUCCEEDED(hr), "SetStreamSource failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "SetStreamSource failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_CreateIndexBuffer(device, sizeof(indices), 0, D3DFMT_INDEX16, D3DPOOL_DEFAULT, &index_buffer, NULL); - ok(SUCCEEDED(hr), "CreateIndexBuffer failed (0x%08x)\n", hr); + hr = IDirect3DDevice9_CreateIndexBuffer(device, sizeof(indices), 0, D3DFMT_INDEX16, + D3DPOOL_DEFAULT, &index_buffer, NULL); + ok(SUCCEEDED(hr), "CreateIndexBuffer failed, hr %#x.\n", hr); hr = IDirect3DIndexBuffer9_Lock(index_buffer, 0, 0, &ptr, D3DLOCK_DISCARD); - ok(SUCCEEDED(hr), "Lock failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "Lock failed, hr %#x.\n", hr); memcpy(ptr, indices, sizeof(indices)); hr = IDirect3DIndexBuffer9_Unlock(index_buffer); - ok(SUCCEEDED(hr), "Unlock failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "Unlock failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); - ok(SUCCEEDED(hr), "SetRenderState D3DRS_LIGHTING failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "SetRenderState D3DRS_LIGHTING failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "BeginScene failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "BeginScene failed, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLELIST, 0, 2); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 2, quad, sizeof(*quad)); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* NULL index buffer. Should fail */ hr = IDirect3DDevice9_SetIndices(device, NULL); - ok(SUCCEEDED(hr), "SetIndices failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0 /* BaseVertexIndex */, 0 /* MinIndex */, - 4 /* NumVerts */, 0 /* StartIndex */, 2 /*PrimCount */); - ok(hr == D3DERR_INVALIDCALL, "DrawIndexedPrimitive returned 0x%08x, expected D3DERR_INVALIDCALL (0x%08x)\n", - hr, D3DERR_INVALIDCALL); + ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0 /* BaseVertexIndex */, + 0 /* MinIndex */, 4 /* NumVerts */, 0 /* StartIndex */, 2 /*PrimCount */); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); /* Valid index buffer, NULL vertex declaration. Should fail */ hr = IDirect3DDevice9_SetIndices(device, index_buffer); - ok(SUCCEEDED(hr), "SetIndices failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0 /* BaseVertexIndex */, 0 /* MinIndex */, - 4 /* NumVerts */, 0 /* StartIndex */, 2 /*PrimCount */); - ok(hr == D3DERR_INVALIDCALL, "DrawIndexedPrimitive returned 0x%08x, expected D3DERR_INVALIDCALL (0x%08x)\n", - hr, D3DERR_INVALIDCALL); + ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0 /* BaseVertexIndex */, + 0 /* MinIndex */, 4 /* NumVerts */, 0 /* StartIndex */, 2 /*PrimCount */); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2, + indices, D3DFMT_INDEX16, quad, sizeof(*quad)); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* Valid index buffer and vertex declaration. Should succeed */ hr = IDirect3DDevice9_SetVertexDeclaration(device, vertex_declaration); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0 /* BaseVertexIndex */, 0 /* MinIndex */, - 4 /* NumVerts */, 0 /* StartIndex */, 2 /*PrimCount */); - ok(SUCCEEDED(hr), "DrawIndexedPrimitive failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLELIST, 0, 2); + ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#x.\n", hr); + + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "DrawPrimitiveUP failed, hr %#x.\n", hr); + + /* NULL index buffer, valid vertex vertex declaration. Should succeed */ + hr = IDirect3DDevice9_SetIndices(device, NULL); + ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0 /* BaseVertexIndex */, + 0 /* MinIndex */, 4 /* NumVerts */, 0 /* StartIndex */, 2 /*PrimCount */); + todo_wine ok(SUCCEEDED(hr), "DrawIndexedPrimitive failed, hr %#x.\n", hr); + + /* Valid index buffer and vertex declaration. Should succeed */ + hr = IDirect3DDevice9_SetIndices(device, index_buffer); + ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0 /* BaseVertexIndex */, + 0 /* MinIndex */, 4 /* NumVerts */, 0 /* StartIndex */, 2 /*PrimCount */); + ok(SUCCEEDED(hr), "DrawIndexedPrimitive failed, hr %#x.\n", hr); + + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2, + indices, D3DFMT_INDEX16, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "DrawIndexedPrimitiveUP failed, hr %#x.\n", hr); hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "EndScene failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "EndScene failed, hr %#x.n", hr); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); IDirect3DVertexBuffer9_Release(vertex_buffer); IDirect3DIndexBuffer9_Release(index_buffer); IDirect3DVertexDeclaration9_Release(vertex_declaration); refcount = IDirect3DDevice9_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); -cleanup: IDirect3D9_Release(d3d9); DestroyWindow(window); } @@ -11223,7 +11257,7 @@ START_TEST(device) test_limits(); test_depthstenciltest(); test_get_rt(); - test_draw_indexed(); + test_draw_primitive(); test_null_stream(); test_lights(); test_set_stream_source();
1
0
0
0
Andrey Gusev : ddraw/tests: Fix a typo in ok() messages.
by Alexandre Julliard
24 May '16
24 May '16
Module: wine Branch: master Commit: b27389ae08ef4cd28b168193913c9408220dc568 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b27389ae08ef4cd28b1681939…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Tue May 24 00:47:19 2016 +0300 ddraw/tests: Fix a typo in ok() messages. Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/tests/ddraw1.c | 2 +- dlls/ddraw/tests/ddraw2.c | 2 +- dlls/ddraw/tests/ddraw4.c | 2 +- dlls/ddraw/tests/ddraw7.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 88d4f0c..c848593 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -2186,7 +2186,7 @@ static void test_redundant_mode_set(void) surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw_GetDisplayMode(ddraw, &surface_desc); - ok(SUCCEEDED(hr), "GetDipslayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); hr = IDirectDraw_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight, U1(surface_desc.ddpfPixelFormat).dwRGBBitCount); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index fdba786..eefa334 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -2337,7 +2337,7 @@ static void test_redundant_mode_set(void) surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc); - ok(SUCCEEDED(hr), "GetDipslayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); hr = IDirectDraw2_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight, U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, 0, 0); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index cbcae06..ab5ccab 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -2522,7 +2522,7 @@ static void test_redundant_mode_set(void) surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw4_GetDisplayMode(ddraw, &surface_desc); - ok(SUCCEEDED(hr), "GetDipslayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); hr = IDirectDraw4_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight, U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount, 0, 0); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 133d105..9a3bfe3 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -2252,7 +2252,7 @@ static void test_redundant_mode_set(void) surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw7_GetDisplayMode(ddraw, &surface_desc); - ok(SUCCEEDED(hr), "GetDipslayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); hr = IDirectDraw7_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight, U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount, 0, 0);
1
0
0
0
Andrey Gusev : include: Fix a typo in typedef struct _TEB.
by Alexandre Julliard
24 May '16
24 May '16
Module: wine Branch: master Commit: 8bf36bda9af522244b4d76e568259d0580e70491 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8bf36bda9af522244b4d76e56…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Tue May 24 12:05:33 2016 +0300 include: Fix a typo in typedef struct _TEB. Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/winternl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/winternl.h b/include/winternl.h index 0489395..f35091c 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -340,7 +340,7 @@ typedef struct _TEB ULONG GdiClientTID; /* 6f8/086c */ PVOID GdiThreadLocaleInfo; /* 6fc/0870 */ ULONG UserReserved[5]; /* 700/0878 */ - PVOID glDispachTable[280]; /* 714/0890 */ + PVOID glDispatchTable[280]; /* 714/0890 */ PVOID glReserved1[26]; /* b74/1150 */ PVOID glReserved2; /* bdc/1220 */ PVOID glSectionInfo; /* be0/1228 */
1
0
0
0
Henri Verbeet : d3d11: Get rid of struct d3d_shader_info.
by Alexandre Julliard
24 May '16
24 May '16
Module: wine Branch: master Commit: c09b560c11373fadd8fcc57bc3d3132402441a05 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c09b560c11373fadd8fcc57bc…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon May 23 18:06:30 2016 +0200 d3d11: Get rid of struct d3d_shader_info. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/d3d11_private.h | 7 ------ dlls/d3d11/shader.c | 63 +++++++++++++++------------------------------- 2 files changed, 20 insertions(+), 50 deletions(-) diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index cfc50a8..c52e3e4 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -48,13 +48,6 @@ struct d3d_device; -struct d3d_shader_info -{ - const DWORD *shader_code; - struct wined3d_shader_signature *input_signature; - struct wined3d_shader_signature *output_signature; -}; - extern const struct wined3d_parent_ops d3d_null_wined3d_parent_ops DECLSPEC_HIDDEN; /* TRACE helper functions */ diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c index bab3b63..f8647ff 100644 --- a/dlls/d3d11/shader.c +++ b/dlls/d3d11/shader.c @@ -26,25 +26,26 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d11); static HRESULT shdr_handler(const char *data, DWORD data_size, DWORD tag, void *ctx) { - struct d3d_shader_info *shader_info = ctx; + struct wined3d_shader_desc *desc = ctx; HRESULT hr; switch (tag) { case TAG_ISGN: - if (FAILED(hr = shader_parse_signature(data, data_size, shader_info->input_signature))) + if (FAILED(hr = shader_parse_signature(data, data_size, &desc->input_signature))) return hr; break; case TAG_OSGN: - if (FAILED(hr = shader_parse_signature(data, data_size, shader_info->output_signature))) + if (FAILED(hr = shader_parse_signature(data, data_size, &desc->output_signature))) return hr; break; case TAG_SHDR: case TAG_SHEX: - if (shader_info->shader_code) FIXME("Multiple SHDR/SHEX chunks.\n"); - shader_info->shader_code = (const DWORD *)data; + if (desc->byte_code) + FIXME("Multiple SHDR/SHEX chunks.\n"); + desc->byte_code = (const DWORD *)data; break; default: @@ -55,22 +56,23 @@ static HRESULT shdr_handler(const char *data, DWORD data_size, DWORD tag, void * return S_OK; } -static HRESULT shader_extract_from_dxbc(const void *dxbc, SIZE_T dxbc_length, struct d3d_shader_info *shader_info) +static HRESULT shader_extract_from_dxbc(const void *dxbc, SIZE_T dxbc_length, struct wined3d_shader_desc *desc) { HRESULT hr; - shader_info->shader_code = NULL; - memset(shader_info->input_signature, 0, sizeof(*shader_info->input_signature)); - memset(shader_info->output_signature, 0, sizeof(*shader_info->output_signature)); + desc->byte_code = NULL; + memset(&desc->input_signature, 0, sizeof(desc->input_signature)); + memset(&desc->output_signature, 0, sizeof(desc->output_signature)); - hr = parse_dxbc(dxbc, dxbc_length, shdr_handler, shader_info); - if (!shader_info->shader_code) hr = E_INVALIDARG; + hr = parse_dxbc(dxbc, dxbc_length, shdr_handler, desc); + if (!desc->byte_code) + hr = E_INVALIDARG; if (FAILED(hr)) { FIXME("Failed to parse shader, hr %#x.\n", hr); - shader_free_signature(shader_info->input_signature); - shader_free_signature(shader_info->output_signature); + shader_free_signature(&desc->input_signature); + shader_free_signature(&desc->output_signature); } return hr; @@ -385,7 +387,6 @@ static unsigned int d3d_sm_from_feature_level(D3D_FEATURE_LEVEL feature_level) static HRESULT d3d_vertex_shader_init(struct d3d_vertex_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length) { - struct d3d_shader_info shader_info; struct wined3d_shader_desc desc; HRESULT hr; @@ -395,17 +396,13 @@ static HRESULT d3d_vertex_shader_init(struct d3d_vertex_shader *shader, struct d wined3d_mutex_lock(); wined3d_private_store_init(&shader->private_store); - shader_info.input_signature = &desc.input_signature; - shader_info.output_signature = &desc.output_signature; - if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &shader_info))) + if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &desc))) { WARN("Failed to extract shader, hr %#x.\n", hr); wined3d_private_store_cleanup(&shader->private_store); wined3d_mutex_unlock(); return hr; } - - desc.byte_code = shader_info.shader_code; desc.max_version = d3d_sm_from_feature_level(device->feature_level); hr = wined3d_shader_create_vs(device->wined3d_device, &desc, shader, @@ -597,7 +594,6 @@ static const struct wined3d_parent_ops d3d11_hull_shader_wined3d_parent_ops = static HRESULT d3d11_hull_shader_init(struct d3d11_hull_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length) { - struct d3d_shader_info shader_info; struct wined3d_shader_desc desc; HRESULT hr; @@ -606,17 +602,13 @@ static HRESULT d3d11_hull_shader_init(struct d3d11_hull_shader *shader, struct d wined3d_mutex_lock(); wined3d_private_store_init(&shader->private_store); - shader_info.input_signature = &desc.input_signature; - shader_info.output_signature = &desc.output_signature; - if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &shader_info))) + if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &desc))) { WARN("Failed to extract shader, hr %#x.\n", hr); wined3d_private_store_cleanup(&shader->private_store); wined3d_mutex_unlock(); return hr; } - - desc.byte_code = shader_info.shader_code; desc.max_version = d3d_sm_from_feature_level(device->feature_level); hr = wined3d_shader_create_hs(device->wined3d_device, &desc, shader, @@ -789,7 +781,6 @@ static const struct wined3d_parent_ops d3d11_domain_shader_wined3d_parent_ops = static HRESULT d3d11_domain_shader_init(struct d3d11_domain_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length) { - struct d3d_shader_info shader_info; struct wined3d_shader_desc desc; HRESULT hr; @@ -798,17 +789,13 @@ static HRESULT d3d11_domain_shader_init(struct d3d11_domain_shader *shader, stru wined3d_mutex_lock(); wined3d_private_store_init(&shader->private_store); - shader_info.input_signature = &desc.input_signature; - shader_info.output_signature = &desc.output_signature; - if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &shader_info))) + if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &desc))) { WARN("Failed to extract shader, hr %#x.\n", hr); wined3d_private_store_cleanup(&shader->private_store); wined3d_mutex_unlock(); return hr; } - - desc.byte_code = shader_info.shader_code; desc.max_version = d3d_sm_from_feature_level(device->feature_level); hr = wined3d_shader_create_ds(device->wined3d_device, &desc, shader, @@ -1084,7 +1071,6 @@ static const struct wined3d_parent_ops d3d_geometry_shader_wined3d_parent_ops = static HRESULT d3d_geometry_shader_init(struct d3d_geometry_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length) { - struct d3d_shader_info shader_info; struct wined3d_shader_desc desc; HRESULT hr; @@ -1094,17 +1080,13 @@ static HRESULT d3d_geometry_shader_init(struct d3d_geometry_shader *shader, stru wined3d_mutex_lock(); wined3d_private_store_init(&shader->private_store); - shader_info.input_signature = &desc.input_signature; - shader_info.output_signature = &desc.output_signature; - if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &shader_info))) + if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &desc))) { WARN("Failed to extract shader, hr %#x.\n", hr); wined3d_private_store_cleanup(&shader->private_store); wined3d_mutex_unlock(); return hr; } - - desc.byte_code = shader_info.shader_code; desc.max_version = d3d_sm_from_feature_level(device->feature_level); hr = wined3d_shader_create_gs(device->wined3d_device, &desc, shader, @@ -1406,7 +1388,6 @@ static const struct wined3d_parent_ops d3d_pixel_shader_wined3d_parent_ops = static HRESULT d3d_pixel_shader_init(struct d3d_pixel_shader *shader, struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length) { - struct d3d_shader_info shader_info; struct wined3d_shader_desc desc; HRESULT hr; @@ -1416,17 +1397,13 @@ static HRESULT d3d_pixel_shader_init(struct d3d_pixel_shader *shader, struct d3d wined3d_mutex_lock(); wined3d_private_store_init(&shader->private_store); - shader_info.input_signature = &desc.input_signature; - shader_info.output_signature = &desc.output_signature; - if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &shader_info))) + if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &desc))) { WARN("Failed to extract shader, hr %#x.\n", hr); wined3d_private_store_cleanup(&shader->private_store); wined3d_mutex_unlock(); return hr; } - - desc.byte_code = shader_info.shader_code; desc.max_version = d3d_sm_from_feature_level(device->feature_level); hr = wined3d_shader_create_ps(device->wined3d_device, &desc, shader,
1
0
0
0
Henri Verbeet : wined3d: Store shader signatures directly in struct wined3d_shader_desc.
by Alexandre Julliard
24 May '16
24 May '16
Module: wine Branch: master Commit: 569fcd33dca2e15048919bc296173662f0577cac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=569fcd33dca2e15048919bc29…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon May 23 18:06:29 2016 +0200 wined3d: Store shader signatures directly in struct wined3d_shader_desc. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/shader.c | 60 +++++++++++++++++--------------------------------- dlls/d3d8/shader.c | 8 +++---- dlls/d3d9/shader.c | 8 +++---- dlls/wined3d/shader.c | 41 +++++++++++++++------------------- include/wine/wined3d.h | 4 ++-- 5 files changed, 48 insertions(+), 73 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=569fcd33dca2e15048919…
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
55
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Results per page:
10
25
50
100
200