winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2014
----- 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
503 discussions
Start a n
N
ew thread
Martin Storsjo : d3d9/tests: Add tests for different YUV texture layouts.
by Alexandre Julliard
17 Feb '14
17 Feb '14
Module: wine Branch: master Commit: 8b2938a23ef0f317d656a5acc13374f5613a4574 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b2938a23ef0f317d656a5acc…
Author: Martin Storsjo <martin(a)martin.st> Date: Mon Feb 17 14:46:02 2014 +0200 d3d9/tests: Add tests for different YUV texture layouts. --- dlls/d3d9/tests/visual.c | 184 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 13d0ea6..e107471 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -10508,6 +10508,189 @@ static void yuv_color_test(IDirect3DDevice9 *device) IDirect3D9_Release(d3d); } +static void yuv_layout_test(IDirect3DDevice9 *device) +{ + HRESULT hr; + IDirect3DSurface9 *surface, *target; + unsigned int fmt, i, x, y; + D3DFORMAT format; + const char *fmt_string; + D3DLOCKED_RECT lr; + IDirect3D9 *d3d; + D3DCOLOR color; + DWORD ref_color; + BYTE *buf, *chroma_buf, *u_buf, *v_buf; + UINT width = 20, height = 16; + D3DCAPS9 caps; + D3DFORMAT skip_once = D3DFMT_UNKNOWN; + D3DSURFACE_DESC desc; + + static const struct + { + DWORD color1, color2; + DWORD rgb1, rgb2; + } + test_data[] = + { + { 0x000000, 0xffffff, 0x00008800, 0x00ff7dff }, + { 0xff0000, 0x00ffff, 0x004aff14, 0x00b800ee }, + { 0x00ff00, 0xff00ff, 0x000024ee, 0x00ffe114 }, + { 0x0000ff, 0xffff00, 0x00b80000, 0x004affff }, + { 0xffff00, 0x0000ff, 0x004affff, 0x00b80000 }, + { 0xff00ff, 0x00ff00, 0x00ffe114, 0x000024ee }, + { 0x00ffff, 0xff0000, 0x00b800ee, 0x004aff14 }, + { 0xffffff, 0x000000, 0x00ff7dff, 0x00008800 }, + }; + + static const struct + { + D3DFORMAT format; + const char *str; + } + formats[] = + { + { D3DFMT_UYVY, "D3DFMT_UYVY", }, + { D3DFMT_YUY2, "D3DFMT_YUY2", }, + { MAKEFOURCC('Y','V','1','2'), "D3DFMT_YV12", }, + { MAKEFOURCC('N','V','1','2'), "D3DFMT_NV12", }, + }; + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "GetDeviceCaps failed, hr %#x.\n", hr); + if (caps.TextureCaps & D3DPTEXTURECAPS_POW2 + && !(caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL)) + { + skip("No NP2 texture support, skipping YUV texture layout test.\n"); + return; + } + + hr = IDirect3DDevice9_GetDirect3D(device, &d3d); + ok(hr == D3D_OK, "IDirect3DDevice9_GetDirect3D failed, hr = %#x.\n", hr); + hr = IDirect3DDevice9_GetRenderTarget(device, 0, &target); + ok(hr == D3D_OK, "IDirect3DDevice9_GetRenderTarget failed, hr = %#x.\n", hr); + hr = IDirect3DSurface9_GetDesc(target, &desc); + ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr); + + for (fmt = 0; fmt < sizeof(formats) / sizeof(formats[0]); fmt++) + { + format = formats[fmt].format; + fmt_string = formats[fmt].str; + + /* Some (all?) Windows drivers do not support YUV 3D textures, only 2D surfaces in + * StretchRect. Thus use StretchRect to draw the YUV surface onto the screen instead + * of drawPrimitive. */ + if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, + D3DRTYPE_SURFACE, format) != D3D_OK) + { + if (skip_once != format) + { + skip("%s is not supported.\n", fmt_string); + skip_once = format; + } + continue; + } + if (FAILED(IDirect3D9_CheckDeviceFormatConversion(d3d, 0, + D3DDEVTYPE_HAL, format, desc.Format))) + { + if (skip_once != format) + { + skip("Driver cannot blit %s surfaces.\n", fmt_string); + skip_once = format; + } + continue; + } + + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, width, height, format, D3DPOOL_DEFAULT, &surface, NULL); + ok(hr == D3D_OK, "IDirect3DDevice9_CreateOffscreenPlainSurface failed, hr = %#x.\n", hr); + + for (i = 0; i < sizeof(test_data) / sizeof(test_data[0]); i++) + { + hr = IDirect3DSurface9_LockRect(surface, &lr, NULL, 0); + ok(hr == D3D_OK, "IDirect3DSurface9_LockRect failed, hr = %#x.\n", hr); + buf = lr.pBits; + chroma_buf = buf + lr.Pitch * height; + if (format == MAKEFOURCC('Y','V','1','2')) + { + v_buf = chroma_buf; + u_buf = chroma_buf + height / 2 * lr.Pitch/2; + } + /* Draw the top left quarter of the screen with color1, the rest with color2 */ + for (y = 0; y < height; y++) + { + for (x = 0; x < width; x += 2) + { + DWORD color = (x < width / 2 && y < height / 2) ? test_data[i].color1 : test_data[i].color2; + BYTE Y = (color >> 16) & 0xff; + BYTE U = (color >> 8) & 0xff; + BYTE V = (color >> 0) & 0xff; + if (format == D3DFMT_UYVY) + { + buf[y * lr.Pitch + 2 * x + 0] = U; + buf[y * lr.Pitch + 2 * x + 1] = Y; + buf[y * lr.Pitch + 2 * x + 2] = V; + buf[y * lr.Pitch + 2 * x + 3] = Y; + } + else if (format == D3DFMT_YUY2) + { + buf[y * lr.Pitch + 2 * x + 0] = Y; + buf[y * lr.Pitch + 2 * x + 1] = U; + buf[y * lr.Pitch + 2 * x + 2] = Y; + buf[y * lr.Pitch + 2 * x + 3] = V; + } + else if (format == MAKEFOURCC('Y','V','1','2')) + { + buf[y * lr.Pitch + x + 0] = Y; + buf[y * lr.Pitch + x + 1] = Y; + u_buf[(y / 2) * (lr.Pitch / 2) + (x / 2)] = U; + v_buf[(y / 2) * (lr.Pitch / 2) + (x / 2)] = V; + } + else if (format == MAKEFOURCC('N','V','1','2')) + { + buf[y * lr.Pitch + x + 0] = Y; + buf[y * lr.Pitch + x + 1] = Y; + chroma_buf[(y / 2) * lr.Pitch + 2 * (x / 2) + 0] = U; + chroma_buf[(y / 2) * lr.Pitch + 2 * (x / 2) + 1] = V; + } + } + } + hr = IDirect3DSurface9_UnlockRect(surface); + ok(hr == D3D_OK, "IDirect3DSurface9_UnlockRect failed, hr = %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0); + ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %#x.\n", hr); + hr = IDirect3DDevice9_StretchRect(device, surface, NULL, target, NULL, D3DTEXF_POINT); + ok(hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %#x.\n", hr); + + /* Some Windows drivers (mostly Nvidia, but also some VM drivers) insist on doing linear filtering + * although we asked for point filtering. To prevent running into precision problems, read at points + * with some margin within each quadrant. + * + * Unfortunately different implementations(Windows-Nvidia and Mac-AMD tested) interpret some colors + * vastly differently, so we need a max diff of 18. */ + for (y = 0; y < 4; y++) + { + for (x = 0; x < 4; x++) + { + UINT xcoord = (1 + 2 * x) * 640 / 8; + UINT ycoord = (1 + 2 * y) * 480 / 8; + ref_color = (y < 2 && x < 2) ? test_data[i].rgb1 : test_data[i].rgb2; + color = getPixelColor(device, xcoord, ycoord); + ok(color_match(color, ref_color, 18), + "Format %s: Got color %#x for pixel (%d/%d)/(%d/%d), pixel %d %d, expected %#x.\n", + fmt_string, color, x, 4, y, 4, xcoord, ycoord, ref_color); + } + } + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + + ok(SUCCEEDED(hr), "Present failed with %#x.\n", hr); + } + IDirect3DSurface9_Release(surface); + } + + IDirect3DSurface9_Release(target); + IDirect3D9_Release(d3d); +} + static void texop_range_test(IDirect3DDevice9 *device) { static const struct { @@ -15197,6 +15380,7 @@ START_TEST(visual) tssargtemp_test(device_ptr); np2_stretch_rect_test(device_ptr); yuv_color_test(device_ptr); + yuv_layout_test(device_ptr); zwriteenable_test(device_ptr); alphatest_test(device_ptr); viewport_test(device_ptr);
1
0
0
0
Martin Storsjo : wined3d: Use an rbtree for storing shaders for texture format conversion/blitting.
by Alexandre Julliard
17 Feb '14
17 Feb '14
Module: wine Branch: master Commit: 12755257898e72cf47798b467a5467fef56eed9e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=12755257898e72cf47798b467…
Author: Martin Storsjo <martin(a)martin.st> Date: Mon Feb 17 14:46:01 2014 +0200 wined3d: Use an rbtree for storing shaders for texture format conversion/blitting. --- dlls/wined3d/arb_program_shader.c | 183 ++++++++++++++++++++++--------------- 1 file changed, 107 insertions(+), 76 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 93a6e31..d7e9ef7 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -6768,22 +6768,72 @@ const struct fragment_pipeline arbfp_fragment_pipeline = { arbfp_fragmentstate_template, }; -struct arbfp_blit_priv { - GLenum yuy2_rect_shader, yuy2_2d_shader; - GLenum uyvy_rect_shader, uyvy_2d_shader; - GLenum yv12_rect_shader, yv12_2d_shader; - GLenum nv12_rect_shader, nv12_2d_shader; - GLenum p8_rect_shader, p8_2d_shader; +struct arbfp_blit_type +{ + enum complex_fixup fixup; + GLenum textype; +}; + +struct arbfp_blit_desc +{ + GLenum shader; + struct arbfp_blit_type type; + struct wine_rb_entry entry; +}; + +struct arbfp_blit_priv +{ + struct wine_rb_tree shaders; GLuint palette_texture; }; +static int arbfp_blit_type_compare(const void *key, const struct wine_rb_entry *entry) +{ + const struct arbfp_blit_type *ka = key; + const struct arbfp_blit_type *kb = &WINE_RB_ENTRY_VALUE(entry, const struct arbfp_blit_desc, entry)->type; + + if (ka->fixup != kb->fixup) + return ka->fixup < kb->fixup ? -1 : 1; + if (ka->textype != kb->textype) + return ka->textype < kb->textype ? -1 : 1; + return 0; +} + +/* Context activation is done by the caller. */ +static void arbfp_free_blit_shader(struct wine_rb_entry *entry, void *context) +{ + const struct wined3d_gl_info *gl_info = context; + struct arbfp_blit_desc *entry_arb = WINE_RB_ENTRY_VALUE(entry, struct arbfp_blit_desc, entry); + + GL_EXTCALL(glDeleteProgramsARB(1, &entry_arb->shader)); + checkGLcall("glDeleteProgramsARB(1, &entry_arb->shader)"); + HeapFree(GetProcessHeap(), 0, entry_arb); +} + +const struct wine_rb_functions wined3d_arbfp_blit_rb_functions = +{ + wined3d_rb_alloc, + wined3d_rb_realloc, + wined3d_rb_free, + arbfp_blit_type_compare, +}; + static HRESULT arbfp_blit_alloc(struct wined3d_device *device) { - device->blit_priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct arbfp_blit_priv)); - if(!device->blit_priv) { - ERR("Out of memory\n"); + struct arbfp_blit_priv *priv; + + if (!(priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*priv)))) + return E_OUTOFMEMORY; + + if (wine_rb_init(&priv->shaders, &wined3d_arbfp_blit_rb_functions) == -1) + { + ERR("Failed to initialize rbtree.\n"); + HeapFree(GetProcessHeap(), 0, priv); return E_OUTOFMEMORY; } + + device->blit_priv = priv; + return WINED3D_OK; } @@ -6793,17 +6843,8 @@ static void arbfp_blit_free(struct wined3d_device *device) const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; struct arbfp_blit_priv *priv = device->blit_priv; - GL_EXTCALL(glDeleteProgramsARB(1, &priv->yuy2_rect_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->yuy2_2d_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->uyvy_rect_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->uyvy_2d_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->yv12_rect_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->yv12_2d_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->nv12_rect_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->nv12_2d_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->p8_rect_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->p8_2d_shader)); - checkGLcall("Delete yuv and p8 programs"); + wine_rb_destroy(&priv->shaders, arbfp_free_blit_shader, &device->adapter->gl_info); + checkGLcall("Delete blit programs"); if (priv->palette_texture) gl_info->gl_ops.gl.p_glDeleteTextures(1, &priv->palette_texture); @@ -7196,6 +7237,7 @@ static BOOL gen_nv12_read(struct wined3d_shader_buffer *buffer, GLenum textype, return TRUE; } +/* Context activation is done by the caller. */ static GLuint gen_p8_shader(struct arbfp_blit_priv *priv, const struct wined3d_gl_info *gl_info, GLenum textype) { @@ -7249,11 +7291,6 @@ static GLuint gen_p8_shader(struct arbfp_blit_priv *priv, shader_arb_dump_program_source(buffer.buffer); } - if (textype == GL_TEXTURE_RECTANGLE_ARB) - priv->p8_rect_shader = shader; - else - priv->p8_2d_shader = shader; - shader_buffer_free(&buffer); return shader; @@ -7428,33 +7465,6 @@ static GLuint gen_yuv_shader(struct arbfp_blit_priv *priv, const struct wined3d_ shader_buffer_free(&buffer); - switch (yuv_fixup) - { - case COMPLEX_FIXUP_YUY2: - if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->yuy2_rect_shader = shader; - else priv->yuy2_2d_shader = shader; - break; - - case COMPLEX_FIXUP_UYVY: - if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->uyvy_rect_shader = shader; - else priv->uyvy_2d_shader = shader; - break; - - case COMPLEX_FIXUP_YV12: - if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->yv12_rect_shader = shader; - else priv->yv12_2d_shader = shader; - break; - - case COMPLEX_FIXUP_NV12: - if (textype == GL_TEXTURE_RECTANGLE_ARB) - priv->nv12_rect_shader = shader; - else - priv->nv12_2d_shader = shader; - break; - default: - ERR("Unsupported complex fixup: %d\n", yuv_fixup); - } - return shader; } @@ -7467,6 +7477,9 @@ static HRESULT arbfp_blit_set(void *blit_priv, struct wined3d_context *context, enum complex_fixup fixup; const struct wined3d_gl_info *gl_info = context->gl_info; GLenum textype = surface->container->target; + struct wine_rb_entry *entry; + struct arbfp_blit_type type; + struct arbfp_blit_desc *desc; if (surface->flags & SFLAG_CONVERTED) { @@ -7487,39 +7500,57 @@ static HRESULT arbfp_blit_set(void *blit_priv, struct wined3d_context *context, fixup = get_complex_fixup(surface->resource.format->color_fixup); - switch(fixup) + type.fixup = fixup; + type.textype = textype; + entry = wine_rb_get(&priv->shaders, &type); + if (entry) { - case COMPLEX_FIXUP_YUY2: - shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->yuy2_rect_shader : priv->yuy2_2d_shader; - break; - - case COMPLEX_FIXUP_UYVY: - shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->uyvy_rect_shader : priv->uyvy_2d_shader; - break; - - case COMPLEX_FIXUP_YV12: - shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->yv12_rect_shader : priv->yv12_2d_shader; - break; - - case COMPLEX_FIXUP_NV12: - shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->nv12_rect_shader : priv->nv12_2d_shader; - break; - - case COMPLEX_FIXUP_P8: - shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->p8_rect_shader : priv->p8_2d_shader; - if (!shader) shader = gen_p8_shader(priv, gl_info, textype); + desc = WINE_RB_ENTRY_VALUE(entry, struct arbfp_blit_desc, entry); + shader = desc->shader; + } + else + { + switch (fixup) + { + case COMPLEX_FIXUP_P8: + shader = gen_p8_shader(priv, gl_info, textype); + break; - upload_palette(surface, context); - break; + default: + shader = gen_yuv_shader(priv, gl_info, fixup, textype); + break; + } - default: + if (!shader) + { FIXME("Unsupported complex fixup %#x, not setting a shader\n", fixup); gl_info->gl_ops.gl.p_glEnable(textype); checkGLcall("glEnable(textype)"); return E_NOTIMPL; + } + + desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc)); + if (!desc) + goto err_out; + + desc->type.textype = textype; + desc->type.fixup = fixup; + desc->shader = shader; + if (wine_rb_put(&priv->shaders, &desc->type, &desc->entry) == -1) + { +err_out: + ERR("Out of memory\n"); + GL_EXTCALL(glDeleteProgramsARB(1, &shader)); + checkGLcall("GL_EXTCALL(glDeleteProgramsARB(1, &shader))"); + GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0)); + checkGLcall("glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0)"); + HeapFree(GetProcessHeap(), 0, desc); + return E_OUTOFMEMORY; + } } - if (!shader) shader = gen_yuv_shader(priv, gl_info, fixup, textype); + if (fixup == COMPLEX_FIXUP_P8) + upload_palette(surface, context); gl_info->gl_ops.gl.p_glEnable(GL_FRAGMENT_PROGRAM_ARB); checkGLcall("glEnable(GL_FRAGMENT_PROGRAM_ARB)");
1
0
0
0
Martin Storsjo : wined3d: Add support for NV12 textures.
by Alexandre Julliard
17 Feb '14
17 Feb '14
Module: wine Branch: master Commit: 171529106bc61a8b4465fe5b343ee580d609576e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=171529106bc61a8b4465fe5b3…
Author: Martin Storsjo <martin(a)martin.st> Date: Mon Feb 17 14:46:00 2014 +0200 wined3d: Add support for NV12 textures. --- dlls/wined3d/arb_program_shader.c | 170 +++++++++++++++++++++++++++++++++++++ dlls/wined3d/utils.c | 13 +++ dlls/wined3d/wined3d_private.h | 1 + include/wine/wined3d.h | 1 + 4 files changed, 185 insertions(+) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=171529106bc61a8b4465f…
1
0
0
0
Stefan Dösinger : ddraw/tests: Port test_private_data to ddraw4.
by Alexandre Julliard
17 Feb '14
17 Feb '14
Module: wine Branch: master Commit: 9b8a35346291fc42f542ca3c0ea55f115d7544d8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9b8a35346291fc42f542ca3c0…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Feb 16 22:42:23 2014 +0100 ddraw/tests: Port test_private_data to ddraw4. --- dlls/ddraw/tests/ddraw4.c | 86 +++++++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw7.c | 86 +++++++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/dsurface.c | 73 ------------------------------------ 3 files changed, 172 insertions(+), 73 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=9b8a35346291fc42f542c…
1
0
0
0
Stefan Dösinger : d3d8/tests: Add a test for sub resource private data.
by Alexandre Julliard
17 Feb '14
17 Feb '14
Module: wine Branch: master Commit: 69c4f41646fce7c467dc542b59ca8550e06f99a5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=69c4f41646fce7c467dc542b5…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Feb 16 22:42:22 2014 +0100 d3d8/tests: Add a test for sub resource private data. --- dlls/d3d8/tests/device.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 78f6773..c7493c7 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -4148,13 +4148,15 @@ static void test_lockrect_invalid(void) static void test_private_data(void) { ULONG refcount, expected_refcount; - IDirect3DSurface8 *surface; + IDirect3DTexture8 *texture; + IDirect3DSurface8 *surface, *surface2; IDirect3DDevice8 *device; IDirect3D8 *d3d8; IUnknown *ptr; HWND window; HRESULT hr; DWORD size; + DWORD data[4] = {1, 2, 3, 4}; if (!(d3d8 = Direct3DCreate8(D3D_SDK_VERSION))) { @@ -4225,6 +4227,39 @@ static void test_private_data(void) refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + hr = IDirect3DDevice8_CreateTexture(device, 4, 4, 2, 0, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = IDirect3DTexture8_GetSurfaceLevel(texture, 0, &surface); + ok(SUCCEEDED(hr), "Failed to get texture level 0, hr %#x.\n", hr); + hr = IDirect3DTexture8_GetSurfaceLevel(texture, 1, &surface2); + ok(SUCCEEDED(hr), "Failed to get texture level 1, hr %#x.\n", hr); + + hr = IDirect3DTexture8_SetPrivateData(texture, &IID_IDirect3DVertexBuffer8, data, sizeof(data), 0); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + + memset(data, 0, sizeof(data)); + size = sizeof(data); + hr = IDirect3DSurface8_GetPrivateData(surface, &IID_IDirect3DVertexBuffer8, data, &size); + ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DTexture8_GetPrivateData(texture, &IID_IDirect3DVertexBuffer8, data, &size); + ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); + ok(data[0] == 1 && data[1] == 2 && data[2] == 3 && data[3] == 4, + "Got unexpected private data: %u, %u, %u, %u.\n", data[0], data[1], data[2], data[3]); + + hr = IDirect3DTexture8_FreePrivateData(texture, &IID_IDirect3DVertexBuffer8); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + + hr = IDirect3DSurface8_SetPrivateData(surface, &IID_IDirect3DVertexBuffer8, data, sizeof(data), 0); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + hr = IDirect3DSurface8_GetPrivateData(surface2, &IID_IDirect3DVertexBuffer8, data, &size); + ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DSurface8_FreePrivateData(surface, &IID_IDirect3DVertexBuffer8); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + + IDirect3DSurface8_Release(surface2); + IDirect3DSurface8_Release(surface); + IDirect3DTexture8_Release(texture); + refcount = IDirect3DDevice8_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); IDirect3D8_Release(d3d8);
1
0
0
0
Stefan Dösinger : d3d9/tests: Add a test for sub resource private data.
by Alexandre Julliard
17 Feb '14
17 Feb '14
Module: wine Branch: master Commit: 442446cdc860ec6c409e2429e330a5058d22118a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=442446cdc860ec6c409e2429e…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Feb 16 22:42:21 2014 +0100 d3d9/tests: Add a test for sub resource private data. --- dlls/d3d9/tests/device.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 4f94c3b..b046099 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -5411,13 +5411,15 @@ static void test_lockrect_invalid(void) static void test_private_data(void) { ULONG refcount, expected_refcount; - IDirect3DSurface9 *surface; + IDirect3DTexture9 *texture; + IDirect3DSurface9 *surface, *surface2; IDirect3DDevice9 *device; IDirect3D9 *d3d; IUnknown *ptr; HWND window; HRESULT hr; DWORD size; + DWORD data[4] = {1, 2, 3, 4}; if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION))) { @@ -5489,6 +5491,40 @@ static void test_private_data(void) refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 2, 0, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, + &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface); + ok(SUCCEEDED(hr), "Failed to get texture level 0, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 1, &surface2); + ok(SUCCEEDED(hr), "Failed to get texture level 1, hr %#x.\n", hr); + + hr = IDirect3DTexture9_SetPrivateData(texture, &IID_IDirect3DVertexBuffer9, data, sizeof(data), 0); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + + memset(data, 0, sizeof(data)); + size = sizeof(data); + hr = IDirect3DSurface9_GetPrivateData(surface, &IID_IDirect3DVertexBuffer9, data, &size); + ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DTexture9_GetPrivateData(texture, &IID_IDirect3DVertexBuffer9, data, &size); + ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); + ok(data[0] == 1 && data[1] == 2 && data[2] == 3 && data[3] == 4, + "Got unexpected private data: %u, %u, %u, %u.\n", data[0], data[1], data[2], data[3]); + + hr = IDirect3DTexture9_FreePrivateData(texture, &IID_IDirect3DVertexBuffer9); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + + hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DVertexBuffer9, data, sizeof(data), 0); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + hr = IDirect3DSurface9_GetPrivateData(surface2, &IID_IDirect3DVertexBuffer9, data, &size); + ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DSurface9_FreePrivateData(surface, &IID_IDirect3DVertexBuffer9); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + + IDirect3DSurface9_Release(surface2); + IDirect3DSurface9_Release(surface); + IDirect3DTexture9_Release(texture); + refcount = IDirect3DDevice9_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); IDirect3D9_Release(d3d);
1
0
0
0
Stefan Dösinger : d3d9/tests: Skip YUV tests if the formats cannot be converted.
by Alexandre Julliard
17 Feb '14
17 Feb '14
Module: wine Branch: master Commit: 6745982aaa712b9054411cf54ec08b7d1aac8303 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6745982aaa712b9054411cf54…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Feb 16 22:42:20 2014 +0100 d3d9/tests: Skip YUV tests if the formats cannot be converted. The Windows 8 testbot supports some YUV formats as plain surfaces, but cannot convert them to RGB in StretchRect. --- dlls/d3d9/tests/visual.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 89f02b9..13d0ea6 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -10382,6 +10382,7 @@ static void yuv_color_test(IDirect3DDevice9 *device) IDirect3D9 *d3d; D3DCOLOR color; D3DFORMAT skip_once = D3DFMT_UNKNOWN; + D3DSURFACE_DESC desc; static const struct { @@ -10435,6 +10436,8 @@ static void yuv_color_test(IDirect3DDevice9 *device) ok(SUCCEEDED(hr), "Failed to get d3d9 interface, hr %#x.\n", hr); hr = IDirect3DDevice9_GetRenderTarget(device, 0, &target); ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + hr = IDirect3DSurface9_GetDesc(target, &desc); + ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr); for (i = 0; i < sizeof(test_data) / sizeof(test_data[0]); i++) { @@ -10450,6 +10453,16 @@ static void yuv_color_test(IDirect3DDevice9 *device) } continue; } + if (FAILED(IDirect3D9_CheckDeviceFormatConversion(d3d, 0, + D3DDEVTYPE_HAL, test_data[i].format, desc.Format))) + { + if (skip_once != test_data[i].format) + { + skip("Driver cannot blit %s surfaces.\n", test_data[i].fmt_string); + skip_once = test_data[i].format; + } + continue; + } /* A pixel is effectively 16 bit large, but two pixels are stored together, so the minimum size is 2x1. * However, Nvidia Windows drivers have problems with 2x1 YUY2/UYVY surfaces, so use a 4x1 surface and
1
0
0
0
Stefan Dösinger : d3d9/tests: Clean up yuv_color_test.
by Alexandre Julliard
17 Feb '14
17 Feb '14
Module: wine Branch: master Commit: 35223d80cb538787c69b2382a034b7210e6bac25 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=35223d80cb538787c69b2382a…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Feb 16 22:42:19 2014 +0100 d3d9/tests: Clean up yuv_color_test. --- dlls/d3d9/tests/visual.c | 196 +++++++++++++++++++++++----------------------- 1 file changed, 97 insertions(+), 99 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=35223d80cb538787c69b2…
1
0
0
0
Matteo Bruni : d3dx9: Handle pixel formats larger than 32 bits in surface loading / filtering functions.
by Alexandre Julliard
17 Feb '14
17 Feb '14
Module: wine Branch: master Commit: 950c40b1170598d0c7fd6b7545a7e8308e158a32 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=950c40b1170598d0c7fd6b754…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Fri Feb 14 17:36:38 2014 +0100 d3dx9: Handle pixel formats larger than 32 bits in surface loading / filtering functions. --- dlls/d3dx9_36/d3dx9_36_private.h | 1 + dlls/d3dx9_36/math.c | 2 +- dlls/d3dx9_36/surface.c | 196 +++++++++++++++++++------------------- 3 files changed, 101 insertions(+), 98 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=950c40b1170598d0c7fd6…
1
0
0
0
Matteo Bruni : d3dx9: Add missing trace to D3DXLoadVolumeFromFileInMemory.
by Alexandre Julliard
17 Feb '14
17 Feb '14
Module: wine Branch: master Commit: 73e4f6200e9a79e284849ac25cfe468c1fdaf913 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=73e4f6200e9a79e284849ac25…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Fri Feb 14 15:53:12 2014 +0100 d3dx9: Add missing trace to D3DXLoadVolumeFromFileInMemory. --- dlls/d3dx9_36/volume.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/d3dx9_36/volume.c b/dlls/d3dx9_36/volume.c index 6ba758f..52683da 100644 --- a/dlls/d3dx9_36/volume.c +++ b/dlls/d3dx9_36/volume.c @@ -238,6 +238,10 @@ HRESULT WINAPI D3DXLoadVolumeFromFileInMemory(IDirect3DVolume9 *dst_volume, D3DBOX box; D3DXIMAGE_INFO image_info; + TRACE("dst_volume %p, dst_palette %p, dst_box %p, src_data %p, src_data_size %u, src_box %p,\n", + dst_volume, dst_palette, dst_box, src_data, src_data_size, src_box); + TRACE("filter %#x, color_key %#x, src_info %p.\n", filter, color_key, src_info); + if (!dst_volume || !src_data) return D3DERR_INVALIDCALL; hr = D3DXGetImageInfoFromFileInMemory(src_data, src_data_size, &image_info);
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
51
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
Results per page:
10
25
50
100
200