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
March
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
October 2012
----- 2025 -----
March 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
960 discussions
Start a n
N
ew thread
Józef Kucia : d3dx9/tests: Add a simple test for filling compressed textures.
by Alexandre Julliard
23 Oct '12
23 Oct '12
Module: wine Branch: master Commit: 0146b5568a1ae171ef2c499c09fd717a2fa76922 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0146b5568a1ae171ef2c499c0…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Mon Oct 22 17:20:30 2012 +0200 d3dx9/tests: Add a simple test for filling compressed textures. --- dlls/d3dx9_36/tests/texture.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/
…
[View More]
texture.c index ba3b2c7..87be95c 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -1135,6 +1135,20 @@ static void test_D3DXFillTexture(IDirect3DDevice9 *device) } else skip("Failed to create D3DFMT_A32B32G32R32F texture\n"); + + /* test a compressed texture */ + hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 1, 0, D3DFMT_DXT1, + D3DPOOL_MANAGED, &tex, NULL); + + if (SUCCEEDED(hr)) + { + hr = D3DXFillTexture(tex, fillfunc, NULL); + todo_wine ok(hr == D3D_OK, "D3DXFillTexture returned %#x, expected %#x\n", hr, D3D_OK); + + IDirect3DTexture9_Release(tex); + } + else + skip("Failed to create D3DFMT_DXT1 texture\n"); } static void WINAPI fillfunc_cube(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord,
[View Less]
1
0
0
0
Józef Kucia : d3dx9/tests: Add tests for filling floating-point textures.
by Alexandre Julliard
23 Oct '12
23 Oct '12
Module: wine Branch: master Commit: 15d642803bfb4dcb4cf64f840a7029257f29b362 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=15d642803bfb4dcb4cf64f840…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Mon Oct 22 17:20:29 2012 +0200 d3dx9/tests: Add tests for filling floating-point textures. --- dlls/d3dx9_36/tests/texture.c | 124 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 124 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx9_36/tests/texture.c b/
…
[View More]
dlls/d3dx9_36/tests/texture.c index 997b0c3..ba3b2c7 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -85,6 +85,43 @@ static const unsigned char dds_volume_map[] = { 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x84,0xef,0x7b,0xaa,0xab,0xab,0xab }; +#define ADMITTED_ERROR 0.0001f + +static inline float relative_error(float expected, float got) +{ + return expected == 0.0f ? fabs(expected - got) : fabs(1.0f - got / expected); +} + +#define expect_vec4(expected, got) expect_vec4_(__LINE__, expected, got) +static inline void expect_vec4_(unsigned int line, const D3DXVECTOR4 *expected, const D3DXVECTOR4 *got) +{ + ok_(__FILE__, line)(relative_error(expected->x, got->x) < ADMITTED_ERROR + && relative_error(expected->y, got->y) < ADMITTED_ERROR + && relative_error(expected->z, got->z) < ADMITTED_ERROR + && relative_error(expected->w, got->w) < ADMITTED_ERROR, + "Expected (%f, %f, %f, %f), got (%f, %f, %f, %f)\n", + expected->x, expected->y, expected->z, expected->w, + got->x, got->y, got->z, got->w); +} + +static inline float float_16_to_32(unsigned short in) +{ + unsigned short s = (in & 0x8000); + unsigned short e = (in & 0x7C00) >> 10; + unsigned short m = in & 0x3FF; + float sgn = (s ? -1.0f : 1.0f); + + if (e == 0) + { + if (m == 0) return sgn * 0.0f; /* +0.0 or -0.0 */ + else return sgn * powf(2, -14.0f) * (m / 1024.0f); + } + else + { + return sgn * powf(2, e - 15.0f) * (1.0f + (m / 1024.0f)); + } +} + static BOOL is_autogenmipmap_supported(IDirect3DDevice9 *device, D3DRESOURCETYPE resource_type) { HRESULT hr; @@ -1011,6 +1048,93 @@ static void test_D3DXFillTexture(IDirect3DDevice9 *device) } else skip("Failed to create texture\n"); + + /* test floating-point textures */ + hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 1, 0, D3DFMT_A16B16G16R16F, + D3DPOOL_MANAGED, &tex, NULL); + + if (SUCCEEDED(hr)) + { + hr = D3DXFillTexture(tex, fillfunc, NULL); + todo_wine ok(hr == D3D_OK, "D3DXFillTexture returned %#x, expected %#x\n", hr, D3D_OK); + + hr = IDirect3DTexture9_LockRect(tex, 0, &lock_rect, NULL, D3DLOCK_READONLY); + if (SUCCEEDED(hr)) + { + pitch = lock_rect.Pitch / sizeof(WORD); + for (y = 0; y < 4; y++) + { + WORD *ptr = (WORD *)lock_rect.pBits + y * pitch; + for (x = 0; x < 4; x++) + { + D3DXVECTOR4 got, expected; + + got.x = float_16_to_32(*ptr++); + got.y = float_16_to_32(*ptr++); + got.z = float_16_to_32(*ptr++); + got.w = float_16_to_32(*ptr++); + + expected.x = (x + 0.5f) / 4.0f; + expected.y = (y + 0.5f) / 4.0f; + expected.z = 1.0f / 4.0f; + expected.w = 1.0f; + + todo_wine expect_vec4(&expected, &got); + } + } + + IDirect3DTexture9_UnlockRect(tex, 0); + } + else + skip("Failed to lock texture\n"); + + IDirect3DTexture9_Release(tex); + } + else + skip("Failed to create D3DFMT_A16B16G16R16F texture\n"); + + hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 1, 0, D3DFMT_A32B32G32R32F, + D3DPOOL_MANAGED, &tex, NULL); + + if (SUCCEEDED(hr)) + { + hr = D3DXFillTexture(tex, fillfunc, NULL); + todo_wine ok(hr == D3D_OK, "D3DXFillTexture returned %#x, expected %#x\n", hr, D3D_OK); + + hr = IDirect3DTexture9_LockRect(tex, 0, &lock_rect, NULL, D3DLOCK_READONLY); + if (SUCCEEDED(hr)) + { + pitch = lock_rect.Pitch / sizeof(float); + for (y = 0; y < 4; y++) + { + float *ptr = (float *)lock_rect.pBits + y * pitch; + for (x = 0; x < 4; x++) + { + D3DXVECTOR4 got, expected; + + got.x = *ptr++; + got.y = *ptr++; + got.z = *ptr++; + got.w = *ptr++; + + expected.x = (x + 0.5f) / 4.0f; + expected.y = (y + 0.5f) / 4.0f; + expected.z = 1.0f / 4.0f; + expected.w = 1.0f; + + todo_wine expect_vec4(&expected, &got); + } + } + + IDirect3DTexture9_UnlockRect(tex, 0); + } + else + skip("Failed to lock texture\n"); + + IDirect3DTexture9_Release(tex); + } + else + skip("Failed to create D3DFMT_A32B32G32R32F texture\n"); } static void WINAPI fillfunc_cube(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord,
[View Less]
1
0
0
0
Józef Kucia : d3dx9: Do not try to fill textures other than ARGB in fill texture functions.
by Alexandre Julliard
23 Oct '12
23 Oct '12
Module: wine Branch: master Commit: 2c19f22c8a83cf0e1dfc8932b3e30047c4382898 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2c19f22c8a83cf0e1dfc8932b…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Mon Oct 22 17:20:28 2012 +0200 d3dx9: Do not try to fill textures other than ARGB in fill texture functions. --- dlls/d3dx9_36/texture.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index
…
[View More]
8aa5f97..050bb7a 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -1344,7 +1344,7 @@ HRESULT WINAPI D3DXFillTexture(LPDIRECT3DTEXTURE9 texture, return D3DERR_INVALIDCALL; format = get_format_info(desc.Format); - if (format->format == D3DFMT_UNKNOWN) + if (format->type != FORMAT_ARGB) { FIXME("Unsupported texture format %#x\n", desc.Format); return D3DERR_INVALIDCALL; @@ -1746,7 +1746,7 @@ HRESULT WINAPI D3DXFillCubeTexture(LPDIRECT3DCUBETEXTURE9 texture, return D3DERR_INVALIDCALL; format = get_format_info(desc.Format); - if (format->format == D3DFMT_UNKNOWN) + if (format->type != FORMAT_ARGB) { FIXME("Unsupported texture format %#x\n", desc.Format); return D3DERR_INVALIDCALL; @@ -1840,7 +1840,7 @@ HRESULT WINAPI D3DXFillVolumeTexture(LPDIRECT3DVOLUMETEXTURE9 texture, return D3DERR_INVALIDCALL; format = get_format_info(desc.Format); - if (format->format == D3DFMT_UNKNOWN) + if (format->type != FORMAT_ARGB) { FIXME("Unsupported texture format %#x\n", desc.Format); return D3DERR_INVALIDCALL;
[View Less]
1
0
0
0
Józef Kucia : d3dx9: Introduce a separate pixel format type for compressed pixel formats.
by Alexandre Julliard
23 Oct '12
23 Oct '12
Module: wine Branch: master Commit: 84935d4312d094b21247e1d2dd4fcba2cbb1a082 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=84935d4312d094b21247e1d2d…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Mon Oct 22 17:20:27 2012 +0200 d3dx9: Introduce a separate pixel format type for compressed pixel formats. --- dlls/d3dx9_36/d3dx9_36_private.h | 1 + dlls/d3dx9_36/surface.c | 29 ++++++++++------------------- dlls/d3dx9_36/util.c | 10 +++++--
…
[View More]
--- dlls/d3dx9_36/volume.c | 4 +--- 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h index bd208f8..a7efbee 100644 --- a/dlls/d3dx9_36/d3dx9_36_private.h +++ b/dlls/d3dx9_36/d3dx9_36_private.h @@ -47,6 +47,7 @@ struct volume /* for internal use */ enum format_type { FORMAT_ARGB, /* unsigned */ + FORMAT_DXT, FORMAT_UNKNOWN }; diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index daa6cfe..d49730d 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -307,7 +307,7 @@ static HRESULT calculate_dds_surface_size(D3DFORMAT format, UINT width, UINT hei UINT *pitch, UINT *size) { const struct pixel_format_desc *format_desc = get_format_info(format); - if (format_desc->format == D3DFMT_UNKNOWN) + if (format_desc->type == FORMAT_UNKNOWN) return E_NOTIMPL; if (format_desc->block_width != 1 || format_desc->block_height != 1) @@ -460,7 +460,11 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur if (FAILED(hr)) return hr; pixel_format = get_format_info(src_desc.Format); - if (pixel_format->type == FORMAT_UNKNOWN) return E_NOTIMPL; + if (pixel_format->type != FORMAT_ARGB) + { + FIXME("Unsupported pixel format %#x\n", src_desc.Format); + return E_NOTIMPL; + } file_size = calculate_dds_file_size(src_desc.Format, src_desc.Width, src_desc.Height, 1, 1, 1); @@ -1028,7 +1032,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface, formatdesc = get_format_info(imginfo.Format); - if (formatdesc->format == D3DFMT_UNKNOWN) + if (formatdesc->type == FORMAT_UNKNOWN) { FIXME("Unsupported pixel format\n"); hr = D3DXERR_INVALIDDATA; @@ -1676,15 +1680,13 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, } else /* Stretching or format conversion. */ { - if (srcformatdesc->bytes_per_pixel > 4 || destformatdesc->bytes_per_pixel > 4 - || srcformatdesc->block_height != 1 || srcformatdesc->block_width != 1 - || destformatdesc->block_height != 1 || destformatdesc->block_width != 1) + if (srcformatdesc->type != FORMAT_ARGB || destformatdesc->type != FORMAT_ARGB) { FIXME("Format conversion missing %#x -> %#x\n", src_format, surfdesc.Format); return E_NOTIMPL; } - if (FAILED(hr = IDirect3DSurface9_LockRect(dst_surface, &lockrect, dst_rect, 0))) + if (FAILED(IDirect3DSurface9_LockRect(dst_surface, &lockrect, dst_rect, 0))) return D3DXERR_INVALIDDATA; if ((filter & 0xf) == D3DX_FILTER_NONE) @@ -1952,7 +1954,7 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE src_format_desc = get_format_info(src_surface_desc.Format); dst_format_desc = get_format_info(d3d_pixel_format); - if (src_format_desc->format == D3DFMT_UNKNOWN || dst_format_desc->format == D3DFMT_UNKNOWN) + if (src_format_desc->type != FORMAT_ARGB || dst_format_desc->type != FORMAT_ARGB) { FIXME("Unsupported pixel format conversion %#x -> %#x\n", src_surface_desc.Format, d3d_pixel_format); @@ -1960,17 +1962,6 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE goto cleanup; } - if (src_format_desc->bytes_per_pixel > 4 - || dst_format_desc->bytes_per_pixel > 4 - || src_format_desc->block_height != 1 || src_format_desc->block_width != 1 - || dst_format_desc->block_height != 1 || dst_format_desc->block_width != 1) - { - FIXME("Format conversion missing %#x -> %#x\n", - src_surface_desc.Format, d3d_pixel_format); - hr = E_NOTIMPL; - goto cleanup; - } - size.width = width; size.height = height; size.depth = 1; diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c index 72008a2..40972d8 100644 --- a/dlls/d3dx9_36/util.c +++ b/dlls/d3dx9_36/util.c @@ -65,11 +65,11 @@ static const struct pixel_format_desc formats[] = {D3DFMT_A4L4, {4, 4, 0, 0}, { 4, 0, 0, 0}, 1, 1, 1, 1, FORMAT_ARGB, la_from_rgba, la_to_rgba}, {D3DFMT_L8, {0, 8, 0, 0}, { 0, 0, 0, 0}, 1, 1, 1, 1, FORMAT_ARGB, la_from_rgba, la_to_rgba}, {D3DFMT_L16, {0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, FORMAT_ARGB, la_from_rgba, la_to_rgba}, - {D3DFMT_DXT1, {0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 8, FORMAT_ARGB, NULL, NULL }, - {D3DFMT_DXT2, {0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_ARGB, NULL, NULL }, - {D3DFMT_DXT3, {0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_ARGB, NULL, NULL }, - {D3DFMT_DXT4, {0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_ARGB, NULL, NULL }, - {D3DFMT_DXT5, {0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_ARGB, NULL, NULL }, + {D3DFMT_DXT1, {0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 8, FORMAT_DXT, NULL, NULL }, + {D3DFMT_DXT2, {0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_DXT, NULL, NULL }, + {D3DFMT_DXT3, {0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_DXT, NULL, NULL }, + {D3DFMT_DXT4, {0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_DXT, NULL, NULL }, + {D3DFMT_DXT5, {0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_DXT, NULL, NULL }, /* marks last element */ {D3DFMT_UNKNOWN, {0, 0, 0, 0}, { 0, 0, 0, 0}, 0, 1, 1, 0, FORMAT_UNKNOWN, NULL, NULL }, }; diff --git a/dlls/d3dx9_36/volume.c b/dlls/d3dx9_36/volume.c index 2becba5..f773c7f 100644 --- a/dlls/d3dx9_36/volume.c +++ b/dlls/d3dx9_36/volume.c @@ -195,9 +195,7 @@ HRESULT WINAPI D3DXLoadVolumeFromMemory(IDirect3DVolume9 *dst_volume, { const BYTE *src_addr; - if (src_format_desc->bytes_per_pixel > 4 || dst_format_desc->bytes_per_pixel > 4 - || src_format_desc->block_height != 1 || src_format_desc->block_width != 1 - || dst_format_desc->block_height != 1 || dst_format_desc->block_width != 1) + if (src_format_desc->type != FORMAT_ARGB || dst_format_desc->type != FORMAT_ARGB) { FIXME("Pixel format conversion not implemented %#x -> %#x\n", src_format_desc->format, dst_format_desc->format);
[View Less]
1
0
0
0
Józef Kucia : d3dx9/tests: Only release a texture when it was created.
by Alexandre Julliard
23 Oct '12
23 Oct '12
Module: wine Branch: master Commit: cdc9f283fb77738af1e4c3efa47dcd5f3f974edd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cdc9f283fb77738af1e4c3efa…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Mon Oct 22 17:20:26 2012 +0200 d3dx9/tests: Only release a texture when it was created. --- dlls/d3dx9_36/tests/texture.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/
…
[View More]
texture.c index 3c2cd95..997b0c3 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -964,12 +964,12 @@ static void test_D3DXFillTexture(IDirect3DDevice9 *device) } size >>= 1; } + + IDirect3DTexture9_Release(tex); } else skip("Failed to create texture\n"); - IDirect3DTexture9_Release(tex); - hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 1, 0, D3DFMT_A1R5G5B5, D3DPOOL_MANAGED, &tex, NULL); @@ -1006,11 +1006,11 @@ static void test_D3DXFillTexture(IDirect3DDevice9 *device) } IDirect3DTexture9_UnlockRect(tex, 0); } + + IDirect3DTexture9_Release(tex); } else skip("Failed to create texture\n"); - - IDirect3DTexture9_Release(tex); } static void WINAPI fillfunc_cube(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord, @@ -1117,12 +1117,12 @@ static void test_D3DXFillCubeTexture(IDirect3DDevice9 *device) } size >>= 1; } + + IDirect3DCubeTexture9_Release(tex); } else skip("Failed to create texture\n"); - IDirect3DCubeTexture9_Release(tex); - hr = IDirect3DDevice9_CreateCubeTexture(device, 4, 1, 0, D3DFMT_A1R5G5B5, D3DPOOL_MANAGED, &tex, NULL); @@ -1162,11 +1162,11 @@ static void test_D3DXFillCubeTexture(IDirect3DDevice9 *device) IDirect3DCubeTexture9_UnlockRect(tex, f, 0); } } + + IDirect3DCubeTexture9_Release(tex); } else skip("Failed to create texture\n"); - - IDirect3DCubeTexture9_Release(tex); } static void WINAPI fillfunc_volume(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord, @@ -1232,12 +1232,12 @@ static void test_D3DXFillVolumeTexture(IDirect3DDevice9 *device) } size >>= 1; } + + IDirect3DVolumeTexture9_Release(tex); } else skip("Failed to create texture\n"); - IDirect3DVolumeTexture9_Release(tex); - hr = IDirect3DDevice9_CreateVolumeTexture(device, 4, 4, 4, 1, 0, D3DFMT_A1R5G5B5, D3DPOOL_MANAGED, &tex, NULL); @@ -1277,11 +1277,11 @@ static void test_D3DXFillVolumeTexture(IDirect3DDevice9 *device) } IDirect3DVolumeTexture9_UnlockBox(tex, 0); } + + IDirect3DVolumeTexture9_Release(tex); } else skip("Failed to create texture\n"); - - IDirect3DVolumeTexture9_Release(tex); } static void test_D3DXCreateTextureFromFileInMemory(IDirect3DDevice9 *device)
[View Less]
1
0
0
0
André Hentschel : winedbg: Buffer size includes the quotes (coverity).
by Alexandre Julliard
22 Oct '12
22 Oct '12
Module: wine Branch: master Commit: 8392a850844b30496ece3f06623099ee1171cf08 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8392a850844b30496ece3f066…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Mon Oct 22 19:42:49 2012 +0200 winedbg: Buffer size includes the quotes (coverity). --- programs/winedbg/tgt_active.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c index 6c60831..
…
[View More]
4620030 100644 --- a/programs/winedbg/tgt_active.c +++ b/programs/winedbg/tgt_active.c @@ -862,7 +862,7 @@ enum dbg_start dbg_active_minidump(int argc, char* argv[]) HANDLE hFile; enum dbg_start ds = start_error_parse; const char* file = NULL; - char tmp[8 + 1 + MAX_PATH]; /* minidump <file> */ + char tmp[8 + 1 + 2 + MAX_PATH]; /* minidump "<file>" */ dbg_houtput = GetStdHandle(STD_ERROR_HANDLE); DBG_IVAR(BreakOnDllLoad) = 0;
[View Less]
1
0
0
0
André Hentschel : view: Buffer size of GetFileTitleW is in characters, not bytes (coverity).
by Alexandre Julliard
22 Oct '12
22 Oct '12
Module: wine Branch: master Commit: 0ca586120b7197a784a09836ae450018142320cd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0ca586120b7197a784a09836a…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Mon Oct 22 19:31:36 2012 +0200 view: Buffer size of GetFileTitleW is in characters, not bytes (coverity). --- programs/view/view.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/view/view.c b/programs/view/view.c index d32a10b..9e60824
…
[View More]
100644 --- a/programs/view/view.c +++ b/programs/view/view.c @@ -260,7 +260,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM if (FileOpen(hwnd, filename, sizeof(filename)/sizeof(WCHAR))) { szFileTitle[0] = 0; - GetFileTitleW(filename, szFileTitle, sizeof(szFileTitle)); + GetFileTitleW(filename, szFileTitle, sizeof(szFileTitle)/sizeof(WCHAR)); DoOpenFile(filename); UpdateWindowCaption(); } @@ -387,7 +387,7 @@ static void HandleCommandLine(LPWSTR cmdline) cmdline[lstrlenW(cmdline) - 1] = 0; } szFileTitle[0] = 0; - GetFileTitleW(cmdline, szFileTitle, sizeof(szFileTitle)); + GetFileTitleW(cmdline, szFileTitle, sizeof(szFileTitle)/sizeof(WCHAR)); DoOpenFile(cmdline); UpdateWindowCaption(); }
[View Less]
1
0
0
0
Piotr Caban : msvcp60: Copy correct number of characters in basic_string:: _Grow.
by Alexandre Julliard
22 Oct '12
22 Oct '12
Module: wine Branch: master Commit: 9d6c003cd7bb059777b5c931c4843be68560218b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d6c003cd7bb059777b5c931c…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Oct 22 17:15:49 2012 +0200 msvcp60: Copy correct number of characters in basic_string::_Grow. --- dlls/msvcp60/string.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/msvcp60/string.c b/dlls/msvcp60/string.c index 591ffdf..
…
[View More]
ed4391c 100644 --- a/dlls/msvcp60/string.c +++ b/dlls/msvcp60/string.c @@ -203,13 +203,16 @@ MSVCP_bool __thiscall basic_string_char__Grow(basic_string_char *this, MSVCP_siz return FALSE; } + if(len > new_res) + len = new_res; + *ptr = 0; if(this->ptr) - char_traits_char__Copy_s(ptr+1, new_size, this->ptr, this->size); + char_traits_char__Copy_s(ptr+1, new_size, this->ptr, len); basic_string_char__Tidy(this, TRUE); this->ptr = ptr+1; this->res = new_res; - basic_string_char__Eos(this, len>new_res ? new_res : len); + basic_string_char__Eos(this, len); } return new_size>0; @@ -1911,13 +1914,16 @@ MSVCP_bool __thiscall basic_string_wchar__Grow(basic_string_wchar *this, MSVCP_s return FALSE; } + if(len > new_res) + len = new_res; + *ptr = 0; if(this->ptr) - char_traits_wchar__Copy_s(ptr+1, new_size, this->ptr, this->size); + char_traits_wchar__Copy_s(ptr+1, new_size, this->ptr, len); basic_string_wchar__Tidy(this, TRUE); this->ptr = ptr+1; this->res = new_res; - basic_string_wchar__Eos(this, len>new_res ? new_res : len); + basic_string_wchar__Eos(this, len); } return new_size>0;
[View Less]
1
0
0
0
Piotr Caban : services: Added tests for service thread termination without setting service state to stopped .
by Alexandre Julliard
22 Oct '12
22 Oct '12
Module: wine Branch: master Commit: afc4284d0520516ab565fdb70ae6abab23227d43 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=afc4284d0520516ab565fdb70…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Oct 22 15:00:47 2012 +0200 services: Added tests for service thread termination without setting service state to stopped. --- programs/services/tests/service.c | 219 +++++++++++++++++++++++++++++++----- 1 files changed, 188 insertions(+), 31 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=afc4284d0520516ab565f…
1
0
0
0
Piotr Caban : services: Kill service thread after timeout so it can terminate cleanly.
by Alexandre Julliard
22 Oct '12
22 Oct '12
Module: wine Branch: master Commit: 522bc15b455ffbd09bb2f594aaaa3e9b13903efe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=522bc15b455ffbd09bb2f594a…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Oct 22 14:26:10 2012 +0200 services: Kill service thread after timeout so it can terminate cleanly. --- programs/services/rpc.c | 118 ++++++++++++++++++++++++++++++++++++++++-- programs/services/services.c | 4 +- programs/services/services.h | 2 +- 3
…
[View More]
files changed, 116 insertions(+), 8 deletions(-) diff --git a/programs/services/rpc.c b/programs/services/rpc.c index bf8ce80..9fe81d1 100644 --- a/programs/services/rpc.c +++ b/programs/services/rpc.c @@ -84,6 +84,53 @@ struct sc_lock struct scmdatabase *db; }; +static HANDLE timeout_queue_event; +static CRITICAL_SECTION timeout_queue_cs; +static CRITICAL_SECTION_DEBUG timeout_queue_cs_debug = +{ + 0, 0, &timeout_queue_cs, + { &timeout_queue_cs_debug.ProcessLocksList, &timeout_queue_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": timeout_queue_cs") } +}; +static CRITICAL_SECTION timeout_queue_cs = { &timeout_queue_cs_debug, -1, 0, 0, 0, 0 }; +static struct list timeout_queue = LIST_INIT(timeout_queue); +struct timeout_queue_elem +{ + struct list entry; + + FILETIME time; + void (*func)(struct service_entry*); + struct service_entry *service_entry; +}; + +static void run_after_timeout(void (*func)(struct service_entry*), struct service_entry *service, DWORD timeout) +{ + struct timeout_queue_elem *elem = HeapAlloc(GetProcessHeap(), 0, sizeof(struct timeout_queue_elem)); + ULARGE_INTEGER time; + + if(!elem) { + func(service); + return; + } + + service->ref_count++; + elem->func = func; + elem->service_entry = service; + + GetSystemTimeAsFileTime(&elem->time); + time.LowPart = elem->time.dwLowDateTime; + time.HighPart = elem->time.dwHighDateTime; + time.QuadPart += timeout*10000000; + elem->time.dwLowDateTime = time.LowPart; + elem->time.dwHighDateTime = time.HighPart; + + EnterCriticalSection(&timeout_queue_cs); + list_add_head(&timeout_queue, &elem->entry); + LeaveCriticalSection(&timeout_queue_cs); + + SetEvent(timeout_queue_event); +} + static void free_service_strings(struct service_entry *old, struct service_entry *new) { QUERY_SERVICE_CONFIGW *old_cfg = &old->config; @@ -700,7 +747,7 @@ DWORD __cdecl svcctl_SetServiceStatus( service_unlock(service->service_entry); if (lpServiceStatus->dwCurrentState == SERVICE_STOPPED) - service_terminate(service->service_entry); + run_after_timeout(service_terminate, service->service_entry, service_kill_timeout); else if (service->service_entry->status_changed_event) SetEvent(service->service_entry->status_changed_event); @@ -1567,10 +1614,16 @@ DWORD RPC_Init(void) return ERROR_SUCCESS; } -DWORD RPC_MainLoop(void) +DWORD events_loop(void) { + struct timeout_queue_elem *iter, *iter_safe; DWORD err; - HANDLE hExitEvent = __wine_make_process_system(); + HANDLE wait_handles[2]; + DWORD timeout = INFINITE; + + wait_handles[0] = __wine_make_process_system(); + wait_handles[1] = CreateEventW(NULL, FALSE, FALSE, NULL); + timeout_queue_event = wait_handles[1]; SetEvent(g_hStartedEvent); @@ -1578,12 +1631,67 @@ DWORD RPC_MainLoop(void) do { - err = WaitForSingleObjectEx(hExitEvent, INFINITE, TRUE); + err = WaitForMultipleObjects(2, wait_handles, FALSE, timeout); WINE_TRACE("Wait returned %d\n", err); + + if(err==WAIT_OBJECT_0+1 || err==WAIT_TIMEOUT) + { + FILETIME cur_time; + ULARGE_INTEGER time; + + GetSystemTimeAsFileTime(&cur_time); + time.LowPart = cur_time.dwLowDateTime; + time.HighPart = cur_time.dwHighDateTime; + + EnterCriticalSection(&timeout_queue_cs); + timeout = INFINITE; + LIST_FOR_EACH_ENTRY_SAFE(iter, iter_safe, &timeout_queue, struct timeout_queue_elem, entry) + { + if(CompareFileTime(&cur_time, &iter->time) >= 0) + { + LeaveCriticalSection(&timeout_queue_cs); + iter->func(iter->service_entry); + EnterCriticalSection(&timeout_queue_cs); + + release_service(iter->service_entry); + list_remove(&iter->entry); + HeapFree(GetProcessHeap(), 0, iter); + } + else + { + ULARGE_INTEGER time_diff; + + time_diff.LowPart = iter->time.dwLowDateTime; + time_diff.HighPart = iter->time.dwHighDateTime; + time_diff.QuadPart = (time_diff.QuadPart-time.QuadPart)/10000; + + if(time_diff.QuadPart < timeout) + timeout = time_diff.QuadPart; + } + } + LeaveCriticalSection(&timeout_queue_cs); + + if(timeout != INFINITE) + timeout += 1000; + } } while (err != WAIT_OBJECT_0); WINE_TRACE("Object signaled - wine shutdown\n"); - CloseHandle(hExitEvent); + EnterCriticalSection(&timeout_queue_cs); + LIST_FOR_EACH_ENTRY_SAFE(iter, iter_safe, &timeout_queue, struct timeout_queue_elem, entry) + { + LeaveCriticalSection(&timeout_queue_cs); + iter->func(iter->service_entry); + EnterCriticalSection(&timeout_queue_cs); + + release_service(iter->service_entry); + list_remove(&iter->entry); + HeapFree(GetProcessHeap(), 0, iter); + } + LeaveCriticalSection(&timeout_queue_cs); + + CloseHandle(wait_handles[0]); + CloseHandle(wait_handles[1]); return ERROR_SUCCESS; } diff --git a/programs/services/services.c b/programs/services/services.c index d28e47e..75abf06 100644 --- a/programs/services/services.c +++ b/programs/services/services.c @@ -40,7 +40,7 @@ HANDLE g_hStartedEvent; struct scmdatabase *active_database; DWORD service_pipe_timeout = 10000; -DWORD service_kill_timeout = 20000; +DWORD service_kill_timeout = 60000; static DWORD default_preshutdown_timeout = 180000; static void *env = NULL; @@ -914,7 +914,7 @@ int main(int argc, char *argv[]) if ((err = RPC_Init()) == ERROR_SUCCESS) { scmdatabase_autostart_services(active_database); - RPC_MainLoop(); + events_loop(); scmdatabase_wait_terminate(active_database); } scmdatabase_destroy(active_database); diff --git a/programs/services/services.h b/programs/services/services.h index b4b895e..3e36141 100644 --- a/programs/services/services.h +++ b/programs/services/services.h @@ -88,7 +88,7 @@ extern DWORD service_pipe_timeout; extern DWORD service_kill_timeout; DWORD RPC_Init(void); -DWORD RPC_MainLoop(void); +DWORD events_loop(void); /* from utils.c */ LPWSTR strdupW(LPCWSTR str);
[View Less]
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
96
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
89
90
91
92
93
94
95
96
Results per page:
10
25
50
100
200