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
November 2010
----- 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
866 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Fix the indentation in buffer_direct_upload().
by Alexandre Julliard
23 Nov '10
23 Nov '10
Module: wine Branch: master Commit: a147fd9c36c49aaa08bb2b32778f7960ea6509a7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a147fd9c36c49aaa08bb2b327…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Nov 18 20:50:41 2010 +0100 wined3d: Fix the indentation in buffer_direct_upload(). --- dlls/wined3d/buffer.c | 110 +++++++++++++++++++++++++----------------------- 1 files changed, 57 insertions(+), 53 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 7400fd8..09c07fe 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -863,71 +863,75 @@ drop_query: /* The caller provides a GL context */ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info, DWORD flags) { - BYTE *map; - UINT start = 0, len = 0; + BYTE *map; + UINT start = 0, len = 0; - ENTER_GL(); - GL_EXTCALL(glBindBufferARB(This->buffer_type_hint, This->buffer_object)); - checkGLcall("glBindBufferARB"); - if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) + ENTER_GL(); + + /* This potentially invalidates the element array buffer binding, but the + * caller always takes care of this. */ + GL_EXTCALL(glBindBufferARB(This->buffer_type_hint, This->buffer_object)); + checkGLcall("glBindBufferARB"); + if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) + { + GLbitfield mapflags; + mapflags = GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT; + if (flags & WINED3D_BUFFER_DISCARD) { - GLbitfield mapflags; - mapflags = GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT; - if (flags & WINED3D_BUFFER_DISCARD) - { - mapflags |= GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT; - } - else if (flags & WINED3D_BUFFER_NOSYNC) - { - mapflags |= GL_MAP_UNSYNCHRONIZED_BIT; - } - map = GL_EXTCALL(glMapBufferRange(This->buffer_type_hint, 0, - This->resource.size, mapflags)); - checkGLcall("glMapBufferRange"); + mapflags |= GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT; } - else + else if (flags & WINED3D_BUFFER_NOSYNC) { - if (This->flags & WINED3D_BUFFER_APPLESYNC) - { - DWORD syncflags = 0; - if (flags & WINED3D_BUFFER_DISCARD) syncflags |= WINED3DLOCK_DISCARD; - if (flags & WINED3D_BUFFER_NOSYNC) syncflags |= WINED3DLOCK_NOOVERWRITE; - LEAVE_GL(); - buffer_sync_apple(This, syncflags, gl_info); - ENTER_GL(); - } - map = GL_EXTCALL(glMapBufferARB(This->buffer_type_hint, GL_WRITE_ONLY_ARB)); - checkGLcall("glMapBufferARB"); + mapflags |= GL_MAP_UNSYNCHRONIZED_BIT; } - if (!map) + map = GL_EXTCALL(glMapBufferRange(This->buffer_type_hint, 0, + This->resource.size, mapflags)); + checkGLcall("glMapBufferRange"); + } + else + { + if (This->flags & WINED3D_BUFFER_APPLESYNC) { + DWORD syncflags = 0; + if (flags & WINED3D_BUFFER_DISCARD) syncflags |= WINED3DLOCK_DISCARD; + if (flags & WINED3D_BUFFER_NOSYNC) syncflags |= WINED3DLOCK_NOOVERWRITE; LEAVE_GL(); - ERR("Failed to map opengl buffer\n"); - return; + buffer_sync_apple(This, syncflags, gl_info); + ENTER_GL(); } + map = GL_EXTCALL(glMapBufferARB(This->buffer_type_hint, GL_WRITE_ONLY_ARB)); + checkGLcall("glMapBufferARB"); + } + if (!map) + { + LEAVE_GL(); + ERR("Failed to map opengl buffer\n"); + return; + } - while(This->modified_areas) - { - This->modified_areas--; - start = This->maps[This->modified_areas].offset; - len = This->maps[This->modified_areas].size; + while (This->modified_areas) + { + This->modified_areas--; + start = This->maps[This->modified_areas].offset; + len = This->maps[This->modified_areas].size; - memcpy(map + start, This->resource.allocatedMemory + start, len); + memcpy(map + start, This->resource.allocatedMemory + start, len); - if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) - { - GL_EXTCALL(glFlushMappedBufferRange(This->buffer_type_hint, start, len)); - checkGLcall("glFlushMappedBufferRange"); - } - else if (This->flags & WINED3D_BUFFER_FLUSH) - { - GL_EXTCALL(glFlushMappedBufferRangeAPPLE(This->buffer_type_hint, start, len)); - checkGLcall("glFlushMappedBufferRangeAPPLE"); - } + if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) + { + GL_EXTCALL(glFlushMappedBufferRange(This->buffer_type_hint, start, len)); + checkGLcall("glFlushMappedBufferRange"); } - GL_EXTCALL(glUnmapBufferARB(This->buffer_type_hint)); - checkGLcall("glUnmapBufferARB"); - LEAVE_GL(); + else if (This->flags & WINED3D_BUFFER_FLUSH) + { + GL_EXTCALL(glFlushMappedBufferRangeAPPLE(This->buffer_type_hint, start, len)); + checkGLcall("glFlushMappedBufferRangeAPPLE"); + } + } + GL_EXTCALL(glUnmapBufferARB(This->buffer_type_hint)); + checkGLcall("glUnmapBufferARB"); + + LEAVE_GL(); } /* Do not call while under the GL lock. */
1
0
0
0
Henri Verbeet : wined3d: Get rid of the remaining "Flags".
by Alexandre Julliard
23 Nov '10
23 Nov '10
Module: wine Branch: master Commit: 03f7a2d88ea1cda4b4ca3ea1aa97a2a373e4cfd0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=03f7a2d88ea1cda4b4ca3ea1a…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Nov 18 20:50:40 2010 +0100 wined3d: Get rid of the remaining "Flags". --- dlls/wined3d/clipper.c | 12 ++-- dlls/wined3d/cubetexture.c | 8 ++- dlls/wined3d/device.c | 40 ++++++----- dlls/wined3d/directx.c | 9 ++- dlls/wined3d/palette.c | 21 ++++-- dlls/wined3d/query.c | 42 +++++++----- dlls/wined3d/resource.c | 16 +++-- dlls/wined3d/surface.c | 97 ++++++++++++++------------- dlls/wined3d/surface_base.c | 141 ++++++++++++++++++++++------------------ dlls/wined3d/surface_gdi.c | 9 +-- dlls/wined3d/swapchain.c | 5 +- dlls/wined3d/swapchain_base.c | 9 ++- dlls/wined3d/swapchain_gdi.c | 5 +- dlls/wined3d/texture.c | 8 ++- dlls/wined3d/volume.c | 15 ++-- dlls/wined3d/volumetexture.c | 8 ++- dlls/wined3d/wined3d_private.h | 16 ++-- 17 files changed, 255 insertions(+), 206 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=03f7a2d88ea1cda4b4ca3…
1
0
0
0
Henri Verbeet : wined3d: Textures never have a resource size.
by Alexandre Julliard
23 Nov '10
23 Nov '10
Module: wine Branch: master Commit: b459b917fb211d8e39f731b1e522b34da1a86d47 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b459b917fb211d8e39f731b1e…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Nov 18 20:50:39 2010 +0100 wined3d: Textures never have a resource size. They're just containers for their subresources. --- dlls/wined3d/basetexture.c | 4 ++-- dlls/wined3d/cubetexture.c | 2 +- dlls/wined3d/texture.c | 2 +- dlls/wined3d/volumetexture.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c index 5b1a85b..83f3797 100644 --- a/dlls/wined3d/basetexture.c +++ b/dlls/wined3d/basetexture.c @@ -28,14 +28,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture); HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UINT level_count, - WINED3DRESOURCETYPE resource_type, IWineD3DDeviceImpl *device, UINT size, DWORD usage, + WINED3DRESOURCETYPE resource_type, IWineD3DDeviceImpl *device, DWORD usage, const struct wined3d_format *format, WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops) { HRESULT hr; hr = resource_init((IWineD3DResource *)texture, resource_type, device, - size, usage, format, pool, parent, parent_ops); + 0, usage, format, pool, parent, parent_ops); if (FAILED(hr)) { WARN("Failed to initialize resource, returning %#x\n", hr); diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index 4881ac1..a31d59c 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -500,7 +500,7 @@ HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UIN texture->lpVtbl = &IWineD3DCubeTexture_Vtbl; hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, 6, levels, - WINED3DRTYPE_CUBETEXTURE, device, 0, usage, format, pool, parent, parent_ops); + WINED3DRTYPE_CUBETEXTURE, device, usage, format, pool, parent, parent_ops); if (FAILED(hr)) { WARN("Failed to initialize basetexture, returning %#x\n", hr); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index c5ec40f..1013647 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -532,7 +532,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT texture->lpVtbl = &IWineD3DTexture_Vtbl; hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, 1, levels, - WINED3DRTYPE_TEXTURE, device, 0, usage, format, pool, parent, parent_ops); + WINED3DRTYPE_TEXTURE, device, usage, format, pool, parent, parent_ops); if (FAILED(hr)) { WARN("Failed to initialize basetexture, returning %#x.\n", hr); diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c index bfe1fba..13a7db1 100644 --- a/dlls/wined3d/volumetexture.c +++ b/dlls/wined3d/volumetexture.c @@ -430,7 +430,7 @@ HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT texture->lpVtbl = &IWineD3DVolumeTexture_Vtbl; hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, 1, levels, - WINED3DRTYPE_VOLUMETEXTURE, device, 0, usage, format, pool, parent, parent_ops); + WINED3DRTYPE_VOLUMETEXTURE, device, usage, format, pool, parent, parent_ops); if (FAILED(hr)) { WARN("Failed to initialize basetexture, returning %#x.\n", hr); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 2278cb7..6614c31 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1936,7 +1936,7 @@ DWORD basetexture_get_lod(IWineD3DBaseTexture *iface) DECLSPEC_HIDDEN; IWineD3DResourceImpl *basetexture_get_sub_resource(IWineD3DBaseTextureImpl *texture, UINT sub_resource_idx) DECLSPEC_HIDDEN; HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UINT level_count, - WINED3DRESOURCETYPE resource_type, IWineD3DDeviceImpl *device, UINT size, DWORD usage, + WINED3DRESOURCETYPE resource_type, IWineD3DDeviceImpl *device, DWORD usage, const struct wined3d_format *format, WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface,
1
0
0
0
Henri Verbeet : d3d9/tests: Use GetRenderTargetData() for reading back pixels.
by Alexandre Julliard
23 Nov '10
23 Nov '10
Module: wine Branch: master Commit: 27b72fa84761fe738f693e1beb5bba50879afbea URL:
http://source.winehq.org/git/wine.git/?a=commit;h=27b72fa84761fe738f693e1be…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Nov 18 20:50:38 2010 +0100 d3d9/tests: Use GetRenderTargetData() for reading back pixels. This is the recommended way to read back render targets. It's also much faster on current wined3d, but that's mostly a side effect of imperfections in our resource location management. --- dlls/d3d9/tests/visual.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index f2eb4b4..d2c5df5 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -110,8 +110,9 @@ static DWORD getPixelColor(IDirect3DDevice9 *device, UINT x, UINT y) D3DLOCKED_RECT lockedRect; RECT rectToLock = {x, y, x+1, y+1}; - hr = IDirect3DDevice9_CreateRenderTarget(device, 640, 480, D3DFMT_A8R8G8B8, 0, 0, TRUE, &surf, NULL); - if(FAILED(hr) || !surf ) /* This is not a test */ + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 640, 480, + D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surf, NULL); + if (FAILED(hr) || !surf) { trace("Can't create an offscreen plain surface to read the render target data, hr=%08x\n", hr); return 0xdeadbeef; @@ -125,8 +126,8 @@ static DWORD getPixelColor(IDirect3DDevice9 *device, UINT x, UINT y) goto out; } - hr = IDirect3DDevice9_StretchRect(device, target, NULL, surf, NULL, D3DTEXF_POINT); - if(FAILED(hr)) + hr = IDirect3DDevice9_GetRenderTargetData(device, target, surf); + if (FAILED(hr)) { trace("Can't read the render target data, hr=%08x\n", hr); ret = 0xdeadbeec;
1
0
0
0
Matteo Bruni : d3dx9: Implement D3DXFillVolumeTexture function.
by Alexandre Julliard
18 Nov '10
18 Nov '10
Module: wine Branch: master Commit: 892502479c3acf64257e19ec4aac113024642f4d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=892502479c3acf64257e19ec4…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Nov 15 23:28:09 2010 +0100 d3dx9: Implement D3DXFillVolumeTexture function. --- dlls/d3dx9_36/d3dx9_36.spec | 2 +- dlls/d3dx9_36/tests/texture.c | 116 +++++++++++++++++++++++++++++++++++++++++ dlls/d3dx9_36/texture.c | 98 ++++++++++++++++++++++++++++++++++ 3 files changed, 215 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index 327c406..cbb6d20 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -126,7 +126,7 @@ @ stub D3DXFillCubeTextureTX @ stdcall D3DXFillTexture(ptr ptr ptr) @ stub D3DXFillTextureTX -@ stub D3DXFillVolumeTexture +@ stdcall D3DXFillVolumeTexture(ptr ptr ptr) @ stub D3DXFillVolumeTextureTX @ stdcall D3DXFilterTexture(ptr ptr long long) @ stdcall D3DXFindShaderComment(ptr long ptr ptr) diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 2d5cd72..44e7719 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -932,6 +932,121 @@ static void test_D3DXFillCubeTexture(IDirect3DDevice9 *device) IDirect3DCubeTexture9_Release(tex); } +static void WINAPI fillfunc_volume(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord, + const D3DXVECTOR3 *texelsize, void *data) +{ + value->x = texcoord->x; + value->y = texcoord->y; + value->z = texcoord->z; + value->w = texelsize->x; +} + +static void test_D3DXFillVolumeTexture(IDirect3DDevice9 *device) +{ + IDirect3DVolumeTexture9 *tex; + HRESULT hr; + D3DLOCKED_BOX lock_box; + DWORD x, y, z, m; + DWORD v[4], e[4]; + DWORD value, expected, size, row_pitch, slice_pitch; + + size = 4; + hr = IDirect3DDevice9_CreateVolumeTexture(device, size, size, size, 0, 0, D3DFMT_A8R8G8B8, + D3DPOOL_MANAGED, &tex, NULL); + + if (SUCCEEDED(hr)) + { + hr = D3DXFillVolumeTexture(tex, fillfunc_volume, NULL); + ok(hr == D3D_OK, "D3DXFillVolumeTexture returned %#x, expected %#x\n", hr, D3D_OK); + + for (m = 0; m < 3; m++) + { + hr = IDirect3DVolumeTexture9_LockBox(tex, m, &lock_box, NULL, D3DLOCK_READONLY); + ok(hr == D3D_OK, "Couldn't lock the texture, error %#x\n", hr); + if (SUCCEEDED(hr)) + { + row_pitch = lock_box.RowPitch / sizeof(DWORD); + slice_pitch = lock_box.SlicePitch / sizeof(DWORD); + for (z = 0; z < size; z++) + { + for (y = 0; y < size; y++) + { + for (x = 0; x < size; x++) + { + value = ((DWORD *)lock_box.pBits)[z * slice_pitch + y * row_pitch + x]; + v[0] = (value >> 24) & 0xff; + v[1] = (value >> 16) & 0xff; + v[2] = (value >> 8) & 0xff; + v[3] = value & 0xff; + + e[0] = 255.0f / size + 0.5f; + e[1] = (x + 0.5f) / size * 255.0f + 0.5f; + e[2] = (y + 0.5f) / size * 255.0f + 0.5f; + e[3] = (z + 0.5f) / size * 255.0f + 0.5f; + expected = e[0] << 24 | e[1] << 16 | e[2] << 8 | e[3]; + + ok(color_match(v, e), + "Texel at (%u, %u, %u) doesn't match: %#x, expected %#x\n", + x, y, z, value, expected); + } + } + } + IDirect3DVolumeTexture9_UnlockBox(tex, m); + } + size >>= 1; + } + } + 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); + + if (SUCCEEDED(hr)) + { + hr = D3DXFillVolumeTexture(tex, fillfunc_volume, NULL); + ok(hr == D3D_OK, "D3DXFillTexture returned %#x, expected %#x\n", hr, D3D_OK); + hr = IDirect3DVolumeTexture9_LockBox(tex, 0, &lock_box, NULL, D3DLOCK_READONLY); + ok(hr == D3D_OK, "Couldn't lock the texture, error %#x\n", hr); + if (SUCCEEDED(hr)) + { + row_pitch = lock_box.RowPitch / sizeof(WORD); + slice_pitch = lock_box.SlicePitch / sizeof(WORD); + for (z = 0; z < 4; z++) + { + for (y = 0; y < 4; y++) + { + for (x = 0; x < 4; x++) + { + value = ((WORD *)lock_box.pBits)[z * slice_pitch + y * row_pitch + x]; + v[0] = value >> 15; + v[1] = value >> 10 & 0x1f; + v[2] = value >> 5 & 0x1f; + v[3] = value & 0x1f; + + e[0] = 1; + e[1] = (x + 0.5f) / 4 * 31.0f + 0.5f; + e[2] = (y + 0.5f) / 4 * 31.0f + 0.5f; + e[3] = (z + 0.5f) / 4 * 31.0f + 0.5f; + expected = e[0] << 15 | e[1] << 10 | e[2] << 5 | e[3]; + + ok(color_match(v, e), + "Texel at (%u, %u, %u) doesn't match: %#x, expected %#x\n", + x, y, z, value, expected); + } + } + } + IDirect3DVolumeTexture9_UnlockBox(tex, 0); + } + } + else + skip("Failed to create texture\n"); + + IDirect3DVolumeTexture9_Release(tex); +} + START_TEST(texture) { HWND wnd; @@ -970,6 +1085,7 @@ START_TEST(texture) test_D3DXFilterTexture(device); test_D3DXFillTexture(device); test_D3DXFillCubeTexture(device); + test_D3DXFillVolumeTexture(device); IDirect3DDevice9_Release(device); IDirect3D9_Release(d3d); diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 550f61f..c6e2273 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -1163,3 +1163,101 @@ HRESULT WINAPI D3DXFillCubeTexture(LPDIRECT3DCUBETEXTURE9 texture, return D3D_OK; } + +HRESULT WINAPI D3DXFillVolumeTexture(LPDIRECT3DVOLUMETEXTURE9 texture, + LPD3DXFILL3D function, + LPVOID funcdata) +{ + DWORD miplevels; + DWORD m, i, x, y, z, c, v; + D3DVOLUME_DESC desc; + D3DLOCKED_BOX lock_box; + D3DXVECTOR4 value; + D3DXVECTOR3 coord, size; + const PixelFormatDesc *format; + BYTE *data, *pos; + BYTE byte, mask; + float comp_value; + + if (texture == NULL || function == NULL) + return D3DERR_INVALIDCALL; + + miplevels = IDirect3DBaseTexture9_GetLevelCount(texture); + + for (m = 0; m < miplevels; m++) + { + if (FAILED(IDirect3DVolumeTexture9_GetLevelDesc(texture, m, &desc))) + return D3DERR_INVALIDCALL; + + format = get_format_info(desc.Format); + if (format->format == D3DFMT_UNKNOWN) + { + FIXME("Unsupported texture format %#x\n", desc.Format); + return D3DERR_INVALIDCALL; + } + + if (FAILED(IDirect3DVolumeTexture9_LockBox(texture, m, &lock_box, NULL, D3DLOCK_DISCARD))) + return D3DERR_INVALIDCALL; + + size.x = 1.0f / desc.Width; + size.y = 1.0f / desc.Height; + size.z = 1.0f / desc.Depth; + + data = lock_box.pBits; + + for (z = 0; z < desc.Depth; z++) + { + /* The callback function expects the coordinates of the center + of the texel */ + coord.z = (z + 0.5f) / desc.Depth; + + for (y = 0; y < desc.Height; y++) + { + coord.y = (y + 0.5f) / desc.Height; + + for (x = 0; x < desc.Width; x++) + { + coord.x = (x + 0.5f) / desc.Width; + + function(&value, &coord, &size, funcdata); + + pos = data + z * lock_box.SlicePitch + y * lock_box.RowPitch + x * format->bytes_per_pixel; + + for (i = 0; i < format->bytes_per_pixel; i++) + pos[i] = 0; + + for (c = 0; c < 4; c++) + { + switch (c) + { + case 0: /* Alpha */ + comp_value = value.w; + break; + case 1: /* Red */ + comp_value = value.x; + break; + case 2: /* Green */ + comp_value = value.y; + break; + case 3: /* Blue */ + comp_value = value.z; + break; + } + + v = comp_value * ((1 << format->bits[c]) - 1) + 0.5f; + + for (i = 0; i < format->bits[c] + format->shift[c]; i += 8) + { + mask = ((1 << format->bits[c]) - 1) << format->shift[c] >> i; + byte = (v << format->shift[c] >> i) & mask; + pos[i / 8] |= byte; + } + } + } + } + } + IDirect3DVolumeTexture9_UnlockBox(texture, m); + } + + return D3D_OK; +}
1
0
0
0
Matteo Bruni : d3dx9: Implement D3DXFillCubeTexture function.
by Alexandre Julliard
18 Nov '10
18 Nov '10
Module: wine Branch: master Commit: 8f6cf460bec31c97b6f6fa584093d96ac7b82ca1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8f6cf460bec31c97b6f6fa584…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Sat Nov 13 00:05:11 2010 +0100 d3dx9: Implement D3DXFillCubeTexture function. --- dlls/d3dx9_36/d3dx9_36.spec | 2 +- dlls/d3dx9_36/tests/texture.c | 157 +++++++++++++++++++++++++++++++++++++++++ dlls/d3dx9_36/texture.c | 135 +++++++++++++++++++++++++++++++++++ 3 files changed, 293 insertions(+), 1 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8f6cf460bec31c97b6f6f…
1
0
0
0
Matteo Bruni : d3dx9: Implement D3DXFillTexture function.
by Alexandre Julliard
18 Nov '10
18 Nov '10
Module: wine Branch: master Commit: bffbf3460b01903209fc280abef53fdb4f84b274 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bffbf3460b01903209fc280ab…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Tue Nov 9 19:10:17 2010 +0100 d3dx9: Implement D3DXFillTexture function. --- dlls/d3dx9_36/d3dx9_36.spec | 2 +- dlls/d3dx9_36/tests/texture.c | 121 +++++++++++++++++++++++++++++++++++++++++ dlls/d3dx9_36/texture.c | 92 +++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index efe28c5..43362aa 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -124,7 +124,7 @@ @ stub D3DXFileCreate @ stub D3DXFillCubeTexture @ stub D3DXFillCubeTextureTX -@ stub D3DXFillTexture +@ stdcall D3DXFillTexture(ptr ptr ptr) @ stub D3DXFillTextureTX @ stub D3DXFillVolumeTexture @ stub D3DXFillVolumeTextureTX diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 177b4c7..fb3cee0 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -656,6 +656,126 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device) IDirect3DCubeTexture9_Release(cubetex); } +static BOOL color_match(const DWORD *value, const DWORD *expected) +{ + int i; + + for (i = 0; i < 4; i++) + { + DWORD diff = value[i] > expected[i] ? value[i] - expected[i] : expected[i] - value[i]; + if (diff > 1) return FALSE; + } + return TRUE; +} + +static void WINAPI fillfunc(D3DXVECTOR4 *value, const D3DXVECTOR2 *texcoord, + const D3DXVECTOR2 *texelsize, void *data) +{ + value->x = texcoord->x; + value->y = texcoord->y; + value->z = texelsize->x; + value->w = 1.0f; +} + +static void test_D3DXFillTexture(IDirect3DDevice9 *device) +{ + IDirect3DTexture9 *tex; + HRESULT hr; + D3DLOCKED_RECT lock_rect; + DWORD x, y, m; + DWORD v[4], e[4]; + DWORD value, expected, size, pitch; + + size = 4; + hr = IDirect3DDevice9_CreateTexture(device, size, size, 0, 0, D3DFMT_A8R8G8B8, + D3DPOOL_MANAGED, &tex, NULL); + + if (SUCCEEDED(hr)) + { + hr = D3DXFillTexture(tex, fillfunc, NULL); + ok(hr == D3D_OK, "D3DXFillTexture returned %#x, expected %#x\n", hr, D3D_OK); + + for (m = 0; m < 3; m++) + { + hr = IDirect3DTexture9_LockRect(tex, m, &lock_rect, NULL, D3DLOCK_READONLY); + ok(hr == D3D_OK, "Couldn't lock the texture, error %#x\n", hr); + if (SUCCEEDED(hr)) + { + pitch = lock_rect.Pitch / sizeof(DWORD); + for (y = 0; y < size; y++) + { + for (x = 0; x < size; x++) + { + value = ((DWORD *)lock_rect.pBits)[y * pitch + x]; + v[0] = (value >> 24) & 0xff; + v[1] = (value >> 16) & 0xff; + v[2] = (value >> 8) & 0xff; + v[3] = value & 0xff; + + e[0] = 0xff; + e[1] = (x + 0.5f) / size * 255.0f + 0.5f; + e[2] = (y + 0.5f) / size * 255.0f + 0.5f; + e[3] = 255.0f / size + 0.5f; + expected = e[0] << 24 | e[1] << 16 | e[2] << 8 | e[3]; + + ok(color_match(v, e), + "Texel at (%u, %u) doesn't match: %#x, expected %#x\n", + x, y, value, expected); + } + } + IDirect3DTexture9_UnlockRect(tex, m); + } + size >>= 1; + } + } + else + skip("Failed to create texture\n"); + + IDirect3DTexture9_Release(tex); + + hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 1, 0, D3DFMT_A1R5G5B5, + D3DPOOL_MANAGED, &tex, NULL); + + if (SUCCEEDED(hr)) + { + hr = D3DXFillTexture(tex, fillfunc, NULL); + ok(hr == D3D_OK, "D3DXFillTexture returned %#x, expected %#x\n", hr, D3D_OK); + + hr = IDirect3DTexture9_LockRect(tex, 0, &lock_rect, NULL, D3DLOCK_READONLY); + ok(hr == D3D_OK, "Couldn't lock the texture, error %#x\n", hr); + if (SUCCEEDED(hr)) + { + pitch = lock_rect.Pitch / sizeof(WORD); + for (y = 0; y < 4; y++) + { + for (x = 0; x < 4; x++) + { + value = ((WORD *)lock_rect.pBits)[y * pitch + x]; + v[0] = value >> 15; + v[1] = value >> 10 & 0x1f; + v[2] = value >> 5 & 0x1f; + v[3] = value & 0x1f; + + e[0] = 1; + e[1] = (x + 0.5f) / 4.0f * 31.0f + 0.5f; + e[2] = (y + 0.5f) / 4.0f * 31.0f + 0.5f; + e[3] = 8; + expected = e[0] << 15 | e[1] << 10 | e[2] << 5 | e[3]; + + ok(color_match(v, e), + "Texel at (%u, %u) doesn't match: %#x, expected %#x\n", + x, y, value, expected); + } + } + IDirect3DTexture9_UnlockRect(tex, 0); + } + } + else + skip("Failed to create texture\n"); + + IDirect3DTexture9_Release(tex); +} + START_TEST(texture) { HWND wnd; @@ -692,6 +812,7 @@ START_TEST(texture) test_D3DXCheckVolumeTextureRequirements(device); test_D3DXCreateTexture(device); test_D3DXFilterTexture(device); + test_D3DXFillTexture(device); IDirect3DDevice9_Release(device); IDirect3D9_Release(d3d); diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 04422e5..2c88ca6 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -936,3 +936,95 @@ HRESULT WINAPI D3DXCreateVolumeTexture(LPDIRECT3DDEVICE9 device, return IDirect3DDevice9_CreateVolumeTexture(device, width, height, depth, miplevels, usage, format, pool, texture, NULL); } + +HRESULT WINAPI D3DXFillTexture(LPDIRECT3DTEXTURE9 texture, + LPD3DXFILL2D function, + LPVOID funcdata) +{ + DWORD miplevels; + DWORD m, i, x, y, c, v; + D3DSURFACE_DESC desc; + D3DLOCKED_RECT lock_rect; + D3DXVECTOR4 value; + D3DXVECTOR2 coord, size; + const PixelFormatDesc *format; + BYTE *data, *pos; + BYTE byte, mask; + float comp_value; + + if (texture == NULL || function == NULL) + return D3DERR_INVALIDCALL; + + miplevels = IDirect3DBaseTexture9_GetLevelCount(texture); + + for (m = 0; m < miplevels; m++) + { + if (FAILED(IDirect3DTexture9_GetLevelDesc(texture, m, &desc))) + return D3DERR_INVALIDCALL; + + format = get_format_info(desc.Format); + if (format->format == D3DFMT_UNKNOWN) + { + FIXME("Unsupported texture format %#x\n", desc.Format); + return D3DERR_INVALIDCALL; + } + + if (FAILED(IDirect3DTexture9_LockRect(texture, m, &lock_rect, NULL, D3DLOCK_DISCARD))) + return D3DERR_INVALIDCALL; + + size.x = 1.0f / desc.Width; + size.y = 1.0f / desc.Height; + + data = lock_rect.pBits; + + for (y = 0; y < desc.Height; y++) + { + /* The callback function expects the coordinates of the center + of the texel */ + coord.y = (y + 0.5f) / desc.Height; + + for (x = 0; x < desc.Width; x++) + { + coord.x = (x + 0.5f) / desc.Width; + + function(&value, &coord, &size, funcdata); + + pos = data + y * lock_rect.Pitch + x * format->bytes_per_pixel; + + for (i = 0; i < format->bytes_per_pixel; i++) + pos[i] = 0; + + for (c = 0; c < 4; c++) + { + switch (c) + { + case 0: /* Alpha */ + comp_value = value.w; + break; + case 1: /* Red */ + comp_value = value.x; + break; + case 2: /* Green */ + comp_value = value.y; + break; + case 3: /* Blue */ + comp_value = value.z; + break; + } + + v = comp_value * ((1 << format->bits[c]) - 1) + 0.5f; + + for (i = 0; i < format->bits[c] + format->shift[c]; i += 8) + { + mask = ((1 << format->bits[c]) - 1) << format->shift[c] >> i; + byte = (v << format->shift[c] >> i) & mask; + pos[i / 8] |= byte; + } + } + } + } + IDirect3DTexture9_UnlockRect(texture, m); + } + + return D3D_OK; +}
1
0
0
0
Travis Athougies : d3dcompiler_43/tests: Added trigonometric function tests to HLSL test suite.
by Alexandre Julliard
18 Nov '10
18 Nov '10
Module: wine Branch: master Commit: dbb2d287954589082c647555dacddb4a018cb403 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dbb2d287954589082c647555d…
Author: Travis Athougies <iammisc(a)gmail.com> Date: Wed Nov 17 16:33:04 2010 -0800 d3dcompiler_43/tests: Added trigonometric function tests to HLSL test suite. --- dlls/d3dcompiler_43/tests/hlsl.c | 63 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+), 0 deletions(-) diff --git a/dlls/d3dcompiler_43/tests/hlsl.c b/dlls/d3dcompiler_43/tests/hlsl.c index bab11a6..1f8e31c 100644 --- a/dlls/d3dcompiler_43/tests/hlsl.c +++ b/dlls/d3dcompiler_43/tests/hlsl.c @@ -494,6 +494,68 @@ static void test_float_vectors(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 } } +static void test_trig(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geometry, + IDirect3DVertexShader9 *vshader_passthru) +{ + static const struct hlsl_probe_info sincos_probes[] = + { + {0, 0, {0.5000f, 1.0000f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {1, 0, {0.5975f, 0.9904f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {2, 0, {0.6913f, 0.9620f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {3, 0, {0.7778f, 0.9160f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {4, 0, {0.8536f, 0.8536f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {5, 0, {0.9157f, 0.7778f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {6, 0, {0.9620f, 0.6913f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {7, 0, {0.9904f, 0.5975f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {8, 0, {1.0000f, 0.5000f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {9, 0, {0.9904f, 0.4025f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {10, 0, {0.9619f, 0.3087f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {11, 0, {0.9157f, 0.2222f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {12, 0, {0.8536f, 0.1464f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {13, 0, {0.7778f, 0.0843f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {14, 0, {0.6913f, 0.0381f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {15, 0, {0.5975f, 0.0096f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {16, 0, {0.5000f, 0.0000f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {17, 0, {0.4025f, 0.0096f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {18, 0, {0.3087f, 0.0381f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {19, 0, {0.2222f, 0.0843f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {20, 0, {0.1464f, 0.1464f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {21, 0, {0.0843f, 0.2222f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {22, 0, {0.0381f, 0.3087f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {23, 0, {0.0096f, 0.4025f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {24, 0, {0.0000f, 0.5000f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {25, 0, {0.0096f, 0.5975f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {26, 0, {0.0381f, 0.6913f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {27, 0, {0.0843f, 0.7778f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {28, 0, {0.1464f, 0.8536f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {29, 0, {0.2222f, 0.9157f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {30, 0, {0.3087f, 0.9619f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + {31, 0, {0.4025f, 0.9904f, 0.0f, 0.0f}, 0.001f, "sin/cos test failed"}, + }; + + static const char *sincos_shader = + "float4 test(float x: TEXCOORD0): COLOR \ + { \ + const float pi2 = 6.2831853; \ + float calcd_sin = (sin(x * pi2) + 1)/2; \ + float calcd_cos = (cos(x * pi2) + 1)/2; \ + return float4(calcd_sin, calcd_cos, 0, 0); \ + }"; + + ID3DXConstantTable *constants; + IDirect3DPixelShader9 *pshader; + + pshader = compile_pixel_shader9(device, sincos_shader, "ps_2_0", &constants); + if (pshader != NULL) + { + compute_shader_probe9(device, vshader_passthru, pshader, quad_geometry, sincos_probes, + sizeof(sincos_probes) / sizeof(*sincos_probes), 32, 1, __LINE__); + + IUnknown_Release(constants); + IUnknown_Release(pshader); + } +} + START_TEST(hlsl) { D3DCAPS9 caps; @@ -517,6 +579,7 @@ START_TEST(hlsl) test_math(device, quad_geometry, vshader_passthru); test_conditionals(device, quad_geometry, vshader_passthru); test_float_vectors(device, quad_geometry, vshader_passthru); + test_trig(device, quad_geometry, vshader_passthru); } } else skip("no pixel shader support\n");
1
0
0
0
Andrew Bogott : ole32/tests: Added a couple of simple tests for StgCreateStorageEx.
by Alexandre Julliard
18 Nov '10
18 Nov '10
Module: wine Branch: master Commit: ddc5cbb3711cf0624b4346449142c6d96833e931 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ddc5cbb3711cf0624b4346449…
Author: Andrew Bogott <andrew(a)CodeWeavers.com> Date: Tue Nov 9 04:28:20 2010 -0600 ole32/tests: Added a couple of simple tests for StgCreateStorageEx. --- dlls/ole32/tests/storage32.c | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c index 9bd8f33..bf3402d 100644 --- a/dlls/ole32/tests/storage32.c +++ b/dlls/ole32/tests/storage32.c @@ -241,6 +241,59 @@ static void test_create_storage_modes(void) ok(DeleteFileA(filenameA), "failed to delete file\n"); } +static void test_stgcreatestorageex(void) +{ + HRESULT (WINAPI *pStgCreateStorageEx)(const WCHAR* pwcsName, DWORD grfMode, DWORD stgfmt, DWORD grfAttrs, STGOPTIONS* pStgOptions, void* reserved, REFIID riid, void** ppObjectOpen); + HMODULE hOle32 = GetModuleHandle("ole32"); + IStorage *stg = NULL; + STGOPTIONS stgoptions = {1, 0, 4096}; + HRESULT r; + + pStgCreateStorageEx = (void *) GetProcAddress(hOle32, "StgCreateStorageEx"); + if (!pStgCreateStorageEx) + { + win_skip("skipping test on NT4\n"); + return; + } + + DeleteFileA(filenameA); + + /* Verify that StgCreateStorageEx can accept an options param */ + r = pStgCreateStorageEx( filename, + STGM_SHARE_EXCLUSIVE | STGM_READWRITE, + STGFMT_DOCFILE, + 0, + &stgoptions, + NULL, + &IID_IStorage, + (void **) &stg); + ok(r==S_OK || r==STG_E_UNIMPLEMENTEDFUNCTION, "StgCreateStorageEx with options failed\n"); + if (r==STG_E_UNIMPLEMENTEDFUNCTION) + { + /* We're on win98 which means all bets are off. Let's get out of here. */ + win_skip("skipping test on win9x\n"); + return; + } + + r = IStorage_Release(stg); + ok(r == 0, "storage not released\n"); + ok(DeleteFileA(filenameA), "failed to delete file\n"); + + /* Verify that StgCreateStorageEx can accept a NULL pStgOptions */ + r = pStgCreateStorageEx( filename, + STGM_SHARE_EXCLUSIVE | STGM_READWRITE, + STGFMT_STORAGE, + 0, + NULL, + NULL, + &IID_IStorage, + (void **) &stg); + ok(r==S_OK, "StgCreateStorageEx with NULL options failed\n"); + r = IStorage_Release(stg); + ok(r == 0, "storage not released\n"); + ok(DeleteFileA(filenameA), "failed to delete file\n"); +} + static void test_storage_stream(void) { static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; @@ -2896,6 +2949,7 @@ START_TEST(storage32) test_hglobal_storage_stat(); test_create_storage_modes(); + test_stgcreatestorageex(); test_storage_stream(); test_open_storage(); test_storage_suminfo();
1
0
0
0
Andrew Bogott : ole32: Use default values if options passed to StgCreateStorageEx are NULL.
by Alexandre Julliard
18 Nov '10
18 Nov '10
Module: wine Branch: master Commit: 42cd791c4dcd8ea8d45c99675efc3a27c5aa5859 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=42cd791c4dcd8ea8d45c99675…
Author: Andrew Bogott <andrew(a)CodeWeavers.com> Date: Tue Nov 9 04:25:19 2010 -0600 ole32: Use default values if options passed to StgCreateStorageEx are NULL. --- dlls/ole32/storage32.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index b58e445..2d62956 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -7430,6 +7430,9 @@ HRESULT WINAPI StgCreateStorageEx(const WCHAR* pwcsName, DWORD grfMode, DWORD st if (stgfmt == STGFMT_STORAGE || stgfmt == STGFMT_DOCFILE) { + STGOPTIONS defaultOptions = {1, 0, 512}; + + if (!pStgOptions) pStgOptions = &defaultOptions; return create_storagefile(pwcsName, grfMode, grfAttrs, pStgOptions, riid, ppObjectOpen); }
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
87
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
Results per page:
10
25
50
100
200