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
April 2017
----- 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
757 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Merge wined3d_device_update_texture_3d() into wined3d_device_update_texture().
by Alexandre Julliard
10 Apr '17
10 Apr '17
Module: wine Branch: master Commit: 97fee99cb44680a29eb616050a7f6b8a91f2ffa0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=97fee99cb44680a29eb616050…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Sun Apr 9 22:36:41 2017 +0200 wined3d: Merge wined3d_device_update_texture_3d() into wined3d_device_update_texture(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/device.c | 73 +++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 6269590..ce02af4 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3538,52 +3538,16 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device start_idx, index_count, start_instance, instance_count, TRUE); } -static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, - struct wined3d_texture *src_texture, unsigned int src_level, - struct wined3d_texture *dst_texture, unsigned int level_count) -{ - unsigned int row_pitch, slice_pitch, i; - HRESULT hr = WINED3DERR_INVALIDCALL; - struct wined3d_context *context; - struct wined3d_bo_address data; - - TRACE("device %p, src_texture %p, src_level %u, dst_texture %p, level_count %u.\n", - device, src_texture, src_level, dst_texture, level_count); - - context = context_acquire(device, NULL, 0); - - /* Only a prepare, since we're uploading entire volumes. */ - wined3d_texture_prepare_texture(dst_texture, context, FALSE); - wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE); - - for (i = 0; i < level_count; ++i) - { - if (!wined3d_texture_load_location(src_texture, src_level + i, - context, src_texture->resource.map_binding)) - goto done; - - wined3d_texture_get_memory(src_texture, src_level + i, &data, src_texture->resource.map_binding); - wined3d_texture_get_pitch(src_texture, src_level + i, &row_pitch, &slice_pitch); - - wined3d_texture_upload_data(dst_texture, i, context, NULL, - wined3d_const_bo_address(&data), row_pitch, slice_pitch); - wined3d_texture_invalidate_location(dst_texture, i, ~WINED3D_LOCATION_TEXTURE_RGB); - } - - hr = WINED3D_OK; -done: - context_release(context); - return hr; -} - HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) { unsigned int src_size, dst_size, src_skip_levels = 0; unsigned int layer_count, level_count, i, j; + unsigned int row_pitch, slice_pitch; enum wined3d_resource_type type; - HRESULT hr; struct wined3d_context *context; + struct wined3d_bo_address data; + HRESULT hr; RECT r; TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); @@ -3701,10 +3665,33 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, } case WINED3D_RTYPE_TEXTURE_3D: - if (FAILED(hr = wined3d_device_update_texture_3d(device, - src_texture, src_skip_levels, dst_texture, level_count))) - WARN("Failed to update 3D texture, hr %#x.\n", hr); - return hr; + context = context_acquire(device, NULL, 0); + + /* Only a prepare, since we're uploading entire volumes. */ + wined3d_texture_prepare_texture(dst_texture, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE); + + for (j = 0; j < level_count; ++j) + { + if (!wined3d_texture_load_location(src_texture, src_skip_levels + j, + context, src_texture->resource.map_binding)) + { + WARN("Failed to load source sub-resource %u into %s.\n", src_skip_levels + j, + wined3d_debug_location(src_texture->resource.map_binding)); + context_release(context); + return WINED3DERR_INVALIDCALL; + } + + wined3d_texture_get_memory(src_texture, src_skip_levels + j, &data, src_texture->resource.map_binding); + wined3d_texture_get_pitch(src_texture, src_skip_levels + j, &row_pitch, &slice_pitch); + + wined3d_texture_upload_data(dst_texture, j, context, NULL, + wined3d_const_bo_address(&data), row_pitch, slice_pitch); + wined3d_texture_invalidate_location(dst_texture, j, ~WINED3D_LOCATION_TEXTURE_RGB); + } + + context_release(context); + return WINED3D_OK; default: FIXME("Unsupported texture type %#x.\n", type);
1
0
0
0
Henri Verbeet : wined3d: Use wined3d_texture_get_memory() in wined3d_device_update_texture_3d().
by Alexandre Julliard
10 Apr '17
10 Apr '17
Module: wine Branch: master Commit: d59a64d55f53ca8a46024cd674a484711ef513f5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d59a64d55f53ca8a46024cd67…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Sun Apr 9 22:36:40 2017 +0200 wined3d: Use wined3d_texture_get_memory() in wined3d_device_update_texture_3d(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/device.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index c94e88b..6269590 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3542,11 +3542,10 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, struct wined3d_texture *src_texture, unsigned int src_level, struct wined3d_texture *dst_texture, unsigned int level_count) { - struct wined3d_const_bo_address data; + unsigned int row_pitch, slice_pitch, i; + HRESULT hr = WINED3DERR_INVALIDCALL; struct wined3d_context *context; - struct wined3d_map_desc src; - HRESULT hr = WINED3D_OK; - unsigned int i; + struct wined3d_bo_address data; TRACE("device %p, src_texture %p, src_level %u, dst_texture %p, level_count %u.\n", device, src_texture, src_level, dst_texture, level_count); @@ -3559,19 +3558,19 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, for (i = 0; i < level_count; ++i) { - if (FAILED(hr = wined3d_resource_map(&src_texture->resource, - src_level + i, &src, NULL, WINED3D_MAP_READONLY))) + if (!wined3d_texture_load_location(src_texture, src_level + i, + context, src_texture->resource.map_binding)) goto done; - data.buffer_object = 0; - data.addr = src.data; - wined3d_texture_upload_data(dst_texture, i, context, NULL, &data, src.row_pitch, src.slice_pitch); - wined3d_texture_invalidate_location(dst_texture, i, ~WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_get_memory(src_texture, src_level + i, &data, src_texture->resource.map_binding); + wined3d_texture_get_pitch(src_texture, src_level + i, &row_pitch, &slice_pitch); - if (FAILED(hr = wined3d_resource_unmap(&src_texture->resource, src_level + i))) - goto done; + wined3d_texture_upload_data(dst_texture, i, context, NULL, + wined3d_const_bo_address(&data), row_pitch, slice_pitch); + wined3d_texture_invalidate_location(dst_texture, i, ~WINED3D_LOCATION_TEXTURE_RGB); } + hr = WINED3D_OK; done: context_release(context); return hr;
1
0
0
0
Henri Verbeet : wined3d: Validate that the source and destination dimensions match in wined3d_device_update_texture ().
by Alexandre Julliard
10 Apr '17
10 Apr '17
Module: wine Branch: master Commit: 114114f137530d9c8daaec54a10ff04e53878b1a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=114114f137530d9c8daaec54a…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Sun Apr 9 22:36:39 2017 +0200 wined3d: Validate that the source and destination dimensions match in wined3d_device_update_texture(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/device.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index bd07053..c94e88b 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3551,14 +3551,6 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, TRACE("device %p, src_texture %p, src_level %u, dst_texture %p, level_count %u.\n", device, src_texture, src_level, dst_texture, level_count); - if (wined3d_texture_get_level_width(src_texture, src_level) != dst_texture->resource.width - || wined3d_texture_get_level_height(src_texture, src_level) != dst_texture->resource.height - || wined3d_texture_get_level_depth(src_texture, src_level) != dst_texture->resource.depth) - { - WARN("Source and destination dimensions do not match.\n"); - return WINED3DERR_INVALIDCALL; - } - context = context_acquire(device, NULL, 0); /* Only a prepare, since we're uploading entire volumes. */ @@ -3652,6 +3644,14 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, ++src_skip_levels; } + if (wined3d_texture_get_level_width(src_texture, src_skip_levels) != dst_texture->resource.width + || wined3d_texture_get_level_height(src_texture, src_skip_levels) != dst_texture->resource.height + || wined3d_texture_get_level_depth(src_texture, src_skip_levels) != dst_texture->resource.depth) + { + WARN("Source and destination dimensions do not match.\n"); + return WINED3DERR_INVALIDCALL; + } + /* Make sure that the destination texture is loaded. */ context = context_acquire(device, NULL, 0); wined3d_texture_load(dst_texture, context, FALSE);
1
0
0
0
Henri Verbeet : d3d9/tests: Introduce mip-mapping to add_dirty_rect_test() .
by Alexandre Julliard
10 Apr '17
10 Apr '17
Module: wine Branch: master Commit: c68eaaa026e15f6b37623dc49931ee1743f98b66 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c68eaaa026e15f6b37623dc49…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Sun Apr 9 22:36:38 2017 +0200 d3d9/tests: Introduce mip-mapping to add_dirty_rect_test(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/visual.c | 53 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 5f96cc3..6fe7c8b 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -17319,7 +17319,7 @@ static void add_dirty_rect_test(void) IDirect3DTexture9 *tex_dst1, *tex_dst2, *tex_src_red, *tex_src_green, *tex_managed, *tex_dynamic; IDirect3DSurface9 *surface_dst2, *surface_src_green, *surface_src_red, - *surface_managed, *surface_dynamic; + *surface_managed0, *surface_managed1, *surface_dynamic; IDirect3DDevice9 *device; IDirect3D9 *d3d; unsigned int i; @@ -17353,7 +17353,7 @@ static void add_dirty_rect_test(void) hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM, &tex_src_green, NULL); ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); - hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 1, 0, D3DFMT_X8R8G8B8, + hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 2, 0, D3DFMT_X8R8G8B8, D3DPOOL_MANAGED, &tex_managed, NULL); ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 1, D3DUSAGE_DYNAMIC, @@ -17366,7 +17366,9 @@ static void add_dirty_rect_test(void) ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); hr = IDirect3DTexture9_GetSurfaceLevel(tex_src_red, 0, &surface_src_red); ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); - hr = IDirect3DTexture9_GetSurfaceLevel(tex_managed, 0, &surface_managed); + hr = IDirect3DTexture9_GetSurfaceLevel(tex_managed, 0, &surface_managed0); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(tex_managed, 1, &surface_managed1); ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); hr = IDirect3DTexture9_GetSurfaceLevel(tex_dynamic, 0, &surface_dynamic); ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); @@ -17380,6 +17382,8 @@ static void add_dirty_rect_test(void) ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); hr = IDirect3DDevice9_UpdateTexture(device, (IDirect3DBaseTexture9 *)tex_src_green, (IDirect3DBaseTexture9 *)tex_dst1); @@ -17563,7 +17567,8 @@ static void add_dirty_rect_test(void) ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); /* Tests with managed textures. */ - fill_surface(surface_managed, 0x00ff0000, 0); + fill_surface(surface_managed0, 0x00ff0000, 0); + fill_surface(surface_managed1, 0x00ff0000, 0); hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)tex_managed); ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); add_dirty_rect_test_draw(device); @@ -17572,15 +17577,30 @@ static void add_dirty_rect_test(void) "Expected color 0x00ff0000, got 0x%08x.\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); /* Managed textures also honor D3DLOCK_NO_DIRTY_UPDATE. */ - fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); + fill_surface(surface_managed0, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); + fill_surface(surface_managed1, 0x000000ff, D3DLOCK_NO_DIRTY_UPDATE); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); ok(color_match(color, 0x00ff0000, 1), "Expected color 0x00ff0000, got 0x%08x.\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 0); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); /* AddDirtyRect uploads the new contents. * Side note, not tested in the test: Partial surface updates work, and two separate @@ -17594,15 +17614,29 @@ static void add_dirty_rect_test(void) "Expected color 0x0000ff00, got 0x%08x.\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); + todo_wine ok(color_match(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); /* So does EvictManagedResources. */ - fill_surface(surface_managed, 0x000000ff, D3DLOCK_NO_DIRTY_UPDATE); + fill_surface(surface_managed0, 0x00ffff00, D3DLOCK_NO_DIRTY_UPDATE); + fill_surface(surface_managed1, 0x00ff00ff, D3DLOCK_NO_DIRTY_UPDATE); hr = IDirect3DDevice9_EvictManagedResources(device); ok(SUCCEEDED(hr), "Failed to evict managed resources, hr %#x.\n", hr); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); - ok(color_match(color, 0x000000ff, 1), - "Expected color 0x000000ff, got 0x%08x.\n", color); + ok(color_match(color, 0x00ff00ff, 1), "Got unexpected color 0x%08x.\n", color); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 0); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x00ffff00, 1), "Got unexpected color 0x%08x.\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); @@ -17645,7 +17679,8 @@ static void add_dirty_rect_test(void) hr = IDirect3DDevice9_SetTexture(device, 0, NULL); ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); IDirect3DSurface9_Release(surface_dst2); - IDirect3DSurface9_Release(surface_managed); + IDirect3DSurface9_Release(surface_managed1); + IDirect3DSurface9_Release(surface_managed0); IDirect3DSurface9_Release(surface_src_red); IDirect3DSurface9_Release(surface_src_green); IDirect3DSurface9_Release(surface_dynamic);
1
0
0
0
Henri Verbeet : d3d8/tests: Introduce mip-mapping to add_dirty_rect_test() .
by Alexandre Julliard
10 Apr '17
10 Apr '17
Module: wine Branch: master Commit: 871657f169a28b3177cc7c36e784e4d8a41bdb1c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=871657f169a28b3177cc7c36e…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Sun Apr 9 22:36:37 2017 +0200 d3d8/tests: Introduce mip-mapping to add_dirty_rect_test(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d8/tests/visual.c | 53 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index d314edb..d97f467 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -5219,7 +5219,7 @@ static void add_dirty_rect_test(void) IDirect3DTexture8 *tex_dst1, *tex_dst2, *tex_src_red, *tex_src_green, *tex_managed, *tex_dynamic; IDirect3DSurface8 *surface_dst2, *surface_src_green, *surface_src_red, - *surface_managed, *surface_dynamic; + *surface_managed0, *surface_managed1, *surface_dynamic; D3DLOCKED_RECT locked_rect; IDirect3DDevice8 *device; IDirect3D8 *d3d; @@ -5253,7 +5253,7 @@ static void add_dirty_rect_test(void) hr = IDirect3DDevice8_CreateTexture(device, 256, 256, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM, &tex_src_green); ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); - hr = IDirect3DDevice8_CreateTexture(device, 256, 256, 1, 0, D3DFMT_X8R8G8B8, + hr = IDirect3DDevice8_CreateTexture(device, 256, 256, 2, 0, D3DFMT_X8R8G8B8, D3DPOOL_MANAGED, &tex_managed); ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); hr = IDirect3DDevice8_CreateTexture(device, 256, 256, 1, D3DUSAGE_DYNAMIC, @@ -5266,7 +5266,9 @@ static void add_dirty_rect_test(void) ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); hr = IDirect3DTexture8_GetSurfaceLevel(tex_src_red, 0, &surface_src_red); ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); - hr = IDirect3DTexture8_GetSurfaceLevel(tex_managed, 0, &surface_managed); + hr = IDirect3DTexture8_GetSurfaceLevel(tex_managed, 0, &surface_managed0); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DTexture8_GetSurfaceLevel(tex_managed, 1, &surface_managed1); ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); hr = IDirect3DTexture8_GetSurfaceLevel(tex_dynamic, 0, &surface_dynamic); ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); @@ -5280,6 +5282,8 @@ static void add_dirty_rect_test(void) ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MIPFILTER, D3DTEXF_POINT); + ok(SUCCEEDED(hr), "Failed to set mip filter, hr %#x.\n", hr); hr = IDirect3DDevice8_UpdateTexture(device, (IDirect3DBaseTexture8 *)tex_src_green, (IDirect3DBaseTexture8 *)tex_dst1); @@ -5463,7 +5467,8 @@ static void add_dirty_rect_test(void) ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); /* Tests with managed textures. */ - fill_surface(surface_managed, 0x00ff0000, 0); + fill_surface(surface_managed0, 0x00ff0000, 0); + fill_surface(surface_managed1, 0x00ff0000, 0); hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *)tex_managed); ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); add_dirty_rect_test_draw(device); @@ -5472,15 +5477,30 @@ static void add_dirty_rect_test(void) "Expected color 0x00ff0000, got 0x%08x.\n", color); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MAXMIPLEVEL, 1); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); /* Managed textures also honor D3DLOCK_NO_DIRTY_UPDATE. */ - fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); + fill_surface(surface_managed0, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); + fill_surface(surface_managed1, 0x000000ff, D3DLOCK_NO_DIRTY_UPDATE); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); ok(color_match(color, 0x00ff0000, 1), "Expected color 0x00ff0000, got 0x%08x.\n", color); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MAXMIPLEVEL, 0); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); /* AddDirtyRect uploads the new contents. * Side note, not tested in the test: Partial surface updates work, and two separate @@ -5494,15 +5514,29 @@ static void add_dirty_rect_test(void) "Expected color 0x0000ff00, got 0x%08x.\n", color); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MAXMIPLEVEL, 1); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); + todo_wine ok(color_match(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color); + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); /* So does ResourceManagerDiscardBytes. */ - fill_surface(surface_managed, 0x000000ff, D3DLOCK_NO_DIRTY_UPDATE); + fill_surface(surface_managed0, 0x00ffff00, D3DLOCK_NO_DIRTY_UPDATE); + fill_surface(surface_managed1, 0x00ff00ff, D3DLOCK_NO_DIRTY_UPDATE); hr = IDirect3DDevice8_ResourceManagerDiscardBytes(device, 0); ok(SUCCEEDED(hr), "Failed to evict managed resources, hr %#x.\n", hr); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); - ok(color_match(color, 0x000000ff, 1), - "Expected color 0x000000ff, got 0x%08x.\n", color); + ok(color_match(color, 0x00ff00ff, 1), "Got unexpected color 0x%08x.\n", color); + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MAXMIPLEVEL, 0); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x00ffff00, 1), "Got unexpected color 0x%08x.\n", color); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); @@ -5541,7 +5575,8 @@ static void add_dirty_rect_test(void) ok(SUCCEEDED(hr), "Failed to add dirty rect, hr %#x.\n", hr); IDirect3DSurface8_Release(surface_dst2); - IDirect3DSurface8_Release(surface_managed); + IDirect3DSurface8_Release(surface_managed1); + IDirect3DSurface8_Release(surface_managed0); IDirect3DSurface8_Release(surface_src_red); IDirect3DSurface8_Release(surface_src_green); IDirect3DSurface8_Release(surface_dynamic);
1
0
0
0
Matteo Bruni : wined3d: Split line antialiasing to a separate state handler.
by Alexandre Julliard
10 Apr '17
10 Apr '17
Module: wine Branch: master Commit: 28bd66dabb1c01545919d614b4e2bd536e34ab08 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=28bd66dabb1c01545919d614b…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Sun Apr 9 21:03:37 2017 +0200 wined3d: Split line antialiasing to a separate state handler. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/state.c | 58 ++++++++++++++++++++++------------------------------ 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index e138936..2c47ce6 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -448,22 +448,9 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st { const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_format *rt_format; - BOOL enable_blend, enable_line_smooth; GLenum src_blend, dst_blend; unsigned int rt_fmt_flags; - - enable_line_smooth = state->render_states[WINED3D_RS_EDGEANTIALIAS] - || state->render_states[WINED3D_RS_ANTIALIASEDLINEENABLE]; - if (enable_line_smooth) - { - gl_info->gl_ops.gl.p_glEnable(GL_LINE_SMOOTH); - checkGLcall("glEnable(GL_LINE_SMOOTH)"); - } - else - { - gl_info->gl_ops.gl.p_glDisable(GL_LINE_SMOOTH); - checkGLcall("glDisable(GL_LINE_SMOOTH)"); - } + BOOL enable_blend; enable_blend = state->fb->render_targets[0] && state->render_states[WINED3D_RS_ALPHABLENDENABLE]; if (enable_blend) @@ -478,34 +465,20 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st enable_blend = FALSE; } - if (enable_blend) - { - gl_info->gl_ops.gl.p_glEnable(GL_BLEND); - checkGLcall("glEnable(GL_BLEND)"); - } - else + if (!enable_blend) { gl_info->gl_ops.gl.p_glDisable(GL_BLEND); checkGLcall("glDisable(GL_BLEND)"); - if (enable_line_smooth) - WARN("LINE/EDGEANTIALIAS enabled with disabled blending.\n"); return; } + gl_info->gl_ops.gl.p_glEnable(GL_BLEND); + checkGLcall("glEnable(GL_BLEND)"); + gl_blend_from_d3d(&src_blend, &dst_blend, state->render_states[WINED3D_RS_SRCBLEND], state->render_states[WINED3D_RS_DESTBLEND], rt_format); - /* According to the red book, GL_LINE_SMOOTH needs GL_BLEND with specific - * blending parameters to work. */ - if (enable_line_smooth) - { - if (src_blend != GL_SRC_ALPHA) - WARN("LINE/EDGEANTIALIAS enabled, but unexpected src blending param.\n"); - if (dst_blend != GL_ONE_MINUS_SRC_ALPHA && dst_blend != GL_ONE) - WARN("LINE/EDGEANTIALIAS enabled, but unexpected dst blending param.\n"); - } - /* Re-apply BLENDOP(ALPHA) because of a possible SEPARATEALPHABLENDENABLE change */ if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_BLENDOP))) state_blendop(context, state, STATE_RENDER(WINED3D_RS_BLENDOPALPHA)); @@ -1667,6 +1640,23 @@ static void state_msaa(struct wined3d_context *context, const struct wined3d_sta } } +static void state_line_antialias(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) +{ + const struct wined3d_gl_info *gl_info = context->gl_info; + + if (state->render_states[WINED3D_RS_EDGEANTIALIAS] + || state->render_states[WINED3D_RS_ANTIALIASEDLINEENABLE]) + { + gl_info->gl_ops.gl.p_glEnable(GL_LINE_SMOOTH); + checkGLcall("glEnable(GL_LINE_SMOOTH)"); + } + else + { + gl_info->gl_ops.gl.p_glDisable(GL_LINE_SMOOTH); + checkGLcall("glDisable(GL_LINE_SMOOTH)"); + } +} + static void state_scissor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -5031,8 +5021,8 @@ const struct StateEntryTemplate misc_state_template[] = { STATE_RENDER(WINED3D_RS_SRCBLEND), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DESTBLEND), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), state_blend }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), state_line_antialias}, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE), { STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE), state_line_antialias}, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SEPARATEALPHABLENDENABLE), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SRCBLENDALPHA), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DESTBLENDALPHA), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE },
1
0
0
0
Matteo Bruni : include: Fix render state maximum version comments.
by Alexandre Julliard
10 Apr '17
10 Apr '17
Module: wine Branch: master Commit: 2d7cc47816dae19f4f57032ddf47186b1b6370c5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2d7cc47816dae19f4f57032dd…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Sun Apr 9 21:03:36 2017 +0200 include: Fix render state maximum version comments. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/d3dtypes.h | 24 ++++++++++++------------ include/wine/wined3d.h | 46 +++++++++++++++++++++++----------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/include/d3dtypes.h b/include/d3dtypes.h index fe7f3b2..fdd417e 100644 --- a/include/d3dtypes.h +++ b/include/d3dtypes.h @@ -829,15 +829,15 @@ typedef enum { D3DRENDERSTATE_ANTIALIAS = 2, D3DRENDERSTATE_TEXTUREADDRESS = 3, D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4, - D3DRENDERSTATE_WRAPU = 5, - D3DRENDERSTATE_WRAPV = 6, + D3DRENDERSTATE_WRAPU = 5, /* <= d3d6 */ + D3DRENDERSTATE_WRAPV = 6, /* <= d3d6 */ D3DRENDERSTATE_ZENABLE = 7, D3DRENDERSTATE_FILLMODE = 8, D3DRENDERSTATE_SHADEMODE = 9, D3DRENDERSTATE_LINEPATTERN = 10, - D3DRENDERSTATE_MONOENABLE = 11, - D3DRENDERSTATE_ROP2 = 12, - D3DRENDERSTATE_PLANEMASK = 13, + D3DRENDERSTATE_MONOENABLE = 11, /* <= d3d6 */ + D3DRENDERSTATE_ROP2 = 12, /* <= d3d6 */ + D3DRENDERSTATE_PLANEMASK = 13, /* <= d3d6 */ D3DRENDERSTATE_ZWRITEENABLE = 14, D3DRENDERSTATE_ALPHATESTENABLE = 15, D3DRENDERSTATE_LASTPIXEL = 16, @@ -855,8 +855,8 @@ typedef enum { D3DRENDERSTATE_FOGENABLE = 28, D3DRENDERSTATE_SPECULARENABLE = 29, D3DRENDERSTATE_ZVISIBLE = 30, - D3DRENDERSTATE_SUBPIXEL = 31, - D3DRENDERSTATE_SUBPIXELX = 32, + D3DRENDERSTATE_SUBPIXEL = 31, /* <= d3d6 */ + D3DRENDERSTATE_SUBPIXELX = 32, /* <= d3d6 */ D3DRENDERSTATE_STIPPLEDALPHA = 33, D3DRENDERSTATE_FOGCOLOR = 34, D3DRENDERSTATE_FOGTABLEMODE = 35, @@ -866,20 +866,20 @@ typedef enum { D3DRENDERSTATE_FOGSTART = 36, D3DRENDERSTATE_FOGEND = 37, D3DRENDERSTATE_FOGDENSITY = 38, - D3DRENDERSTATE_STIPPLEENABLE = 39, + D3DRENDERSTATE_STIPPLEENABLE = 39, /* <= d3d6 */ /* d3d5 */ D3DRENDERSTATE_EDGEANTIALIAS = 40, D3DRENDERSTATE_COLORKEYENABLE = 41, D3DRENDERSTATE_BORDERCOLOR = 43, D3DRENDERSTATE_TEXTUREADDRESSU = 44, D3DRENDERSTATE_TEXTUREADDRESSV = 45, - D3DRENDERSTATE_MIPMAPLODBIAS = 46, + D3DRENDERSTATE_MIPMAPLODBIAS = 46, /* <= d3d6 */ D3DRENDERSTATE_ZBIAS = 47, D3DRENDERSTATE_RANGEFOGENABLE = 48, - D3DRENDERSTATE_ANISOTROPY = 49, - D3DRENDERSTATE_FLUSHBATCH = 50, + D3DRENDERSTATE_ANISOTROPY = 49, /* <= d3d6 */ + D3DRENDERSTATE_FLUSHBATCH = 50, /* <= d3d6 */ /* d3d6 */ - D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT = 51, + D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT = 51, /* <= d3d6 */ D3DRENDERSTATE_STENCILENABLE = 52, D3DRENDERSTATE_STENCILFAIL = 53, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 491f2fd..e598f80 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -254,17 +254,17 @@ enum wined3d_format_id enum wined3d_render_state { - WINED3D_RS_ANTIALIAS = 2, /* d3d7 */ - WINED3D_RS_TEXTUREPERSPECTIVE = 4, /* d3d7 */ - WINED3D_RS_WRAPU = 5, /* d3d7 */ - WINED3D_RS_WRAPV = 6, /* d3d7 */ + WINED3D_RS_ANTIALIAS = 2, + WINED3D_RS_TEXTUREPERSPECTIVE = 4, + WINED3D_RS_WRAPU = 5, + WINED3D_RS_WRAPV = 6, WINED3D_RS_ZENABLE = 7, WINED3D_RS_FILLMODE = 8, WINED3D_RS_SHADEMODE = 9, - WINED3D_RS_LINEPATTERN = 10, /* d3d7, d3d8 */ - WINED3D_RS_MONOENABLE = 11, /* d3d7 */ - WINED3D_RS_ROP2 = 12, /* d3d7 */ - WINED3D_RS_PLANEMASK = 13, /* d3d7 */ + WINED3D_RS_LINEPATTERN = 10, + WINED3D_RS_MONOENABLE = 11, + WINED3D_RS_ROP2 = 12, + WINED3D_RS_PLANEMASK = 13, WINED3D_RS_ZWRITEENABLE = 14, WINED3D_RS_ALPHATESTENABLE = 15, WINED3D_RS_LASTPIXEL = 16, @@ -278,23 +278,23 @@ enum wined3d_render_state WINED3D_RS_ALPHABLENDENABLE = 27, WINED3D_RS_FOGENABLE = 28, WINED3D_RS_SPECULARENABLE = 29, - WINED3D_RS_ZVISIBLE = 30, /* d3d7, d3d8 */ - WINED3D_RS_SUBPIXEL = 31, /* d3d7 */ - WINED3D_RS_SUBPIXELX = 32, /* d3d7 */ - WINED3D_RS_STIPPLEDALPHA = 33, /* d3d7 */ + WINED3D_RS_ZVISIBLE = 30, + WINED3D_RS_SUBPIXEL = 31, + WINED3D_RS_SUBPIXELX = 32, + WINED3D_RS_STIPPLEDALPHA = 33, WINED3D_RS_FOGCOLOR = 34, WINED3D_RS_FOGTABLEMODE = 35, WINED3D_RS_FOGSTART = 36, WINED3D_RS_FOGEND = 37, WINED3D_RS_FOGDENSITY = 38, - WINED3D_RS_STIPPLEENABLE = 39, /* d3d7 */ - WINED3D_RS_EDGEANTIALIAS = 40, /* d3d7, d3d8 */ - WINED3D_RS_COLORKEYENABLE = 41, /* d3d7 */ - WINED3D_RS_MIPMAPLODBIAS = 46, /* d3d7 */ + WINED3D_RS_STIPPLEENABLE = 39, + WINED3D_RS_EDGEANTIALIAS = 40, + WINED3D_RS_COLORKEYENABLE = 41, + WINED3D_RS_MIPMAPLODBIAS = 46, WINED3D_RS_RANGEFOGENABLE = 48, - WINED3D_RS_ANISOTROPY = 49, /* d3d7 */ - WINED3D_RS_FLUSHBATCH = 50, /* d3d7 */ - WINED3D_RS_TRANSLUCENTSORTINDEPENDENT = 51, /* d3d7 */ + WINED3D_RS_ANISOTROPY = 49, + WINED3D_RS_FLUSHBATCH = 50, + WINED3D_RS_TRANSLUCENTSORTINDEPENDENT = 51, WINED3D_RS_STENCILENABLE = 52, WINED3D_RS_STENCILFAIL = 53, WINED3D_RS_STENCILZFAIL = 54, @@ -314,20 +314,20 @@ enum wined3d_render_state WINED3D_RS_WRAP7 = 135, WINED3D_RS_CLIPPING = 136, WINED3D_RS_LIGHTING = 137, - WINED3D_RS_EXTENTS = 138, /* d3d7 */ + WINED3D_RS_EXTENTS = 138, WINED3D_RS_AMBIENT = 139, WINED3D_RS_FOGVERTEXMODE = 140, WINED3D_RS_COLORVERTEX = 141, WINED3D_RS_LOCALVIEWER = 142, WINED3D_RS_NORMALIZENORMALS = 143, - WINED3D_RS_COLORKEYBLENDENABLE = 144, /* d3d7 */ + WINED3D_RS_COLORKEYBLENDENABLE = 144, WINED3D_RS_DIFFUSEMATERIALSOURCE = 145, WINED3D_RS_SPECULARMATERIALSOURCE = 146, WINED3D_RS_AMBIENTMATERIALSOURCE = 147, WINED3D_RS_EMISSIVEMATERIALSOURCE = 148, WINED3D_RS_VERTEXBLEND = 151, WINED3D_RS_CLIPPLANEENABLE = 152, - WINED3D_RS_SOFTWAREVERTEXPROCESSING = 153, /* d3d8 */ + WINED3D_RS_SOFTWAREVERTEXPROCESSING = 153, WINED3D_RS_POINTSIZE = 154, WINED3D_RS_POINTSIZE_MIN = 155, WINED3D_RS_POINTSPRITEENABLE = 156, @@ -338,7 +338,7 @@ enum wined3d_render_state WINED3D_RS_MULTISAMPLEANTIALIAS = 161, WINED3D_RS_MULTISAMPLEMASK = 162, WINED3D_RS_PATCHEDGESTYLE = 163, - WINED3D_RS_PATCHSEGMENTS = 164, /* d3d8 */ + WINED3D_RS_PATCHSEGMENTS = 164, WINED3D_RS_DEBUGMONITORTOKEN = 165, WINED3D_RS_POINTSIZE_MAX = 166, WINED3D_RS_INDEXEDVERTEXBLENDENABLE = 167,
1
0
0
0
Matteo Bruni : include: Add comments for render states added with newer D3D versions.
by Alexandre Julliard
10 Apr '17
10 Apr '17
Module: wine Branch: master Commit: 1bde74854991cbc5975aef147be87b7df79a637d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1bde74854991cbc5975aef147…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Sun Apr 9 21:03:35 2017 +0200 include: Add comments for render states added with newer D3D versions. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/d3dtypes.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/d3dtypes.h b/include/d3dtypes.h index 75aee55..fe7f3b2 100644 --- a/include/d3dtypes.h +++ b/include/d3dtypes.h @@ -867,6 +867,7 @@ typedef enum { D3DRENDERSTATE_FOGEND = 37, D3DRENDERSTATE_FOGDENSITY = 38, D3DRENDERSTATE_STIPPLEENABLE = 39, + /* d3d5 */ D3DRENDERSTATE_EDGEANTIALIAS = 40, D3DRENDERSTATE_COLORKEYENABLE = 41, D3DRENDERSTATE_BORDERCOLOR = 43, @@ -877,6 +878,7 @@ typedef enum { D3DRENDERSTATE_RANGEFOGENABLE = 48, D3DRENDERSTATE_ANISOTROPY = 49, D3DRENDERSTATE_FLUSHBATCH = 50, + /* d3d6 */ D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT = 51, D3DRENDERSTATE_STENCILENABLE = 52, @@ -930,6 +932,7 @@ typedef enum { D3DRENDERSTATE_WRAP5 = 133, D3DRENDERSTATE_WRAP6 = 134, D3DRENDERSTATE_WRAP7 = 135, + /* d3d7 */ D3DRENDERSTATE_CLIPPING = 136, D3DRENDERSTATE_LIGHTING = 137, D3DRENDERSTATE_EXTENTS = 138,
1
0
0
0
Stefan Dösinger : d3dx9/tests: Use float bit patterns in test_D3DXFloat_Array.
by Alexandre Julliard
10 Apr '17
10 Apr '17
Module: wine Branch: master Commit: 4c4649cba42731021037c4cedbd8e416449bc156 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4c4649cba42731021037c4ced…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Fri Apr 7 16:44:48 2017 +0200 d3dx9/tests: Use float bit patterns in test_D3DXFloat_Array. Signed-off-by: Stefan Dösinger <stefan(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/tests/math.c | 90 +++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c index fbb6e27..d340005 100644 --- a/dlls/d3dx9_36/tests/math.c +++ b/dlls/d3dx9_36/tests/math.c @@ -2368,52 +2368,62 @@ static void test_D3DXVec_Array(void) static void test_D3DXFloat_Array(void) { - static const float z = 0.0f; - /* Compilers set different sign bits on 0.0 / 0.0, pick the right ones for NaN and -NaN */ - float tmpnan = 0.0f/z; - float nnan = copysignf(1, tmpnan) < 0.0f ? tmpnan : -tmpnan; - float nan = -nnan; unsigned int i; void *out = NULL; D3DXFLOAT16 half; FLOAT single; + + /* Input floats through bit patterns because compilers do not generate reliable INF and NaN values. */ + union convert + { + DWORD d; + FLOAT f; + }; + struct { - FLOAT single_in; + union convert single_in; /* half_ver2 occurs on WXPPROSP3 (32 bit math), WVISTAADM (32/64 bit math), W7PRO (32 bit math) */ WORD half_ver1, half_ver2; /* single_out_ver2 confirms that half -> single conversion is consistent across platforms */ - FLOAT single_out_ver1, single_out_ver2; - } testdata[] = { - { 80000.0f, 0x7c00, 0x7ce2, 65536.0f, 80000.0f }, - { 65503.0f, 0x7bff, 0x7bff, 65504.0f, 65504.0f }, - { 65504.0f, 0x7bff, 0x7bff, 65504.0f, 65504.0f }, - { 65520.0f, 0x7bff, 0x7c00, 65504.0f, 65536.0f }, - { 65521.0f, 0x7c00, 0x7c00, 65536.0f, 65536.0f }, - { 65534.0f, 0x7c00, 0x7c00, 65536.0f, 65536.0f }, - { 65535.0f, 0x7c00, 0x7c00, 65535.0f, 65536.0f }, - { 65536.0f, 0x7c00, 0x7c00, 65536.0f, 65536.0f }, - { -80000.0f, 0xfc00, 0xfce2, -65536.0f, -80000.0f }, - { -65503.0f, 0xfbff, 0xfbff, -65504.0f, -65504.0f }, - { -65504.0f, 0xfbff, 0xfbff, -65504.0f, -65504.0f }, - { -65520.0f, 0xfbff, 0xfc00, -65504.0f, -65536.0f }, - { -65521.0f, 0xfc00, 0xfc00, -65536.0f, -65536.0f }, - { -65534.0f, 0xfc00, 0xfc00, -65536.0f, -65536.0f }, - { -65535.0f, 0xfc00, 0xfc00, -65535.0f, -65536.0f }, - { -65536.0f, 0xfc00, 0xfc00, -65536.0f, -65536.0f }, - { 1.0f/z, 0x7c00, 0x7fff, 65536.0f, 131008.0f }, - { -1.0f/z, 0xffff, 0xffff, -131008.0f, -131008.0f }, - { nan, 0x7fff, 0xffff, 131008.0f, -131008.0f }, - { nnan, 0xffff, 0xffff, -131008.0f, -131008.0f }, - { 0.0f, 0x0, 0x0, 0.0f, 0.0f }, - { -0.0f, 0x8000, 0x8000, 0.0f, 0.0f }, - { 2.9809595e-08f, 0x0, 0x0, 0.0f, 0.0f }, - { -2.9809595e-08f, 0x8000, 0x8000, -0.0f, -0.0f }, - { 2.9809598e-08f, 0x1, 0x0, 5.96046e-08f, 5.96046e-08f }, - { -2.9809598e-08f, 0x8001, 0x8000, -5.96046e-08f, -5.96046e-08f }, - { 8.9406967e-08f, 0x2, 0x1, 1.19209e-07f, 5.96046e-008 } + union convert single_out_ver1, single_out_ver2; + } + testdata[] = + { + { { 0x479c4000 }, 0x7c00, 0x7ce2, { 0x47800000 }, { 0x479c4000 } }, /* 80000.0f */ + { { 0x477fdf00 }, 0x7bff, 0x7bff, { 0x477fe000 }, { 0x477fe000 } }, /* 65503.0f */ + { { 0x477fe000 }, 0x7bff, 0x7bff, { 0x477fe000 }, { 0x477fe000 } }, /* 65504.0f */ + { { 0x477ff000 }, 0x7bff, 0x7c00, { 0x477fe000 }, { 0x47800000 } }, /* 65520.0f */ + { { 0x477ff100 }, 0x7c00, 0x7c00, { 0x47800000 }, { 0x47800000 } }, /* 65521.0f */ + + { { 0x477ffe00 }, 0x7c00, 0x7c00, { 0x47800000 }, { 0x47800000 } }, /* 65534.0f */ + { { 0x477fff00 }, 0x7c00, 0x7c00, { 0x477fff00 }, { 0x47800000 } }, /* 65535.0f */ + { { 0x47800000 }, 0x7c00, 0x7c00, { 0x47800000 }, { 0x47800000 } }, /* 65536.0f */ + { { 0xc79c4000 }, 0xfc00, 0xfce2, { 0xc7800000 }, { 0xc79c4000 } }, /* -80000.0f */ + { { 0xc77fdf00 }, 0xfbff, 0xfbff, { 0xc77fe000 }, { 0xc77fe000 } }, /* -65503.0f */ + + { { 0xc77fe000 }, 0xfbff, 0xfbff, { 0xc77fe000 }, { 0xc77fe000 } }, /* -65504.0f */ + { { 0xc77ff000 }, 0xfbff, 0xfc00, { 0xc77fe000 }, { 0xc7800000 } }, /* -65520.0f */ + { { 0xc77ff100 }, 0xfc00, 0xfc00, { 0xc7800000 }, { 0xc7800000 } }, /* -65521.0f */ + { { 0xc77ffe00 }, 0xfc00, 0xfc00, { 0xc7800000 }, { 0xc7800000 } }, /* -65534.0f */ + { { 0xc77fff00 }, 0xfc00, 0xfc00, { 0xc77fff00 }, { 0xc7800000 } }, /* -65535.0f */ + + { { 0xc7800000 }, 0xfc00, 0xfc00, { 0xc7800000 }, { 0xc7800000 } }, /* -65536.0f */ + { { 0x7f800000 }, 0x7c00, 0x7fff, { 0x47800000 }, { 0x47ffe000 } }, /* INF */ + { { 0xff800000 }, 0xffff, 0xffff, { 0xc7ffe000 }, { 0xc7ffe000 } }, /* -INF */ + { { 0x7fc00000 }, 0x7fff, 0xffff, { 0x47ffe000 }, { 0xc7ffe000 } }, /* NaN */ + { { 0xffc00000 }, 0xffff, 0xffff, { 0xc7ffe000 }, { 0xc7ffe000 } }, /* -NaN */ + + { { 0x00000000 }, 0x0000, 0x0000, { 0x00000000 }, { 0x00000000 } }, /* 0.0f */ + { { 0x80000000 }, 0x8000, 0x8000, { 0x00000000 }, { 0x00000000 } }, /* -0.0f */ + { { 0x330007ff }, 0x0000, 0x0000, { 0x00000000 }, { 0x00000000 } }, /* 2.9809595e-08f */ + { { 0xb30007ff }, 0x8000, 0x8000, { 0x80000000 }, { 0x80000000 } }, /* -2.9809595e-08f */ + { { 0x33000800 }, 0x0001, 0x0000, { 0x337ffff3 }, { 0x337ffff3 } }, /* 2.9809598e-08f */ + + { { 0xb3000800 }, 0x8001, 0x8000, { 0xb37ffff3 } ,{ 0xb37ffff3 } }, /* -2.9809598e-08f */ + { { 0x33c00000 }, 0x0002, 0x0001, { 0x33ffffd7 }, { 0x337ffff3 } }, /* 8.9406967e-08f */ }; /* exception on NULL out or in parameter */ @@ -2425,7 +2435,7 @@ static void test_D3DXFloat_Array(void) for (i = 0; i < sizeof(testdata)/sizeof(testdata[0]); i++) { - out = D3DXFloat32To16Array(&half, &testdata[i].single_in, 1); + out = D3DXFloat32To16Array(&half, &testdata[i].single_in.f, 1); ok(out == &half, "Got %p, expected %p.\n", out, &half); ok(half.value == testdata[i].half_ver1 || half.value == testdata[i].half_ver2, "Got %x, expected %x or %x for index %d.\n", half.value, testdata[i].half_ver1, @@ -2433,13 +2443,13 @@ static void test_D3DXFloat_Array(void) out = D3DXFloat16To32Array(&single, (D3DXFLOAT16 *)&testdata[i].half_ver1, 1); ok(out == &single, "Got %p, expected %p.\n", out, &single); - ok(relative_error(single, testdata[i].single_out_ver1) < admitted_error, - "Got %g, expected %g for index %d.\n", single, testdata[i].single_out_ver1, i); + ok(relative_error(single, testdata[i].single_out_ver1.f) < admitted_error, + "Got %g, expected %g for index %d.\n", single, testdata[i].single_out_ver1.f, i); out = D3DXFloat16To32Array(&single, (D3DXFLOAT16 *)&testdata[i].half_ver2, 1); ok(out == &single, "Got %p, expected %p.\n", out, &single); - ok(relative_error(single, testdata[i].single_out_ver2) < admitted_error, - "Got %g, expected %g for index %d.\n", single, testdata[i].single_out_ver2, i); + ok(relative_error(single, testdata[i].single_out_ver2.f) < admitted_error, + "Got %g, expected %g for index %d.\n", single, testdata[i].single_out_ver2.f, i); } }
1
0
0
0
Nikolay Sivov : include: Update with recently added DirectWrite API.
by Alexandre Julliard
07 Apr '17
07 Apr '17
Module: wine Branch: master Commit: 61a1a266faa9fa7c959136b0ab0b5d7e01326878 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=61a1a266faa9fa7c959136b0a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Apr 7 18:37:19 2017 +0300 include: Update with recently added DirectWrite API. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/dwrite_3.idl | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/include/dwrite_3.idl b/include/dwrite_3.idl index afe7e84..b80d033 100644 --- a/include/dwrite_3.idl +++ b/include/dwrite_3.idl @@ -344,6 +344,16 @@ interface IDWriteFontSetBuilder : IUnknown [ local, object, + uuid(3ff7715f-3cdc-4dc6-9b72-ec5621dccafd) +] +interface IDWriteFontSetBuilder1 : IDWriteFontSetBuilder +{ + HRESULT AddFontFile(IDWriteFontFile *file); +} + +[ + local, + object, uuid(9a1b41c3-d3bb-466a-87fc-fe67556a3b65) ] interface IDWriteFactory3 : IDWriteFactory2 @@ -498,3 +508,97 @@ interface IDWriteFactory4 : IDWriteFactory3 DWRITE_MATRIX const *transform, D2D1_POINT_2F *origins); } + +[ + local, + object, + uuid(ce25f8fd-863b-4d13-9651-c1f88dc73fe2) +] +interface IDWriteAsyncResult : IUnknown +{ + HANDLE GetWaitHandle(); + HRESULT GetResult(); +} + +typedef struct DWRITE_FILE_FRAGMENT +{ + UINT64 fileOffset; + UINT64 fragmentSize; +} DWRITE_FILE_FRAGMENT; + +[ + local, + object, + uuid(4db3757a-2c72-4ed9-b2b6-1ababe1aff9c) +] +interface IDWriteRemoteFontFileStream : IDWriteFontFileStream +{ + HRESULT GetLocalFileSize(UINT64 *size); + HRESULT GetFileFragmentLocality(UINT64 offset, UINT64 size, BOOL *is_local, UINT64 *partial_size); + DWRITE_LOCALITY GetLocality(); + HRESULT BeginDownload( + GUID const *operation_id, + DWRITE_FILE_FRAGMENT const *fragments, + UINT32 fragment_count, + IDWriteAsyncResult **async_result); +} + +typedef enum DWRITE_CONTAINER_TYPE +{ + DWRITE_CONTAINER_TYPE_UNKNOWN, + DWRITE_CONTAINER_TYPE_WOFF, + DWRITE_CONTAINER_TYPE_WOFF2, +} DWRITE_CONTAINER_TYPE; + +[ + local, + object, + uuid(68648c83-6ede-46c0-ab46-20083a887fde) +] +interface IDWriteRemoteFontFileLoader : IDWriteFontFileLoader +{ + HRESULT CreateRemoteStreamFromKey(void const *key, UINT32 key_size, IDWriteRemoteFontFileStream **stream); + HRESULT GetLocalityFromKey(void const *key, UINT32 key_size, DWRITE_LOCALITY *locality); + HRESULT CreateFontFileReferenceFromUrl( + IDWriteFactory *factory, + WCHAR const *base_url, + WCHAR const *file_url, + IDWriteFontFile **fontfile); +} + +[ + local, + object, + uuid(dc102f47-a12d-4b1c-822d-9e117e33043f) +] +interface IDWriteInMemoryFontFileLoader : IDWriteFontFileLoader +{ + HRESULT CreateInMemoryFontFileReference( + IDWriteFactory *factory, + void const *data, + UINT32 data_size, + IUnknown *owner, + IDWriteFontFile **fontfile); + UINT32 GetFileCount(); +} + +[ + local, + object, + uuid(958db99a-be2a-4f09-af7d-65189803d1d3) +] +interface IDWriteFactory5 : IDWriteFactory4 +{ + HRESULT CreateFontSetBuilder(IDWriteFontSetBuilder1 **fontset_builder); + HRESULT CreateInMemoryFontFileLoader(IDWriteFontFileLoader **loader); + HRESULT CreateHttpFontFileLoader( + WCHAR const *referrer_url, + WCHAR const *extra_headers, + IDWriteRemoteFontFileLoader **loader); + DWRITE_CONTAINER_TYPE AnalyzeContainerType(void const *data, UINT32 data_size); + HRESULT UnpackFontFile( + DWRITE_CONTAINER_TYPE container_type, + void const *data, + UINT32 data_size, + IDWriteFontFileStream **stream); +}
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
76
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
Results per page:
10
25
50
100
200