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
February 2020
----- 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
874 discussions
Start a n
N
ew thread
Zebediah Figura : d3d9: Retrieve vertex shader constants from the primary stateblock.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 57684d55979d9d7270a5dc4748ba877b0f6fee0a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=57684d55979d9d7270a5dc47…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 10 20:55:56 2020 -0600 d3d9: Retrieve vertex shader constants from the primary stateblock. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/d3d9_private.h | 2 +- dlls/d3d9/device.c | 51 ++++++++++++++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index a7072162d5..bc9a3b98b2 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -114,7 +114,7 @@ struct d3d9_device DWORD auto_mipmaps; /* D3D9_MAX_TEXTURE_UNITS */ - unsigned int max_user_clip_planes; + unsigned int max_user_clip_planes, vs_uniform_count; UINT implicit_swapchain_count; struct wined3d_swapchain **implicit_swapchains; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index fe23625a05..f0741045ad 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3567,26 +3567,29 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantF(IDirect3DDevice9Ex *i } static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF(IDirect3DDevice9Ex *iface, - UINT reg_idx, float *data, UINT count) + UINT start_idx, float *constants, UINT count) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - HRESULT hr; + const struct wined3d_vec4 *src; - TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count); + TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count); - if (reg_idx + count > D3D9_MAX_VERTEX_SHADER_CONSTANTF) + if (!constants) + return D3DERR_INVALIDCALL; + + if (start_idx >= device->vs_uniform_count || count > device->vs_uniform_count - start_idx) { WARN("Trying to access %u constants, but d3d9 only supports %u\n", - reg_idx + count, D3D9_MAX_VERTEX_SHADER_CONSTANTF); + start_idx + count, device->vs_uniform_count); return D3DERR_INVALIDCALL; } wined3d_mutex_lock(); - hr = wined3d_device_get_vs_consts_f(device->wined3d_device, - reg_idx, count, (struct wined3d_vec4 *)data); + src = wined3d_stateblock_get_state(device->state)->vs_consts_f; + memcpy(constants, &src[start_idx], count * sizeof(*src)); wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI d3d9_device_SetVertexShaderConstantI(IDirect3DDevice9Ex *iface, @@ -3609,19 +3612,24 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantI(IDirect3DDevice9Ex *i } static HRESULT WINAPI d3d9_device_GetVertexShaderConstantI(IDirect3DDevice9Ex *iface, - UINT reg_idx, int *data, UINT count) + UINT start_idx, int *constants, UINT count) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - HRESULT hr; + const struct wined3d_ivec4 *src; - TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count); + TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count); + + if (!constants || start_idx >= WINED3D_MAX_CONSTS_I) + return WINED3DERR_INVALIDCALL; + if (count > WINED3D_MAX_CONSTS_I - start_idx) + count = WINED3D_MAX_CONSTS_I - start_idx; wined3d_mutex_lock(); - hr = wined3d_device_get_vs_consts_i(device->wined3d_device, - reg_idx, count, (struct wined3d_ivec4 *)data); + src = wined3d_stateblock_get_state(device->state)->vs_consts_i; + memcpy(constants, &src[start_idx], count * sizeof(*src)); wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI d3d9_device_SetVertexShaderConstantB(IDirect3DDevice9Ex *iface, @@ -3642,18 +3650,22 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantB(IDirect3DDevice9Ex *i } static HRESULT WINAPI d3d9_device_GetVertexShaderConstantB(IDirect3DDevice9Ex *iface, - UINT reg_idx, BOOL *data, UINT count) + UINT start_idx, BOOL *constants, UINT count) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - HRESULT hr; - TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count); + TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count); + + if (!constants || start_idx >= WINED3D_MAX_CONSTS_B) + return WINED3DERR_INVALIDCALL; + if (count > WINED3D_MAX_CONSTS_B - start_idx) + count = WINED3D_MAX_CONSTS_B - start_idx; wined3d_mutex_lock(); - hr = wined3d_device_get_vs_consts_b(device->wined3d_device, reg_idx, count, data); + memcpy(constants, &wined3d_stateblock_get_state(device->state)->vs_consts_b[start_idx], count * sizeof(*constants)); wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI d3d9_device_SetStreamSource(IDirect3DDevice9Ex *iface, @@ -4609,6 +4621,7 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine wined3d_get_device_caps(wined3d, adapter, device_type, &caps); device->max_user_clip_planes = caps.MaxUserClipPlanes; + device->vs_uniform_count = caps.MaxVertexShaderConst; if (flags & D3DCREATE_ADAPTERGROUP_DEVICE) count = caps.NumberOfAdaptersInGroup;
1
0
0
0
Jeff Smith : gdiplus: Round up when converting from 32-bit ARGB to PARGB.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: ddd88fe2f40299697208efc9f6b3842a4515054b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ddd88fe2f40299697208efc9…
Author: Jeff Smith <whydoubt(a)gmail.com> Date: Mon Feb 10 17:32:52 2020 -0600 gdiplus: Round up when converting from 32-bit ARGB to PARGB. Applies fix from d23bfd8dfc74a1955a0270feaf07ccd7a23a723a to setpixel_32bppPARGB. Signed-off-by: Jeff Smith <whydoubt(a)gmail.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/image.c | 6 +++--- dlls/gdiplus/tests/image.c | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 29fba1a9c1..dcdc49c6d6 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -459,9 +459,9 @@ static inline void setpixel_32bppARGB(BYTE r, BYTE g, BYTE b, BYTE a, static inline void setpixel_32bppPARGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x) { - r = r * a / 255; - g = g * a / 255; - b = b * a / 255; + r = (r * a + 127) / 255; + g = (g * a + 127) / 255; + b = (b * a + 127) / 255; *((DWORD*)(row)+x) = (a<<24)|(r<<16)|(g<<8)|b; } diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 8b9c44ef7b..d6f74050c0 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -4810,6 +4810,7 @@ static void test_PARGB_conversion(void) { BYTE pargb[8] = { 0x62,0x77,0x99,0x77, 0x62,0x77,0x99,0 }; BYTE argb[8] = { 0xd1,0xfe,0xff,0x77, 0x62,0x77,0x99,0 }; + BYTE pargb2[8] = { 0x01,0x01,0x00,0x01, 0xfe,0x7f,0x7f,0xfe }; BYTE *bits; GpBitmap *bitmap; BitmapData data; @@ -4836,6 +4837,28 @@ static void test_PARGB_conversion(void) status = GdipBitmapUnlockBits(bitmap, &data); expect(Ok, status); + /* Testing SetPixel 32-bit ARGB to PARGB */ + status = GdipBitmapSetPixel(bitmap, 0, 0, 0x017f80ff); + expect(Ok, status); + status = GdipBitmapSetPixel(bitmap, 1, 0, 0xfe7f80ff); + expect(Ok, status); + status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, PixelFormat32bppPARGB, &data); + expect(Ok, status); + ok(data.Width == 2, "expected 2, got %d\n", data.Width); + ok(data.Height == 1, "expected 1, got %d\n", data.Height); + ok(data.Stride == 8, "expected 8, got %d\n", data.Stride); + ok(data.PixelFormat == PixelFormat32bppPARGB, "expected PixelFormat32bppPARGB, got %d\n", data.PixelFormat); + match = !memcmp(data.Scan0, pargb2, sizeof(pargb2)); + ok(match, "bits don't match\n"); + if (!match) + { + bits = data.Scan0; + trace("format %#x, bits %02x,%02x,%02x,%02x %02x,%02x,%02x,%02x\n", PixelFormat32bppPARGB, + bits[0], bits[1], bits[2], bits[3], bits[4], bits[5], bits[6], bits[7]); + } + status = GdipBitmapUnlockBits(bitmap, &data); + expect(Ok, status); + GdipDisposeImage((GpImage *)bitmap); }
1
0
0
0
Jeff Smith : gdiplus: Fix calculation for 32-bit PARGB to ARGB conversion.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 06bf4283fbbde31f0ce496a93f896cc04a0ca825 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=06bf4283fbbde31f0ce496a9…
Author: Jeff Smith <whydoubt(a)gmail.com> Date: Mon Feb 10 17:32:51 2020 -0600 gdiplus: Fix calculation for 32-bit PARGB to ARGB conversion. Signed-off-by: Jeff Smith <whydoubt(a)gmail.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/image.c | 13 +++++++++---- dlls/gdiplus/tests/image.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 9fa2aaee95..29fba1a9c1 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -239,12 +239,17 @@ static inline void getpixel_32bppPARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, { *a = row[x*4+3]; if (*a == 0) - *r = *g = *b = 0; + { + *r = row[x*4+2]; + *g = row[x*4+1]; + *b = row[x*4]; + } else { - *r = row[x*4+2] * 255 / *a; - *g = row[x*4+1] * 255 / *a; - *b = row[x*4] * 255 / *a; + DWORD scaled_q = (255 << 15) / *a; + *r = (row[x*4+2] > *a) ? 0xff : (row[x*4+2] * scaled_q) >> 15; + *g = (row[x*4+1] > *a) ? 0xff : (row[x*4+1] * scaled_q) >> 15; + *b = (row[x*4] > *a) ? 0xff : (row[x*4] * scaled_q) >> 15; } } diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index eeeea8746a..8b9c44ef7b 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -4806,6 +4806,39 @@ static void test_ARGB_conversion(void) GdipDisposeImage((GpImage *)bitmap); } +static void test_PARGB_conversion(void) +{ + BYTE pargb[8] = { 0x62,0x77,0x99,0x77, 0x62,0x77,0x99,0 }; + BYTE argb[8] = { 0xd1,0xfe,0xff,0x77, 0x62,0x77,0x99,0 }; + BYTE *bits; + GpBitmap *bitmap; + BitmapData data; + GpStatus status; + int match; + + status = GdipCreateBitmapFromScan0(2, 1, 8, PixelFormat32bppPARGB, pargb, &bitmap); + expect(Ok, status); + + status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, PixelFormat32bppARGB, &data); + expect(Ok, status); + ok(data.Width == 2, "expected 2, got %d\n", data.Width); + ok(data.Height == 1, "expected 1, got %d\n", data.Height); + ok(data.Stride == 8, "expected 8, got %d\n", data.Stride); + ok(data.PixelFormat == PixelFormat32bppARGB, "expected PixelFormat32bppARGB, got %d\n", data.PixelFormat); + match = !memcmp(data.Scan0, argb, sizeof(argb)); + ok(match, "bits don't match\n"); + if (!match) + { + bits = data.Scan0; + trace("format %#x, bits %02x,%02x,%02x,%02x %02x,%02x,%02x,%02x\n", PixelFormat32bppARGB, + bits[0], bits[1], bits[2], bits[3], bits[4], bits[5], bits[6], bits[7]); + } + status = GdipBitmapUnlockBits(bitmap, &data); + expect(Ok, status); + + GdipDisposeImage((GpImage *)bitmap); +} + static void test_CloneBitmapArea(void) { @@ -5626,6 +5659,7 @@ START_TEST(image) test_supported_encoders(); test_CloneBitmapArea(); test_ARGB_conversion(); + test_PARGB_conversion(); test_DrawImage_scale(); test_image_format(); test_DrawImage();
1
0
0
0
Michael Stefaniuc : mshtml/tests: Get rid of strcmp_wa() in script.c.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 884f31b5c1302e6ab5b91ca49cc0b0d44ddd8799 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=884f31b5c1302e6ab5b91ca4…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Sun Feb 9 16:51:48 2020 +0200 mshtml/tests: Get rid of strcmp_wa() in script.c. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/tests/script.c | 55 ++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c index 87ac62a6a7..27405a71b5 100644 --- a/dlls/mshtml/tests/script.c +++ b/dlls/mshtml/tests/script.c @@ -172,13 +172,6 @@ static BOOL skip_loadobject_tests; static IActiveScriptSite *site; static SCRIPTSTATE state; -static int strcmp_wa(LPCWSTR strw, const char *stra) -{ - CHAR buf[512]; - WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL); - return lstrcmpA(stra, buf); -} - static BSTR a2bstr(const char *str) { BSTR ret; @@ -509,21 +502,21 @@ static IDispatchEx funcDisp = { &testObjVtbl }; static HRESULT WINAPI scriptDisp_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { - if(!strcmp_wa(bstrName, "testProp")) { + if(!lstrcmpW(bstrName, L"testProp")) { CHECK_EXPECT(script_testprop_d); ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); *pid = DISPID_SCRIPT_TESTPROP; return S_OK; } - if(!strcmp_wa(bstrName, "testProp2")) { + if(!lstrcmpW(bstrName, L"testProp2")) { CHECK_EXPECT(script_testprop2_d); ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); *pid = DISPID_SCRIPT_TESTPROP2; return S_OK; } - if(!strcmp_wa(bstrName, "divid")) { + if(!lstrcmpW(bstrName, L"divid")) { CHECK_EXPECT(script_divid_d); ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); return E_FAIL; @@ -583,31 +576,31 @@ static IDispatchEx scriptDisp = { &scriptDispVtbl }; static HRESULT WINAPI externalDisp_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { - if(!strcmp_wa(bstrName, "ok")) { + if(!lstrcmpW(bstrName, L"ok")) { *pid = DISPID_EXTERNAL_OK; return S_OK; } - if(!strcmp_wa(bstrName, "trace")) { + if(!lstrcmpW(bstrName, L"trace")) { *pid = DISPID_EXTERNAL_TRACE; return S_OK; } - if(!strcmp_wa(bstrName, "reportSuccess")) { + if(!lstrcmpW(bstrName, L"reportSuccess")) { *pid = DISPID_EXTERNAL_REPORTSUCCESS; return S_OK; } - if(!strcmp_wa(bstrName, "todo_wine_ok")) { + if(!lstrcmpW(bstrName, L"todo_wine_ok")) { *pid = DISPID_EXTERNAL_TODO_WINE_OK; return S_OK; } - if(!strcmp_wa(bstrName, "broken")) { + if(!lstrcmpW(bstrName, L"broken")) { *pid = DISPID_EXTERNAL_BROKEN; return S_OK; } - if(!strcmp_wa(bstrName, "win_skip")) { + if(!lstrcmpW(bstrName, L"win_skip")) { *pid = DISPID_EXTERNAL_WIN_SKIP; return S_OK; } - if(!strcmp_wa(bstrName, "writeStream")) { + if(!lstrcmpW(bstrName, L"writeStream")) { *pid = DISPID_EXTERNAL_WRITESTREAM; return S_OK; } @@ -1981,7 +1974,7 @@ static void test_func(IDispatchEx *obj) VARIANT args[2]; ok(V_VT(&var) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&var)); - ok(!strcmp_wa(V_BSTR(&var), "[object]"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var))); + ok(!lstrcmpW(V_BSTR(&var), L"[object]"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var))); VariantClear(&var); dp.rgdispidNamedArgs = named_args; @@ -1995,7 +1988,7 @@ static void test_func(IDispatchEx *obj) hres = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dp, &var, &ei, NULL); ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); ok(V_VT(&var) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&var)); - ok(!strcmp_wa(V_BSTR(&var), "[object]"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var))); + ok(!lstrcmpW(V_BSTR(&var), L"[object]"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var))); VariantClear(&var); } @@ -2014,7 +2007,7 @@ static void test_func(IDispatchEx *obj) hres = dispex_propget(dispex, DISPID_VALUE, &var, &caller_sp); ok(hres == S_OK, "InvokeEx returned: %08x, expected S_OK\n", hres); ok(V_VT(&var) == VT_BSTR, "V_VT(var) = %d\n", V_VT(&var)); - ok(!strcmp_wa(V_BSTR(&var), "\nfunction toString() {\n [native code]\n}\n"), + ok(!lstrcmpW(V_BSTR(&var), L"\nfunction toString() {\n [native code]\n}\n"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var))); VariantClear(&var); todo_wine CHECK_CALLED(QS_IActiveScriptSite); @@ -2049,9 +2042,9 @@ static void test_nextdispid(IDispatchEx *dispex) ok(hres == S_OK, "GetMemberName failed: %08x\n", hres); if(id == dyn_id) - ok(!strcmp_wa(name, "dynVal"), "name = %s\n", wine_dbgstr_w(name)); + ok(!lstrcmpW(name, L"dynVal"), "name = %s\n", wine_dbgstr_w(name)); else if(id == DISPID_IOMNAVIGATOR_PLATFORM) - ok(!strcmp_wa(name, "platform"), "name = %s\n", wine_dbgstr_w(name)); + ok(!lstrcmpW(name, L"platform"), "name = %s\n", wine_dbgstr_w(name)); SysFreeString(name); last_id = id; @@ -2465,19 +2458,19 @@ static HRESULT WINAPI ActiveScriptParse_ParseScriptText(IActiveScriptParse *ifac ok(pvarResult != NULL, "pvarResult == NULL\n"); ok(pexcepinfo != NULL, "pexcepinfo == NULL\n"); - if(!strcmp_wa(pstrCode, "execScript call")) { + if(!lstrcmpW(pstrCode, L"execScript call")) { CHECK_EXPECT(ParseScriptText_execScript); ok(!pstrItemName, "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName)); - ok(!strcmp_wa(pstrDelimiter, "\""), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter)); + ok(!lstrcmpW(pstrDelimiter, L"\""), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter)); ok(dwFlags == SCRIPTTEXT_ISVISIBLE, "dwFlags = %x\n", dwFlags); V_VT(pvarResult) = VT_I4; V_I4(pvarResult) = 10; return S_OK; - }else if(!strcmp_wa(pstrCode, "simple script")) { + }else if(!lstrcmpW(pstrCode, L"simple script")) { CHECK_EXPECT(ParseScriptText_script); - ok(!strcmp_wa(pstrItemName, "window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName)); - ok(!strcmp_wa(pstrDelimiter, "</SCRIPT>"), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter)); + ok(!lstrcmpW(pstrItemName, L"window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName)); + ok(!lstrcmpW(pstrDelimiter, L"</SCRIPT>"), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter)); ok(dwFlags == (SCRIPTTEXT_ISVISIBLE|SCRIPTTEXT_HOSTMANAGESSOURCE), "dwFlags = %x\n", dwFlags); test_script_run(); @@ -2682,7 +2675,7 @@ static HRESULT WINAPI ActiveScript_GetScriptDispatch(IActiveScript *iface, LPCOL { CHECK_EXPECT(GetScriptDispatch); - ok(!strcmp_wa(pstrItemName, "window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName)); + ok(!lstrcmpW(pstrItemName, L"window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName)); if(!script_disp) return E_NOTIMPL; @@ -3102,10 +3095,10 @@ static HRESULT WINAPI ProtocolEx_StartEx(IInternetProtocolEx *iface, IUri *uri, if(FAILED(hres)) return hres; - if(!strcmp_wa(path, "/index.html")) { + if(!lstrcmpW(path, L"/index.html")) { This->data = index_html_data; This->size = strlen(This->data); - }else if(!strcmp_wa(path, "/echo.php")) { + }else if(!lstrcmpW(path, L"/echo.php")) { ok(This->bind_info.dwBindVerb == BINDVERB_POST, "unexpected bind verb %d\n", This->bind_info.dwBindVerb == BINDVERB_POST); todo_wine ok(This->bind_info.stgmedData.tymed == TYMED_ISTREAM, "tymed = %x\n", This->bind_info.stgmedData.tymed); switch(This->bind_info.stgmedData.tymed) { @@ -3120,7 +3113,7 @@ static HRESULT WINAPI ProtocolEx_StartEx(IInternetProtocolEx *iface, IUri *uri, default: ok(0, "unexpected tymed %d\n", This->bind_info.stgmedData.tymed); } - }else if(!strcmp_wa(path, "/jsstream.php")) { + }else if(!lstrcmpW(path, L"/jsstream.php")) { BSTR query; hres = IUri_GetQuery(uri, &query);
1
0
0
0
Michael Stefaniuc : ieframe/tests: Get rid of a2bstr() in ie.c.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 5de16dcee595b1c3a8096f912c0be47c7b3c01b8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5de16dcee595b1c3a8096f91…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Sun Feb 9 16:51:44 2020 +0200 ieframe/tests: Get rid of a2bstr() in ie.c. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ieframe/tests/ie.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/dlls/ieframe/tests/ie.c b/dlls/ieframe/tests/ie.c index 4d51f70329..b2c39e7baa 100644 --- a/dlls/ieframe/tests/ie.c +++ b/dlls/ieframe/tests/ie.c @@ -59,18 +59,6 @@ DEFINE_EXPECT(Invoke_NAVIGATECOMPLETE2); static BOOL navigate_complete; -static BSTR a2bstr(const char *str) -{ - BSTR ret; - int len; - - len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); - ret = SysAllocStringLen(NULL, len); - MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); - - return ret; -} - static HRESULT WINAPI Dispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv) { if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IDispatch, riid)) { @@ -223,7 +211,7 @@ static void test_window(IWebBrowser2 *wb) ok(!strcmp(buf, "IEFrame"), "Unexpected class name %s\n", buf); } -static void test_navigate(IWebBrowser2 *wb, const char *url) +static void test_navigate(IWebBrowser2 *wb, const WCHAR *url) { VARIANT urlv, emptyv; MSG msg; @@ -232,7 +220,7 @@ static void test_navigate(IWebBrowser2 *wb, const char *url) SET_EXPECT(Invoke_NAVIGATECOMPLETE2); V_VT(&urlv) = VT_BSTR; - V_BSTR(&urlv) = a2bstr(url); + V_BSTR(&urlv) = SysAllocString(url); V_VT(&emptyv) = VT_EMPTY; hres = IWebBrowser2_Navigate2(wb, &urlv, &emptyv, &emptyv, &emptyv, &emptyv); ok(hres == S_OK, "Navigate2 failed: %08x\n", hres); @@ -284,7 +272,7 @@ static void test_InternetExplorer(void) test_visible(wb); test_html_window(wb); test_window(wb); - test_navigate(wb, "
http://test.winehq.org/tests/hello.html
"); + test_navigate(wb, L"
http://test.winehq.org/tests/hello.html
"); advise_cp(unk, FALSE);
1
0
0
0
Zebediah Figura : d3dcompiler: Dump loops.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 1aa2beab734684998abc0d2a6f4dc5489dd50af4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1aa2beab734684998abc0d2a…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Feb 5 14:52:36 2020 -0600 d3dcompiler: Dump loops. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/utils.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 9eaa65e80f..0cae62b60f 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1767,6 +1767,7 @@ static const char *debug_node_type(enum hlsl_ir_node_type type) "HLSL_IR_DEREF", "HLSL_IR_EXPR", "HLSL_IR_IF", + "HLSL_IR_LOOP", "HLSL_IR_JUMP", "HLSL_IR_SWIZZLE", }; @@ -2056,6 +2057,13 @@ static void debug_dump_ir_if(const struct hlsl_ir_if *if_node) } } +static void debug_dump_ir_loop(const struct hlsl_ir_loop *loop) +{ + wine_dbg_printf("for (;;)\n{\n"); + debug_dump_instr_list(loop->body); + wine_dbg_printf("}\n"); +} + static void debug_dump_instr(const struct hlsl_ir_node *instr) { wine_dbg_printf("%p: ", instr); @@ -2085,6 +2093,9 @@ static void debug_dump_instr(const struct hlsl_ir_node *instr) case HLSL_IR_IF: debug_dump_ir_if(if_from_node(instr)); break; + case HLSL_IR_LOOP: + debug_dump_ir_loop(loop_from_node(instr)); + break; default: wine_dbg_printf("<No dump function for %s>", debug_node_type(instr->type)); }
1
0
0
0
Zebediah Figura : d3dcompiler: Use wine_dbg_printf() to dump HLSL IR.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 05182695f2badcf465db105820ce0de4f339562d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=05182695f2badcf465db1058…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Feb 5 14:52:35 2020 -0600 d3dcompiler: Use wine_dbg_printf() to dump HLSL IR. So that we don't print function names. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/utils.c | 92 ++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index c615b37e25..9eaa65e80f 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1785,22 +1785,22 @@ static void debug_dump_instr_list(const struct list *list) LIST_FOR_EACH_ENTRY(instr, list, struct hlsl_ir_node, entry) { debug_dump_instr(instr); - TRACE("\n"); + wine_dbg_printf("\n"); } } static void debug_dump_src(const struct hlsl_ir_node *node) { - TRACE("%p", node); + wine_dbg_printf("%p", node); } static void debug_dump_ir_var(const struct hlsl_ir_var *var) { if (var->modifiers) - TRACE("%s ", debug_modifiers(var->modifiers)); - TRACE("%s %s", debug_hlsl_type(var->data_type), var->name); + wine_dbg_printf("%s ", debug_modifiers(var->modifiers)); + wine_dbg_printf("%s %s", debug_hlsl_type(var->data_type), var->name); if (var->semantic) - TRACE(" : %s", debugstr_a(var->semantic)); + wine_dbg_printf(" : %s", debugstr_a(var->semantic)); } static void debug_dump_ir_deref(const struct hlsl_ir_deref *deref) @@ -1808,19 +1808,19 @@ static void debug_dump_ir_deref(const struct hlsl_ir_deref *deref) switch (deref->type) { case HLSL_IR_DEREF_VAR: - TRACE("deref("); + wine_dbg_printf("deref("); debug_dump_ir_var(deref->v.var); - TRACE(")"); + wine_dbg_printf(")"); break; case HLSL_IR_DEREF_ARRAY: debug_dump_src(deref->v.array.array); - TRACE("["); + wine_dbg_printf("["); debug_dump_src(deref->v.array.index); - TRACE("]"); + wine_dbg_printf("]"); break; case HLSL_IR_DEREF_RECORD: debug_dump_src(deref->v.record.record); - TRACE(".%s", debugstr_a(deref->v.record.field->name)); + wine_dbg_printf(".%s", debugstr_a(deref->v.record.field->name)); break; } } @@ -1831,39 +1831,39 @@ static void debug_dump_ir_constant(const struct hlsl_ir_constant *constant) unsigned int x, y; if (type->dimy != 1) - TRACE("{"); + wine_dbg_printf("{"); for (y = 0; y < type->dimy; ++y) { if (type->dimx != 1) - TRACE("{"); + wine_dbg_printf("{"); for (x = 0; x < type->dimx; ++x) { switch (type->base_type) { case HLSL_TYPE_FLOAT: - TRACE("%g ", (double)constant->v.value.f[y * type->dimx + x]); + wine_dbg_printf("%g ", (double)constant->v.value.f[y * type->dimx + x]); break; case HLSL_TYPE_DOUBLE: - TRACE("%g ", constant->v.value.d[y * type->dimx + x]); + wine_dbg_printf("%g ", constant->v.value.d[y * type->dimx + x]); break; case HLSL_TYPE_INT: - TRACE("%d ", constant->v.value.i[y * type->dimx + x]); + wine_dbg_printf("%d ", constant->v.value.i[y * type->dimx + x]); break; case HLSL_TYPE_UINT: - TRACE("%u ", constant->v.value.u[y * type->dimx + x]); + wine_dbg_printf("%u ", constant->v.value.u[y * type->dimx + x]); break; case HLSL_TYPE_BOOL: - TRACE("%s ", constant->v.value.b[y * type->dimx + x] == FALSE ? "false" : "true"); + wine_dbg_printf("%s ", constant->v.value.b[y * type->dimx + x] == FALSE ? "false" : "true"); break; default: - TRACE("Constants of type %s not supported\n", debug_base_type(type)); + wine_dbg_printf("Constants of type %s not supported\n", debug_base_type(type)); } } if (type->dimx != 1) - TRACE("}"); + wine_dbg_printf("}"); } if (type->dimy != 1) - TRACE("}"); + wine_dbg_printf("}"); } static const char *debug_expr_op(const struct hlsl_ir_expr *expr) @@ -1947,26 +1947,26 @@ static void debug_dump_ir_expr(const struct hlsl_ir_expr *expr) { unsigned int i; - TRACE("%s (", debug_expr_op(expr)); + wine_dbg_printf("%s (", debug_expr_op(expr)); for (i = 0; i < 3 && expr->operands[i]; ++i) { debug_dump_src(expr->operands[i]); - TRACE(" "); + wine_dbg_printf(" "); } - TRACE(")"); + wine_dbg_printf(")"); } static void debug_dump_ir_constructor(const struct hlsl_ir_constructor *constructor) { unsigned int i; - TRACE("%s (", debug_hlsl_type(constructor->node.data_type)); + wine_dbg_printf("%s (", debug_hlsl_type(constructor->node.data_type)); for (i = 0; i < constructor->args_count; ++i) { debug_dump_src(constructor->args[i]); - TRACE(" "); + wine_dbg_printf(" "); } - TRACE(")"); + wine_dbg_printf(")"); } static const char *debug_writemask(DWORD writemask) @@ -1990,13 +1990,13 @@ static const char *debug_writemask(DWORD writemask) static void debug_dump_ir_assignment(const struct hlsl_ir_assignment *assign) { - TRACE("= ("); + wine_dbg_printf("= ("); debug_dump_src(assign->lhs); if (assign->writemask != BWRITERSP_WRITEMASK_ALL) - TRACE("%s", debug_writemask(assign->writemask)); - TRACE(" "); + wine_dbg_printf("%s", debug_writemask(assign->writemask)); + wine_dbg_printf(" "); debug_dump_src(assign->rhs); - TRACE(")"); + wine_dbg_printf(")"); } static void debug_dump_ir_swizzle(const struct hlsl_ir_swizzle *swizzle) @@ -2004,18 +2004,18 @@ static void debug_dump_ir_swizzle(const struct hlsl_ir_swizzle *swizzle) unsigned int i; debug_dump_src(swizzle->val); - TRACE("."); + wine_dbg_printf("."); if (swizzle->val->data_type->dimy > 1) { for (i = 0; i < swizzle->node.data_type->dimx; ++i) - TRACE("_m%u%u", (swizzle->swizzle >> i * 8) & 0xf, (swizzle->swizzle >> (i * 8 + 4)) & 0xf); + wine_dbg_printf("_m%u%u", (swizzle->swizzle >> i * 8) & 0xf, (swizzle->swizzle >> (i * 8 + 4)) & 0xf); } else { static const char c[] = {'x', 'y', 'z', 'w'}; for (i = 0; i < swizzle->node.data_type->dimx; ++i) - TRACE("%c", c[(swizzle->swizzle >> i * 2) & 0x3]); + wine_dbg_printf("%c", c[(swizzle->swizzle >> i * 2) & 0x3]); } } @@ -2024,41 +2024,41 @@ static void debug_dump_ir_jump(const struct hlsl_ir_jump *jump) switch (jump->type) { case HLSL_IR_JUMP_BREAK: - TRACE("break"); + wine_dbg_printf("break"); break; case HLSL_IR_JUMP_CONTINUE: - TRACE("continue"); + wine_dbg_printf("continue"); break; case HLSL_IR_JUMP_DISCARD: - TRACE("discard"); + wine_dbg_printf("discard"); break; case HLSL_IR_JUMP_RETURN: - TRACE("return "); + wine_dbg_printf("return "); if (jump->return_value) debug_dump_src(jump->return_value); - TRACE(";"); + wine_dbg_printf(";"); break; } } static void debug_dump_ir_if(const struct hlsl_ir_if *if_node) { - TRACE("if ("); + wine_dbg_printf("if ("); debug_dump_src(if_node->condition); - TRACE(")\n{\n"); + wine_dbg_printf(")\n{\n"); debug_dump_instr_list(if_node->then_instrs); - TRACE("}\n"); + wine_dbg_printf("}\n"); if (if_node->else_instrs) { - TRACE("else\n{\n"); + wine_dbg_printf("else\n{\n"); debug_dump_instr_list(if_node->else_instrs); - TRACE("}\n"); + wine_dbg_printf("}\n"); } } static void debug_dump_instr(const struct hlsl_ir_node *instr) { - TRACE("%p: ", instr); + wine_dbg_printf("%p: ", instr); switch (instr->type) { case HLSL_IR_EXPR: @@ -2086,7 +2086,7 @@ static void debug_dump_instr(const struct hlsl_ir_node *instr) debug_dump_ir_if(if_from_node(instr)); break; default: - TRACE("<No dump function for %s>", debug_node_type(instr->type)); + wine_dbg_printf("<No dump function for %s>", debug_node_type(instr->type)); } } @@ -2099,7 +2099,7 @@ void debug_dump_ir_function_decl(const struct hlsl_ir_function_decl *func) LIST_FOR_EACH_ENTRY(param, func->parameters, struct hlsl_ir_var, param_entry) { debug_dump_ir_var(param); - TRACE("\n"); + wine_dbg_printf("\n"); } if (func->semantic) TRACE("Function semantic: %s\n", debugstr_a(func->semantic));
1
0
0
0
Zebediah Figura : d3dcompiler: Dump flattened IR more accurately.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: e6f89bcb04344e585fd0176ae3b4e1e9c991784d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e6f89bcb04344e585fd0176a…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Feb 5 14:52:34 2020 -0600 d3dcompiler: Dump flattened IR more accurately. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/utils.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index b2b1e25bbd..c615b37e25 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1789,6 +1789,11 @@ static void debug_dump_instr_list(const struct list *list) } } +static void debug_dump_src(const struct hlsl_ir_node *node) +{ + TRACE("%p", node); +} + static void debug_dump_ir_var(const struct hlsl_ir_var *var) { if (var->modifiers) @@ -1808,13 +1813,13 @@ static void debug_dump_ir_deref(const struct hlsl_ir_deref *deref) TRACE(")"); break; case HLSL_IR_DEREF_ARRAY: - debug_dump_instr(deref->v.array.array); + debug_dump_src(deref->v.array.array); TRACE("["); - debug_dump_instr(deref->v.array.index); + debug_dump_src(deref->v.array.index); TRACE("]"); break; case HLSL_IR_DEREF_RECORD: - debug_dump_instr(deref->v.record.record); + debug_dump_src(deref->v.record.record); TRACE(".%s", debugstr_a(deref->v.record.field->name)); break; } @@ -1945,7 +1950,7 @@ static void debug_dump_ir_expr(const struct hlsl_ir_expr *expr) TRACE("%s (", debug_expr_op(expr)); for (i = 0; i < 3 && expr->operands[i]; ++i) { - debug_dump_instr(expr->operands[i]); + debug_dump_src(expr->operands[i]); TRACE(" "); } TRACE(")"); @@ -1958,7 +1963,7 @@ static void debug_dump_ir_constructor(const struct hlsl_ir_constructor *construc TRACE("%s (", debug_hlsl_type(constructor->node.data_type)); for (i = 0; i < constructor->args_count; ++i) { - debug_dump_instr(constructor->args[i]); + debug_dump_src(constructor->args[i]); TRACE(" "); } TRACE(")"); @@ -1986,11 +1991,11 @@ static const char *debug_writemask(DWORD writemask) static void debug_dump_ir_assignment(const struct hlsl_ir_assignment *assign) { TRACE("= ("); - debug_dump_instr(assign->lhs); + debug_dump_src(assign->lhs); if (assign->writemask != BWRITERSP_WRITEMASK_ALL) TRACE("%s", debug_writemask(assign->writemask)); TRACE(" "); - debug_dump_instr(assign->rhs); + debug_dump_src(assign->rhs); TRACE(")"); } @@ -1998,7 +2003,7 @@ static void debug_dump_ir_swizzle(const struct hlsl_ir_swizzle *swizzle) { unsigned int i; - debug_dump_instr(swizzle->val); + debug_dump_src(swizzle->val); TRACE("."); if (swizzle->val->data_type->dimy > 1) { @@ -2030,7 +2035,7 @@ static void debug_dump_ir_jump(const struct hlsl_ir_jump *jump) case HLSL_IR_JUMP_RETURN: TRACE("return "); if (jump->return_value) - debug_dump_instr(jump->return_value); + debug_dump_src(jump->return_value); TRACE(";"); break; } @@ -2039,7 +2044,7 @@ static void debug_dump_ir_jump(const struct hlsl_ir_jump *jump) static void debug_dump_ir_if(const struct hlsl_ir_if *if_node) { TRACE("if ("); - debug_dump_instr(if_node->condition); + debug_dump_src(if_node->condition); TRACE(")\n{\n"); debug_dump_instr_list(if_node->then_instrs); TRACE("}\n"); @@ -2053,6 +2058,7 @@ static void debug_dump_ir_if(const struct hlsl_ir_if *if_node) static void debug_dump_instr(const struct hlsl_ir_node *instr) { + TRACE("%p: ", instr); switch (instr->type) { case HLSL_IR_EXPR:
1
0
0
0
Zebediah Figura : d3dcompiler: Store the swizzle unshifted.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: a43974a6d41a98c09fc651b8bc41dad76c724aae URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a43974a6d41a98c09fc651b8…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Feb 5 14:52:32 2020 -0600 d3dcompiler: Store the swizzle unshifted. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/asmshader.y | 4 ++-- dlls/d3dcompiler_43/bytecodewriter.c | 6 +---- dlls/d3dcompiler_43/d3dcompiler_private.h | 38 +++++++++++++++---------------- dlls/d3dcompiler_43/utils.c | 8 +++---- 4 files changed, 26 insertions(+), 30 deletions(-) diff --git a/dlls/d3dcompiler_43/asmshader.y b/dlls/d3dcompiler_43/asmshader.y index 32b37d0885..1b7a07313f 100644 --- a/dlls/d3dcompiler_43/asmshader.y +++ b/dlls/d3dcompiler_43/asmshader.y @@ -1148,11 +1148,11 @@ swizzle: /* empty */ else { DWORD last, i; - $$ = $2.swizzle << BWRITERVS_SWIZZLE_SHIFT; + $$ = $2.swizzle; /* Fill the swizzle by extending the last component */ last = ($2.swizzle >> 2 * ($2.idx - 1)) & 0x03; for(i = $2.idx; i < 4; i++){ - $$ |= last << (BWRITERVS_SWIZZLE_SHIFT + 2 * i); + $$ |= last << (2 * i); } TRACE("Got a swizzle: %08x\n", $$); } diff --git a/dlls/d3dcompiler_43/bytecodewriter.c b/dlls/d3dcompiler_43/bytecodewriter.c index 14162ab212..42013dfba3 100644 --- a/dlls/d3dcompiler_43/bytecodewriter.c +++ b/dlls/d3dcompiler_43/bytecodewriter.c @@ -342,8 +342,6 @@ static void put_dword(struct bytecode_buffer *buffer, DWORD value) { /* bwriter -> d3d9 conversion functions. */ static DWORD d3d9_swizzle(DWORD bwriter_swizzle) { - /* Currently a NOP, but this allows changing the internal definitions - * without side effects. */ DWORD ret = 0; if ((bwriter_swizzle & BWRITERVS_X_X) == BWRITERVS_X_X) ret |= D3DVS_X_X; @@ -1270,9 +1268,7 @@ static void instr_ps_1_0123_texld(struct bc_writer *This, This->funcs->dstreg(This, &instr->dst, buffer, instr->shift, instr->dstmod); } else if(instr->src[0].type == BWRITERSPR_TEMP) { - swizzlemask = (3 << BWRITERVS_SWIZZLE_SHIFT) | - (3 << (BWRITERVS_SWIZZLE_SHIFT + 2)) | - (3 << (BWRITERVS_SWIZZLE_SHIFT + 4)); + swizzlemask = 3 | (3 << 2) | (3 << 4); if((instr->src[0].u.swizzle & swizzlemask) == (BWRITERVS_X_X | BWRITERVS_Y_Y | BWRITERVS_Z_Z)) { TRACE("writing texreg2rgb\n"); This->funcs->opcode(This, instr, D3DSIO_TEXREG2RGB & D3DSI_OPCODE_MASK, buffer); diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 45dbff7225..5fc3161f5f 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -542,25 +542,25 @@ enum bwritershader_param_srcmod_type #define BWRITERVS_SWIZZLE_SHIFT 16 #define BWRITERVS_SWIZZLE_MASK (0xFF << BWRITERVS_SWIZZLE_SHIFT) -#define BWRITERVS_X_X (0 << BWRITERVS_SWIZZLE_SHIFT) -#define BWRITERVS_X_Y (1 << BWRITERVS_SWIZZLE_SHIFT) -#define BWRITERVS_X_Z (2 << BWRITERVS_SWIZZLE_SHIFT) -#define BWRITERVS_X_W (3 << BWRITERVS_SWIZZLE_SHIFT) - -#define BWRITERVS_Y_X (0 << (BWRITERVS_SWIZZLE_SHIFT + 2)) -#define BWRITERVS_Y_Y (1 << (BWRITERVS_SWIZZLE_SHIFT + 2)) -#define BWRITERVS_Y_Z (2 << (BWRITERVS_SWIZZLE_SHIFT + 2)) -#define BWRITERVS_Y_W (3 << (BWRITERVS_SWIZZLE_SHIFT + 2)) - -#define BWRITERVS_Z_X (0 << (BWRITERVS_SWIZZLE_SHIFT + 4)) -#define BWRITERVS_Z_Y (1 << (BWRITERVS_SWIZZLE_SHIFT + 4)) -#define BWRITERVS_Z_Z (2 << (BWRITERVS_SWIZZLE_SHIFT + 4)) -#define BWRITERVS_Z_W (3 << (BWRITERVS_SWIZZLE_SHIFT + 4)) - -#define BWRITERVS_W_X (0 << (BWRITERVS_SWIZZLE_SHIFT + 6)) -#define BWRITERVS_W_Y (1 << (BWRITERVS_SWIZZLE_SHIFT + 6)) -#define BWRITERVS_W_Z (2 << (BWRITERVS_SWIZZLE_SHIFT + 6)) -#define BWRITERVS_W_W (3 << (BWRITERVS_SWIZZLE_SHIFT + 6)) +#define BWRITERVS_X_X (0) +#define BWRITERVS_X_Y (1) +#define BWRITERVS_X_Z (2) +#define BWRITERVS_X_W (3) + +#define BWRITERVS_Y_X (0 << 2) +#define BWRITERVS_Y_Y (1 << 2) +#define BWRITERVS_Y_Z (2 << 2) +#define BWRITERVS_Y_W (3 << 2) + +#define BWRITERVS_Z_X (0 << 4) +#define BWRITERVS_Z_Y (1 << 4) +#define BWRITERVS_Z_Z (2 << 4) +#define BWRITERVS_Z_W (3 << 4) + +#define BWRITERVS_W_X (0 << 6) +#define BWRITERVS_W_Y (1 << 6) +#define BWRITERVS_W_Z (2 << 6) +#define BWRITERVS_W_W (3 << 6) #define BWRITERVS_NOSWIZZLE (BWRITERVS_X_X | BWRITERVS_Y_Y | BWRITERVS_Z_Z | BWRITERVS_W_W) diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 1436ed6bf3..b2b1e25bbd 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -291,10 +291,10 @@ static const char *debug_print_swizzle(DWORD arg) return ".w"; } - swizzle[0] = (arg >> (BWRITERVS_SWIZZLE_SHIFT + 0)) & 0x03; - swizzle[1] = (arg >> (BWRITERVS_SWIZZLE_SHIFT + 2)) & 0x03; - swizzle[2] = (arg >> (BWRITERVS_SWIZZLE_SHIFT + 4)) & 0x03; - swizzle[3] = (arg >> (BWRITERVS_SWIZZLE_SHIFT + 6)) & 0x03; + swizzle[0] = arg & 3; + swizzle[1] = (arg >> 2) & 3; + swizzle[2] = (arg >> 4) & 3; + swizzle[3] = (arg >> 6) & 3; ret[0] = '.'; for (i = 0; i < 4; ++i)
1
0
0
0
Christian Costa : d3dx9: Support D3DFMT_X8L8V8U8 in DDS files.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 06918ba76bdc109e59fdc1d8ee00c46f6857bbd2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=06918ba76bdc109e59fdc1d8…
Author: Christian Costa <titan.costa(a)gmail.com> Date: Sun Feb 2 15:37:06 2020 -0600 d3dx9: Support D3DFMT_X8L8V8U8 in DDS files. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/surface.c | 14 ++++++++++++++ dlls/d3dx9_36/tests/surface.c | 2 ++ 2 files changed, 16 insertions(+) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 29325d5c0a..42e7bf16f1 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -111,6 +111,7 @@ static const GUID *d3dformat_to_wic_guid(D3DFORMAT format) #define DDS_PF_RGB 0x40 #define DDS_PF_YUV 0x200 #define DDS_PF_LUMINANCE 0x20000 +#define DDS_PF_BUMPLUMINANCE 0x40000 #define DDS_PF_BUMPDUDV 0x80000 struct dds_pixel_format @@ -360,6 +361,17 @@ static D3DFORMAT dds_bump_to_d3dformat(const struct dds_pixel_format *pixel_form return D3DFMT_UNKNOWN; } +static D3DFORMAT dds_bump_luminance_to_d3dformat(const struct dds_pixel_format *pixel_format) +{ + if (pixel_format->bpp == 32 && pixel_format->rmask == 0x000000ff && pixel_format->gmask == 0x0000ff00 + && pixel_format->bmask == 0x00ff0000) + return D3DFMT_X8L8V8U8; + + WARN("Unknown bump pixel format (%u, %#x, %#x, %#x, %#x).\n", pixel_format->bpp, + pixel_format->rmask, pixel_format->gmask, pixel_format->bmask, pixel_format->amask); + return D3DFMT_UNKNOWN; +} + static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pixel_format) { TRACE("pixel_format: size %u, flags %#x, fourcc %#x, bpp %u.\n", pixel_format->size, @@ -377,6 +389,8 @@ static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pi return dds_alpha_to_d3dformat(pixel_format); if (pixel_format->flags & DDS_PF_BUMPDUDV) return dds_bump_to_d3dformat(pixel_format); + if (pixel_format->flags & DDS_PF_BUMPLUMINANCE) + return dds_bump_luminance_to_d3dformat(pixel_format); WARN("Unknown pixel format (flags %#x, fourcc %#x, bpp %u, r %#x, g %#x, b %#x, a %#x)\n", pixel_format->flags, pixel_format->fourcc, pixel_format->bpp, diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 1a39d82961..d5d3d6d211 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -235,6 +235,7 @@ static HRESULT create_file(const char *filename, const unsigned char *data, cons #define DDS_PF_FOURCC 0x00000004 #define DDS_PF_RGB 0x00000040 #define DDS_PF_LUMINANCE 0x00020000 +#define DDS_PF_BUMPLUMINANCE 0x00040000 #define DDS_PF_BUMPDUDV 0x00080000 struct dds_pixel_format @@ -703,6 +704,7 @@ static void test_D3DXGetImageInfo(void) check_dds_pixel_format(DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 8, 0x0f, 0, 0, 0xf0, D3DFMT_A4L4); check_dds_pixel_format(DDS_PF_BUMPDUDV, 0, 16, 0x00ff, 0xff00, 0, 0, D3DFMT_V8U8); check_dds_pixel_format(DDS_PF_BUMPDUDV, 0, 32, 0x0000ffff, 0xffff0000, 0, 0, D3DFMT_V16U16); + check_dds_pixel_format(DDS_PF_BUMPLUMINANCE, 0, 32, 0x0000ff, 0x00ff00, 0xff0000, 0, D3DFMT_X8L8V8U8); test_dds_header_handling();
1
0
0
0
← Newer
1
...
52
53
54
55
56
57
58
...
88
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Results per page:
10
25
50
100
200