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
June 2020
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
947 discussions
Start a n
N
ew thread
Jeff Smith : d3drm/tests: Test IDirect3DRM_CreateLight().
by Alexandre Julliard
16 Jun '20
16 Jun '20
Module: wine Branch: master Commit: 0132054999bca4eee5580611eff08aae322061d6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0132054999bca4eee5580611…
Author: Jeff Smith <whydoubt(a)gmail.com> Date: Tue Jun 16 22:47:38 2020 +0430 d3drm/tests: Test IDirect3DRM_CreateLight(). Signed-off-by: Jeff Smith <whydoubt(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3drm/tests/d3drm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 87ad50a39d..d854ebcc56 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -2601,6 +2601,17 @@ static void test_Light(void) IDirect3DRMLight_Release(light); + hr = IDirect3DRM_CreateLight(d3drm, D3DRMLIGHT_SPOT, 0x00c0c0c0, &light); + ok(hr == D3DRM_OK, "Got unexpected hr %#x.\n", hr); + + type = IDirect3DRMLight_GetType(light); + ok(type == D3DRMLIGHT_SPOT, "Got unexpected type %#x.\n", type); + + color = IDirect3DRMLight_GetColor(light); + ok(color == 0xffc0c0c0, "Got unexpected color 0x%08x.\n", color); + + IDirect3DRMLight_Release(light); + IDirect3DRM_Release(d3drm); }
1
0
0
0
Jeff Smith : d3drm: Set light alpha to 1.0 in d3drm_light_SetColor().
by Alexandre Julliard
16 Jun '20
16 Jun '20
Module: wine Branch: master Commit: 12be3c43bd21601c7352ac985bc75828f6e2972d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=12be3c43bd21601c7352ac98…
Author: Jeff Smith <whydoubt(a)gmail.com> Date: Tue Jun 16 22:47:37 2020 +0430 d3drm: Set light alpha to 1.0 in d3drm_light_SetColor(). Signed-off-by: Jeff Smith <whydoubt(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3drm/light.c | 2 +- dlls/d3drm/tests/d3drm.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/d3drm/light.c b/dlls/d3drm/light.c index 2f53f200aa..675dcaa0b5 100644 --- a/dlls/d3drm/light.c +++ b/dlls/d3drm/light.c @@ -165,7 +165,7 @@ static HRESULT WINAPI d3drm_light_SetColor(IDirect3DRMLight *iface, D3DCOLOR col TRACE("iface %p, color 0x%08x.\n", iface, color); - light->color = color; + light->color = 0xff000000 | color; return D3DRM_OK; } diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 25e9b4e0ac..87ad50a39d 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -2589,6 +2589,11 @@ static void test_Light(void) color = IDirect3DRMLight_GetColor(light); ok(color == 0xff180587, "wrong color (%x)\n", color); + hr = IDirect3DRMLight_SetColor(light, 0x00c0c0c0); + ok(hr == D3DRM_OK, "Got unexpected hr %#x.\n", hr); + color = IDirect3DRMLight_GetColor(light); + ok(color == 0xffc0c0c0, "Got unexpected color 0x%08x.\n", color); + hr = IDirect3DRMLight_SetColorRGB(light, 0.5, 0.5, 0.5); ok(hr == D3DRM_OK, "Cannot set color (hr = %x)\n", hr); color = IDirect3DRMLight_GetColor(light);
1
0
0
0
Henri Verbeet : wined3d: Get rid of the special format handling in wined3d_check_depth_stencil_format().
by Alexandre Julliard
16 Jun '20
16 Jun '20
Module: wine Branch: master Commit: 08013374965b9169ed812bc1fb4d63c6991a76b2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=08013374965b9169ed812bc1…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Jun 16 22:47:36 2020 +0430 wined3d: Get rid of the special format handling in wined3d_check_depth_stencil_format(). By simply removing WINED3DFMT_FLAG_DEPTH_STENCIL from WINED3DFMT_S1_UINT_D15_UNORM and WINED3DFMT_S4X4_UINT_D24_UNORM. That's also the only way these formats could be used by GL, so this allows us to remove them from format_texture_info[] completely. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/directx.c | 8 ------- dlls/wined3d/utils.c | 62 -------------------------------------------------- 2 files changed, 70 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index efae3444ee..456cb9ad12 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1506,14 +1506,6 @@ static BOOL wined3d_check_depth_stencil_format(const struct wined3d_adapter *ada if (!ds_format->depth_size && !ds_format->stencil_size) return FALSE; - /* Blacklist formats not supported on Windows */ - if (ds_format->id == WINED3DFMT_S1_UINT_D15_UNORM /* Breaks the shadowvol2 dx7 sdk sample */ - || ds_format->id == WINED3DFMT_S4X4_UINT_D24_UNORM) - { - TRACE("Format %s is blacklisted.\n", debug_d3dformat(ds_format->id)); - return FALSE; - } - return adapter->adapter_ops->adapter_check_format(adapter, adapter_format, NULL, ds_format); } diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 2a3c04f435..da17ee7296 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -1007,52 +1007,6 @@ static void convert_r32g32_float(const BYTE *src, BYTE *dst, UINT src_row_pitch, } } -static void convert_s1_uint_d15_unorm(const BYTE *src, BYTE *dst, UINT src_row_pitch, UINT src_slice_pitch, - UINT dst_row_pitch, UINT dst_slice_pitch, UINT width, UINT height, UINT depth) -{ - unsigned int x, y, z; - - for (z = 0; z < depth; z++) - { - for (y = 0; y < height; ++y) - { - const WORD *source = (const WORD *)(src + z * src_slice_pitch + y * src_row_pitch); - DWORD *dest = (DWORD *)(dst + z * dst_slice_pitch + y * dst_row_pitch); - - for (x = 0; x < width; ++x) - { - /* The depth data is normalized, so needs to be scaled, - * the stencil data isn't. Scale depth data by - * (2^24-1)/(2^15-1) ~~ (2^9 + 2^-6). */ - WORD d15 = source[x] >> 1; - DWORD d24 = (d15 << 9) + (d15 >> 6); - dest[x] = (d24 << 8) | (source[x] & 0x1); - } - } - } -} - -static void convert_s4x4_uint_d24_unorm(const BYTE *src, BYTE *dst, UINT src_row_pitch, UINT src_slice_pitch, - UINT dst_row_pitch, UINT dst_slice_pitch, UINT width, UINT height, UINT depth) -{ - unsigned int x, y, z; - - for (z = 0; z < depth; z++) - { - for (y = 0; y < height; ++y) - { - const DWORD *source = (const DWORD *)(src + z * src_slice_pitch + y * src_row_pitch); - DWORD *dest = (DWORD *)(dst + z * dst_slice_pitch + y * dst_row_pitch); - - for (x = 0; x < width; ++x) - { - /* Just need to clear out the X4 part. */ - dest[x] = source[x] & ~0xf0; - } - } - } -} - static void convert_s8_uint_d24_float(const BYTE *src, BYTE *dst, UINT src_row_pitch, UINT src_slice_pitch, UINT dst_row_pitch, UINT dst_slice_pitch, UINT width, UINT height, UINT depth) { @@ -1791,14 +1745,6 @@ static const struct wined3d_format_texture_info format_texture_info[] = GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, ARB_DEPTH_TEXTURE, NULL}, - {WINED3DFMT_S1_UINT_D15_UNORM, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, 0, - GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, - ARB_DEPTH_TEXTURE, NULL}, - {WINED3DFMT_S1_UINT_D15_UNORM, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0, - GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 4, - WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, - EXT_PACKED_DEPTH_STENCIL, convert_s1_uint_d15_unorm}, {WINED3DFMT_D24_UNORM_S8_UINT, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING @@ -1818,14 +1764,6 @@ static const struct wined3d_format_texture_info format_texture_info[] = WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, ARB_DEPTH_TEXTURE, x8_d24_unorm_upload, x8_d24_unorm_download}, - {WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0, - WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, - ARB_DEPTH_TEXTURE, NULL}, - {WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0, - GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 4, - WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, - EXT_PACKED_DEPTH_STENCIL, convert_s4x4_uint_d24_unorm}, {WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, WINED3DFMT_FLAG_DEPTH_STENCIL,
1
0
0
0
Henri Verbeet : wined3d: Get rid of WINED3D_QUIRK_SET_TEXCOORD_W.
by Alexandre Julliard
16 Jun '20
16 Jun '20
Module: wine Branch: master Commit: a4cedbe86d168407fe70796246c4cf336b4e42fa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a4cedbe86d168407fe707962…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Jun 16 22:47:35 2020 +0430 wined3d: Get rid of WINED3D_QUIRK_SET_TEXCOORD_W. This quirk only affects fixed-function fragment processing, which hasn't been a supported configuration on the affected hardware for a while now. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/adapter_gl.c | 51 --------------------------------------- dlls/wined3d/arb_program_shader.c | 13 ---------- dlls/wined3d/wined3d_private.h | 1 - 3 files changed, 65 deletions(-) diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 0c7f953702..a97e7bd7a4 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -525,23 +525,6 @@ static void test_pbo_functionality(struct wined3d_gl_info *gl_info) } } -static BOOL match_apple_intel(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, - const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, - enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device) -{ - return (card_vendor == HW_VENDOR_INTEL) && (gl_vendor == GL_VENDOR_APPLE); -} - -static BOOL match_apple_nonr500ati(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, - const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, - enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device) -{ - if (gl_vendor != GL_VENDOR_APPLE) return FALSE; - if (card_vendor != HW_VENDOR_AMD) return FALSE; - if (device == CARD_AMD_RADEON_X1600) return FALSE; - return TRUE; -} - static BOOL match_dx10_capable(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device) @@ -948,30 +931,6 @@ static void quirk_no_np2(struct wined3d_gl_info *gl_info) gl_info->supported[ARB_TEXTURE_RECTANGLE] = TRUE; } -static void quirk_texcoord_w(struct wined3d_gl_info *gl_info) -{ - /* The Intel GPUs on macOS set the .w register of texcoords to 0.0 by - * default, which causes problems with fixed-function fragment processing. - * Ideally this flag should be detected with a test shader and OpenGL - * feedback mode, but some OpenGL implementations (macOS ATI at least, - * probably all macOS ones) do not like vertex shaders in feedback mode - * and return an error, even though it should be valid according to the - * spec. - * - * We don't want to enable this on all cards, as it adds an extra - * instruction per texcoord used. This makes the shader slower and eats - * instruction slots which should be available to the Direct3D - * application. - * - * ATI Radeon HD 2xxx cards on macOS have the issue. Instead of checking - * for the buggy cards, blacklist all Radeon cards on macOS and whitelist - * the good ones. That way we're prepared for the future. If this - * workaround is activated on cards that do not need it, it won't break - * things, just affect performance negatively. */ - TRACE("Enabling vertex texture coord fixes in vertex shaders.\n"); - gl_info->quirks |= WINED3D_QUIRK_SET_TEXCOORD_W; -} - static void quirk_clip_varying(struct wined3d_gl_info *gl_info) { gl_info->quirks |= WINED3D_QUIRK_GLSL_CLIP_VARYING; @@ -1105,16 +1064,6 @@ static void fixup_extensions(struct wined3d_gl_info *gl_info, struct wined3d_cap quirk_no_np2, "Geforce 5 NP2 disable" }, - { - match_apple_intel, - quirk_texcoord_w, - "Init texcoord .w for Apple Intel GPU driver" - }, - { - match_apple_nonr500ati, - quirk_texcoord_w, - "Init texcoord .w for Apple ATI >= r600 GPU driver" - }, { match_dx10_capable, quirk_clip_varying, diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 4724e5c959..af8f2a508f 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -332,7 +332,6 @@ static BOOL need_helper_const(const struct arb_vshader_private *shader_data, if (need_rel_addr_const(shader_data, reg_maps, gl_info)) return TRUE; if (!gl_info->supported[NV_VERTEX_PROGRAM]) return TRUE; /* Need to init colors. */ if (gl_info->quirks & WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT) return TRUE; /* Load the immval offset. */ - if (gl_info->quirks & WINED3D_QUIRK_SET_TEXCOORD_W) return TRUE; /* Have to init texcoords. */ if (!use_nv_clip(gl_info)) return TRUE; /* Init the clip texcoord */ if (reg_maps->usesnrm) return TRUE; /* 0.0 */ if (reg_maps->usespow) return TRUE; /* EPS, 0.0 and 1.0 */ @@ -4106,7 +4105,6 @@ static GLuint shader_arb_generate_vshader(const struct wined3d_shader *shader, { const struct arb_vshader_private *shader_data = shader->backend_data; const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps; - struct shader_arb_priv *priv = shader->device->shader_priv; GLuint ret; DWORD next_local = 0; struct shader_arb_ctx_priv priv_ctx; @@ -4201,17 +4199,6 @@ static GLuint shader_arb_generate_vshader(const struct wined3d_shader *shader, { const char *color_init = arb_get_helper_value(WINED3D_SHADER_TYPE_VERTEX, ARB_0001); shader_addline(buffer, "MOV result.color.secondary, %s;\n", color_init); - - if (gl_info->quirks & WINED3D_QUIRK_SET_TEXCOORD_W && !priv->ffp_proj_control) - { - int i; - const char *one = arb_get_helper_value(WINED3D_SHADER_TYPE_VERTEX, ARB_ONE); - for(i = 0; i < MAX_REG_TEXCRD; i++) - { - if (reg_maps->u.texcoord_mask[i] && reg_maps->u.texcoord_mask[i] != WINED3DSP_WRITEMASK_ALL) - shader_addline(buffer, "MOV result.texcoord[%u].w, %s\n", i, one); - } - } } /* The shader starts with the main function */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 9556f8c0ab..7a91a35400 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -64,7 +64,6 @@ /* Driver quirks */ #define WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT 0x00000001 -#define WINED3D_QUIRK_SET_TEXCOORD_W 0x00000002 #define WINED3D_QUIRK_GLSL_CLIP_VARYING 0x00000004 #define WINED3D_QUIRK_ALLOWS_SPECULAR_ALPHA 0x00000008 #define WINED3D_QUIRK_NV_CLIP_BROKEN 0x00000010
1
0
0
0
Paul Gofman : ddraw: Update texture_memory when setting new texture parent in ddraw_surface7_Flip().
by Alexandre Julliard
16 Jun '20
16 Jun '20
Module: wine Branch: master Commit: 422e05d84436092b4648153bacce8cc9ddc1d6c6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=422e05d84436092b4648153b…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jun 16 19:20:29 2020 +0300 ddraw: Update texture_memory when setting new texture parent in ddraw_surface7_Flip(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49391
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/surface.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index ba56fad964..6d64e8f217 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -1288,11 +1288,12 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7 { struct ddraw_surface *dst_impl = impl_from_IDirectDrawSurface7(iface); struct ddraw_surface *src_impl = unsafe_impl_from_IDirectDrawSurface7(src); + struct ddraw_texture *dst_ddraw_texture, *src_ddraw_texture; struct wined3d_rendertarget_view *tmp_rtv, *src_rtv, *rtv; - struct ddraw_texture *ddraw_texture, *prev_ddraw_texture; DDSCAPS2 caps = {DDSCAPS_FLIP, 0, 0, {0}}; struct wined3d_texture *texture; IDirectDrawSurface7 *current; + void *texture_memory; HRESULT hr; TRACE("iface %p, src %p, flags %#x.\n", iface, src, flags); @@ -1318,7 +1319,8 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7 ERR("Invalid sub-resource index %u on surface %p.\n", dst_impl->sub_resource_idx, dst_impl); texture = dst_impl->wined3d_texture; rtv = wined3d_device_get_rendertarget_view(dst_impl->ddraw->wined3d_device, 0); - ddraw_texture = wined3d_texture_get_parent(dst_impl->wined3d_texture); + dst_ddraw_texture = wined3d_texture_get_parent(dst_impl->wined3d_texture); + texture_memory = dst_ddraw_texture->texture_memory; if (src_impl) { @@ -1345,12 +1347,13 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7 wined3d_rendertarget_view_set_parent(src_rtv, dst_impl); dst_impl->wined3d_rtv = src_rtv; wined3d_texture_set_sub_resource_parent(src_impl->wined3d_texture, 0, dst_impl); - prev_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture); - wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), ddraw_texture); + src_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture); + dst_ddraw_texture->texture_memory = src_ddraw_texture->texture_memory; + wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), dst_ddraw_texture); + dst_ddraw_texture = src_ddraw_texture; if (src_impl->sub_resource_idx) ERR("Invalid sub-resource index %u on surface %p.\n", src_impl->sub_resource_idx, src_impl); dst_impl->wined3d_texture = src_impl->wined3d_texture; - ddraw_texture = prev_ddraw_texture; } else { @@ -1376,9 +1379,10 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7 wined3d_rendertarget_view_set_parent(src_rtv, dst_impl); dst_impl->wined3d_rtv = src_rtv; wined3d_texture_set_sub_resource_parent(src_impl->wined3d_texture, 0, dst_impl); - prev_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture); - wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), ddraw_texture); - ddraw_texture = prev_ddraw_texture; + src_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture); + dst_ddraw_texture->texture_memory = src_ddraw_texture->texture_memory; + wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), dst_ddraw_texture); + dst_ddraw_texture = src_ddraw_texture; if (src_impl->sub_resource_idx) ERR("Invalid sub-resource index %u on surface %p.\n", src_impl->sub_resource_idx, src_impl); dst_impl->wined3d_texture = src_impl->wined3d_texture; @@ -1393,7 +1397,8 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7 wined3d_rendertarget_view_set_parent(tmp_rtv, src_impl); src_impl->wined3d_rtv = tmp_rtv; wined3d_texture_set_sub_resource_parent(texture, 0, src_impl); - wined3d_resource_set_parent(wined3d_texture_get_resource(texture), ddraw_texture); + dst_ddraw_texture->texture_memory = texture_memory; + wined3d_resource_set_parent(wined3d_texture_get_resource(texture), dst_ddraw_texture); src_impl->wined3d_texture = texture; if (flags & ~(DDFLIP_NOVSYNC | DDFLIP_INTERVAL2 | DDFLIP_INTERVAL3 | DDFLIP_INTERVAL4))
1
0
0
0
Paul Gofman : wined3d: Merge _USER_MEMORY and _SYSMEM locations.
by Alexandre Julliard
16 Jun '20
16 Jun '20
Module: wine Branch: master Commit: 5b287bb0ca813eba988e6550453b7fc4501b4f1f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5b287bb0ca813eba988e6550…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jun 16 16:38:46 2020 +0300 wined3d: Merge _USER_MEMORY and _SYSMEM locations. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49375
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/surface.c | 3 +- dlls/wined3d/texture.c | 72 ++++++++++++++---------------------------- dlls/wined3d/utils.c | 1 - dlls/wined3d/wined3d_private.h | 1 - 4 files changed, 25 insertions(+), 52 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 652f6070b9..af2ab36d27 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -33,8 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); -static const DWORD surface_simple_locations = WINED3D_LOCATION_SYSMEM - | WINED3D_LOCATION_USER_MEMORY | WINED3D_LOCATION_BUFFER; +static const DWORD surface_simple_locations = WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_BUFFER; /* Works correctly only for <= 4 bpp formats. */ static void get_color_masks(const struct wined3d_format *format, DWORD *masks) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 84020f17c9..b1e08383f6 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -30,8 +30,7 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag); #define WINED3D_TEXTURE_DYNAMIC_MAP_THRESHOLD 50 -static const uint32_t wined3d_texture_sysmem_locations = WINED3D_LOCATION_SYSMEM - | WINED3D_LOCATION_USER_MEMORY | WINED3D_LOCATION_BUFFER; +static const uint32_t wined3d_texture_sysmem_locations = WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_BUFFER; static const struct wined3d_texture_ops texture_gl_ops; struct wined3d_texture_idx @@ -132,7 +131,6 @@ static DWORD wined3d_resource_access_from_location(DWORD location) return 0; case WINED3D_LOCATION_SYSMEM: - case WINED3D_LOCATION_USER_MEMORY: return WINED3D_RESOURCE_ACCESS_CPU; case WINED3D_LOCATION_BUFFER: @@ -733,16 +731,18 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su data->buffer_object = (uintptr_t)&sub_resource->bo; return; } - if (locations & WINED3D_LOCATION_USER_MEMORY) - { - data->addr = texture->user_memory; - data->buffer_object = 0; - return; - } + if (locations & WINED3D_LOCATION_SYSMEM) { - data->addr = texture->resource.heap_memory; - data->addr += sub_resource->offset; + if (texture->user_memory) + { + data->addr = texture->user_memory; + } + else + { + data->addr = texture->resource.heap_memory; + data->addr += sub_resource->offset; + } data->buffer_object = 0; return; } @@ -1741,7 +1741,6 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT unsigned int resource_size; const struct wined3d *d3d; unsigned int slice_pitch; - DWORD valid_location = 0; bool update_memory_only; bool create_dib = false; @@ -1872,16 +1871,10 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT } } - if ((texture->user_memory = mem)) - { - texture->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; - valid_location = WINED3D_LOCATION_USER_MEMORY; - } - else + if (!(texture->user_memory = mem)) { if (!wined3d_resource_prepare_sysmem(&texture->resource)) ERR("Failed to allocate resource memory.\n"); - valid_location = WINED3D_LOCATION_SYSMEM; } /* The format might be changed to a format that needs conversion. @@ -1891,8 +1884,8 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER && !wined3d_texture_use_pbo(texture, gl_info)) texture->resource.map_binding = WINED3D_LOCATION_SYSMEM; - wined3d_texture_validate_location(texture, 0, valid_location); - wined3d_texture_invalidate_location(texture, 0, ~valid_location); + wined3d_texture_validate_location(texture, 0, WINED3D_LOCATION_SYSMEM); + wined3d_texture_invalidate_location(texture, 0, ~WINED3D_LOCATION_SYSMEM); if (create_dib) { @@ -3123,12 +3116,8 @@ static BOOL wined3d_texture_gl_prepare_location(struct wined3d_texture *texture, switch (location) { case WINED3D_LOCATION_SYSMEM: - return wined3d_resource_prepare_sysmem(&texture->resource); - - case WINED3D_LOCATION_USER_MEMORY: - if (!texture->user_memory) - ERR("Preparing WINED3D_LOCATION_USER_MEMORY, but texture->user_memory is NULL.\n"); - return TRUE; + return texture->user_memory ? TRUE + : wined3d_resource_prepare_sysmem(&texture->resource); case WINED3D_LOCATION_BUFFER: wined3d_texture_prepare_buffer_object(texture, sub_resource_idx, context_gl->gl_info); @@ -3176,7 +3165,6 @@ static BOOL wined3d_texture_gl_load_location(struct wined3d_texture *texture, switch (location) { - case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: return wined3d_texture_gl_load_sysmem(texture_gl, sub_resource_idx, context_gl, location); @@ -4431,20 +4419,12 @@ static void wined3d_texture_no3d_download_data(struct wined3d_context *context, static BOOL wined3d_texture_no3d_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, unsigned int location) { - switch (location) - { - case WINED3D_LOCATION_SYSMEM: - return wined3d_resource_prepare_sysmem(&texture->resource); - - case WINED3D_LOCATION_USER_MEMORY: - if (!texture->user_memory) - ERR("Preparing WINED3D_LOCATION_USER_MEMORY, but texture->user_memory is NULL.\n"); - return TRUE; + if (location == WINED3D_LOCATION_SYSMEM) + return texture->user_memory ? TRUE + : wined3d_resource_prepare_sysmem(&texture->resource); - default: - FIXME("Unhandled location %s.\n", wined3d_debug_location(location)); - return FALSE; - } + FIXME("Unhandled location %s.\n", wined3d_debug_location(location)); + return FALSE; } static BOOL wined3d_texture_no3d_load_location(struct wined3d_texture *texture, @@ -4453,7 +4433,7 @@ static BOOL wined3d_texture_no3d_load_location(struct wined3d_texture *texture, TRACE("texture %p, sub_resource_idx %u, context %p, location %s.\n", texture, sub_resource_idx, context, wined3d_debug_location(location)); - if (location == WINED3D_LOCATION_USER_MEMORY || location == WINED3D_LOCATION_SYSMEM) + if (location == WINED3D_LOCATION_SYSMEM) return TRUE; ERR("Unhandled location %s.\n", wined3d_debug_location(location)); @@ -5078,12 +5058,8 @@ static BOOL wined3d_texture_vk_prepare_location(struct wined3d_texture *texture, switch (location) { case WINED3D_LOCATION_SYSMEM: - return wined3d_resource_prepare_sysmem(&texture->resource); - - case WINED3D_LOCATION_USER_MEMORY: - if (!texture->user_memory) - ERR("Preparing WINED3D_LOCATION_USER_MEMORY, but texture->user_memory is NULL.\n"); - return TRUE; + return texture->user_memory ? TRUE + : wined3d_resource_prepare_sysmem(&texture->resource); case WINED3D_LOCATION_TEXTURE_RGB: return wined3d_texture_vk_prepare_texture(wined3d_texture_vk(texture), wined3d_context_vk(context)); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index d078c503df..2a3c04f435 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -6643,7 +6643,6 @@ const char *wined3d_debug_location(DWORD location) #define LOCATION_TO_STR(x) if (location & x) { debug_append(&buffer, #x, " | "); location &= ~x; } LOCATION_TO_STR(WINED3D_LOCATION_DISCARDED); LOCATION_TO_STR(WINED3D_LOCATION_SYSMEM); - LOCATION_TO_STR(WINED3D_LOCATION_USER_MEMORY); LOCATION_TO_STR(WINED3D_LOCATION_BUFFER); LOCATION_TO_STR(WINED3D_LOCATION_TEXTURE_RGB); LOCATION_TO_STR(WINED3D_LOCATION_TEXTURE_SRGB); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 17acd4be4d..9556f8c0ab 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3988,7 +3988,6 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DEC #define WINED3D_LOCATION_DISCARDED 0x00000001 #define WINED3D_LOCATION_SYSMEM 0x00000002 -#define WINED3D_LOCATION_USER_MEMORY 0x00000004 #define WINED3D_LOCATION_BUFFER 0x00000008 #define WINED3D_LOCATION_TEXTURE_RGB 0x00000010 #define WINED3D_LOCATION_TEXTURE_SRGB 0x00000020
1
0
0
0
Nikolay Sivov : dwrite: Add missing script tags.
by Alexandre Julliard
16 Jun '20
16 Jun '20
Module: wine Branch: master Commit: 0a0872910bb0e0f02a70598222c8a81093e32a18 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0a0872910bb0e0f02a705982…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jun 16 17:28:59 2020 +0300 dwrite: Add missing script tags. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/analyzer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index f3eca12f96..f11388628e 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -194,10 +194,10 @@ static const struct dwritescript_properties dwritescripts_properties[Script_Last { /* Medf */ { 0x6664654d, 265, 8, 0x0020, 0, 1, 1, 0, 0, 0, 0 }, { _OT('m','e','d','f') } }, { /* Sogo */ { 0x6f676f53, 142, 8, 0x0020, 1, 1, 1, 0, 0, 0, 0 }, { _OT('s','o','g','o') } }, { /* Sogd */ { 0x64676f53, 141, 8, 0x0020, 1, 1, 0, 0, 0, 1, 1 }, { _OT('s','o','g','d') } }, - { /* Elym */ { 0x6d796c45, 128, 1, 0x0020, 0, 0, 1, 0, 0, 0, 0 } }, - { /* Hmnp */ { 0x706e6d48, 451, 8, 0x0020, 1, 1, 0, 0, 0, 0, 0 } }, - { /* Nand */ { 0x646e614e, 311, 8, 0x0020, 1, 1, 0, 0, 0, 1, 0 } }, - { /* Wcho */ { 0x6f686357, 283, 8, 0x0020, 1, 1, 0, 0, 0, 0, 0 } }, + { /* Elym */ { 0x6d796c45, 128, 1, 0x0020, 0, 0, 1, 0, 0, 0, 0 }, { _OT('e','l','y','m') } }, + { /* Hmnp */ { 0x706e6d48, 451, 8, 0x0020, 1, 1, 0, 0, 0, 0, 0 }, { _OT('h','m','n','p') } }, + { /* Nand */ { 0x646e614e, 311, 8, 0x0020, 1, 1, 0, 0, 0, 1, 0 }, { _OT('n','a','n','d') } }, + { /* Wcho */ { 0x6f686357, 283, 8, 0x0020, 1, 1, 0, 0, 0, 0, 0 }, { _OT('w','c','h','o') } }, }; #undef _OT
1
0
0
0
Nikolay Sivov : dwrite: Use mark array helper in mark to mark attachment handler.
by Alexandre Julliard
16 Jun '20
16 Jun '20
Module: wine Branch: master Commit: 122cac563d2ac85c975161b75d6b43ffb9df8837 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=122cac563d2ac85c975161b7…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jun 16 14:56:42 2020 +0300 dwrite: Use mark array helper in mark to mark attachment handler. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/opentype.c | 51 +++++++------------------------------------------- 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index bc87df5913..05ef7d76cd 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -4295,30 +4295,15 @@ static BOOL opentype_layout_apply_gpos_mark_to_mark_attachment(struct scriptshap if (format == 1) { - const struct ot_gpos_mark_to_mark_format1 *format1 = table_read_ensure(table, subtable_offset, sizeof(*format1)); - unsigned int count, mark1_array_offset, mark2_array_offset, mark_class_count; - unsigned int mark1_index, mark2_index, mark2_anchor; - const struct ot_gpos_mark_array *mark1_array; - const struct ot_gpos_base_array *mark2_array; - float mark1_x, mark1_y, mark2_x, mark2_y; + const struct ot_gpos_mark_to_mark_format1 *format1; + unsigned int mark1_index, mark2_index; struct glyph_iterator mark_iter; - if (!format1) - return FALSE; + if (!(format1 = table_read_ensure(table, subtable_offset, sizeof(*format1)))) return FALSE; mark1_index = opentype_layout_is_glyph_covered(table, subtable_offset + GET_BE_WORD(format1->mark1_coverage), context->u.pos.glyphs[context->cur]); - - mark1_array_offset = subtable_offset + GET_BE_WORD(format1->mark1_array); - if (!(count = table_read_be_word(table, mark1_array_offset))) - return FALSE; - - mark1_array = table_read_ensure(table, mark1_array_offset, FIELD_OFFSET(struct ot_gpos_mark_array, records[count])); - if (!mark1_array) - return FALSE; - - if (mark1_index == GLYPH_NOT_COVERED || mark1_index >= count) - return FALSE; + if (mark1_index == GLYPH_NOT_COVERED) return FALSE; glyph_iterator_init(context, lookup->flags & ~LOOKUP_FLAG_IGNORE_MASK, context->cur, 1, &mark_iter); if (!glyph_iterator_prev(&mark_iter)) @@ -4327,34 +4312,12 @@ static BOOL opentype_layout_apply_gpos_mark_to_mark_attachment(struct scriptshap if (!context->u.pos.glyph_props[mark_iter.pos].isDiacritic) return FALSE; - mark2_array_offset = subtable_offset + GET_BE_WORD(format1->mark2_array); - if (!(count = table_read_be_word(table, mark2_array_offset))) - return FALSE; - - mark_class_count = GET_BE_WORD(format1->mark_class_count); - - mark2_array = table_read_ensure(table, mark2_array_offset, - FIELD_OFFSET(struct ot_gpos_base_array, offsets[count * mark_class_count])); - if (!mark2_array) - return FALSE; - mark2_index = opentype_layout_is_glyph_covered(table, subtable_offset + GET_BE_WORD(format1->mark2_coverage), context->u.pos.glyphs[mark_iter.pos]); + if (mark2_index == GLYPH_NOT_COVERED) return FALSE; - if (mark2_index == GLYPH_NOT_COVERED || mark2_index >= count) - return FALSE; - - mark2_anchor = GET_BE_WORD(mark2_array->offsets[mark2_index * mark_class_count + - GET_BE_WORD(mark1_array->records[mark1_index].mark_class)]); - opentype_layout_gpos_get_anchor(context, mark1_array_offset + - GET_BE_WORD(mark1_array->records[mark1_index].mark_anchor), context->cur, &mark1_x, &mark1_y); - opentype_layout_gpos_get_anchor(context, mark2_array_offset + mark2_anchor, mark_iter.pos, - &mark2_x, &mark2_y); - - context->offsets[context->cur].advanceOffset = mark2_x - mark1_x; - context->offsets[context->cur].ascenderOffset = mark2_y - mark1_y; - - context->cur++; + return opentype_layout_apply_mark_array(context, subtable_offset, GET_BE_WORD(format1->mark1_array), mark1_index, + mark2_index, GET_BE_WORD(format1->mark2_array), GET_BE_WORD(format1->mark_class_count), mark_iter.pos); } else {
1
0
0
0
Nikolay Sivov : dwrite: Use mark array helper in mark to base attachment handler.
by Alexandre Julliard
16 Jun '20
16 Jun '20
Module: wine Branch: master Commit: 81d8a0980b8d9f53fea1c3e4bb57c686adce62bf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=81d8a0980b8d9f53fea1c3e4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jun 16 14:56:41 2020 +0300 dwrite: Use mark array helper in mark to base attachment handler. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/opentype.c | 49 ++++++------------------------------------------- 1 file changed, 6 insertions(+), 43 deletions(-) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index 61dcf1aca4..bc87df5913 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -4190,42 +4190,15 @@ static BOOL opentype_layout_apply_gpos_mark_to_base_attachment(struct scriptshap if (format == 1) { - const struct ot_gpos_mark_to_base_format1 *format1 = table_read_ensure(table, subtable_offset, sizeof(*format1)); - unsigned int mark_class_count, count, mark_array_offset, base_array_offset; - const struct ot_gpos_mark_array *mark_array; - const struct ot_gpos_base_array *base_array; - float mark_x, mark_y, base_x, base_y; + const struct ot_gpos_mark_to_base_format1 *format1; unsigned int base_index, mark_index; struct glyph_iterator base_iter; - unsigned int base_anchor; - if (!format1) - return FALSE; - - mark_array_offset = subtable_offset + GET_BE_WORD(format1->mark_array); - if (!(count = table_read_be_word(table, mark_array_offset))) - return FALSE; - - mark_array = table_read_ensure(table, mark_array_offset, FIELD_OFFSET(struct ot_gpos_mark_array, records[count])); - if (!mark_array) - return FALSE; - - base_array_offset = subtable_offset + GET_BE_WORD(format1->base_array); - if (!(count = table_read_be_word(table, base_array_offset))) - return FALSE; - - base_array = table_read_ensure(table, base_array_offset, - FIELD_OFFSET(struct ot_gpos_base_array, offsets[count * GET_BE_WORD(format1->mark_class_count)])); - if (!base_array) - return FALSE; - - mark_class_count = GET_BE_WORD(format1->mark_class_count); + if (!(format1 = table_read_ensure(table, subtable_offset, sizeof(*format1)))) return FALSE; mark_index = opentype_layout_is_glyph_covered(table, subtable_offset + GET_BE_WORD(format1->mark_coverage), context->u.pos.glyphs[context->cur]); - - if (mark_index == GLYPH_NOT_COVERED || mark_index >= GET_BE_WORD(mark_array->count)) - return FALSE; + if (mark_index == GLYPH_NOT_COVERED) return FALSE; /* Look back for first base glyph. */ glyph_iterator_init(context, LOOKUP_FLAG_IGNORE_MARKS, context->cur, 1, &base_iter); @@ -4234,20 +4207,10 @@ static BOOL opentype_layout_apply_gpos_mark_to_base_attachment(struct scriptshap base_index = opentype_layout_is_glyph_covered(table, subtable_offset + GET_BE_WORD(format1->base_coverage), context->u.pos.glyphs[base_iter.pos]); - if (base_index == GLYPH_NOT_COVERED || base_index >= GET_BE_WORD(base_array->count)) - return FALSE; + if (base_index == GLYPH_NOT_COVERED) return FALSE; - base_anchor = GET_BE_WORD(base_array->offsets[base_index * mark_class_count + - GET_BE_WORD(mark_array->records[mark_index].mark_class)]); - - opentype_layout_gpos_get_anchor(context, mark_array_offset + - GET_BE_WORD(mark_array->records[mark_index].mark_anchor), context->cur, &mark_x, &mark_y); - opentype_layout_gpos_get_anchor(context, base_array_offset + base_anchor, base_iter.pos, &base_x, &base_y); - - context->offsets[context->cur].advanceOffset = (context->is_rtl ? -1.0f : 1.0f) * (base_x - mark_x); - context->offsets[context->cur].ascenderOffset = base_y - mark_y; - - context->cur++; + return opentype_layout_apply_mark_array(context, subtable_offset, GET_BE_WORD(format1->mark_array), mark_index, + base_index, GET_BE_WORD(format1->base_array), GET_BE_WORD(format1->mark_class_count), base_iter.pos); } else {
1
0
0
0
Nikolay Sivov : dwrite: Implement mark to ligature attachment (GPOS lookup 5).
by Alexandre Julliard
16 Jun '20
16 Jun '20
Module: wine Branch: master Commit: 240305660ab2c33043dfb451b5a05c5a16119d49 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=240305660ab2c33043dfb451…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jun 16 14:56:40 2020 +0300 dwrite: Implement mark to ligature attachment (GPOS lookup 5). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/opentype.c | 88 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 79 insertions(+), 9 deletions(-) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index d7099b8adf..61dcf1aca4 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -4135,6 +4135,51 @@ static BOOL opentype_layout_apply_gpos_cursive_attachment(struct scriptshaping_c return TRUE; } +static BOOL opentype_layout_apply_mark_array(struct scriptshaping_context *context, unsigned int subtable_offset, + unsigned int mark_array, unsigned int mark_index, unsigned int glyph_index, unsigned int anchors_matrix, + unsigned int class_count, unsigned int glyph_pos) +{ + const struct dwrite_fonttable *table = &context->table->table; + unsigned int mark_class, mark_count, glyph_count; + const struct ot_gpos_mark_record *record; + float mark_x, mark_y, base_x, base_y; + const UINT16 *anchors; + + mark_count = table_read_be_word(table, subtable_offset + mark_array); + if (mark_index >= mark_count) return FALSE; + + if (!(record = table_read_ensure(table, subtable_offset + mark_array + + FIELD_OFFSET(struct ot_gpos_mark_array, records[mark_index]), sizeof(*record)))) + { + return FALSE; + } + + mark_class = GET_BE_WORD(record->mark_class); + if (mark_class >= class_count) return FALSE; + + glyph_count = table_read_be_word(table, subtable_offset + anchors_matrix); + if (glyph_index >= glyph_count) return FALSE; + + /* Anchors data is stored as two dimensional array [glyph_count][class_count], starting with row count field. */ + anchors = table_read_ensure(table, subtable_offset + anchors_matrix + 2, glyph_count * class_count * sizeof(*anchors)); + if (!anchors) return FALSE; + + opentype_layout_gpos_get_anchor(context, subtable_offset + mark_array + GET_BE_WORD(record->mark_anchor), + context->cur, &mark_x, &mark_y); + opentype_layout_gpos_get_anchor(context, subtable_offset + anchors_matrix + + GET_BE_WORD(anchors[glyph_index * class_count + mark_class]), glyph_pos, &base_x, &base_y); + + if (context->is_rtl) + context->offsets[context->cur].advanceOffset = mark_x - base_x; + else + context->offsets[context->cur].advanceOffset = -context->advances[glyph_pos] + base_x - mark_x; + + context->offsets[context->cur].ascenderOffset = base_y - mark_y; + context->cur++; + + return TRUE; +} + static BOOL opentype_layout_apply_gpos_mark_to_base_attachment(struct scriptshaping_context *context, const struct lookup *lookup, unsigned int subtable_offset) { @@ -4213,6 +4258,18 @@ static BOOL opentype_layout_apply_gpos_mark_to_base_attachment(struct scriptshap return TRUE; } +static BOOL table_read_array_be_word(const struct dwrite_fonttable *table, unsigned int offset, + unsigned int index, UINT16 *data) +{ + unsigned int count = table_read_be_word(table, offset); + const UINT16 *array; + + if (index >= count) return FALSE; + if (!(array = table_read_ensure(table, offset + 2, count * sizeof(*array)))) return FALSE; + *data = GET_BE_WORD(array[index]); + return TRUE; +} + static BOOL opentype_layout_apply_gpos_mark_to_lig_attachment(struct scriptshaping_context *context, const struct lookup *lookup, unsigned int subtable_offset) { @@ -4223,17 +4280,17 @@ static BOOL opentype_layout_apply_gpos_mark_to_lig_attachment(struct scriptshapi if (format == 1) { - const struct ot_gpos_mark_to_lig_format1 *format1 = table_read_ensure(table, subtable_offset, sizeof(*format1)); - unsigned int mark_index, lig_index; + unsigned int mark_index, lig_index, comp_index, class_count, comp_count; + const struct ot_gpos_mark_to_lig_format1 *format1; struct glyph_iterator lig_iter; + unsigned int lig_array; + UINT16 lig_attach; - if (!format1) - return FALSE; + if (!(format1 = table_read_ensure(table, subtable_offset, sizeof(*format1)))) return FALSE; mark_index = opentype_layout_is_glyph_covered(table, subtable_offset + GET_BE_WORD(format1->mark_coverage), context->u.pos.glyphs[context->cur]); - if (mark_index == GLYPH_NOT_COVERED) - return FALSE; + if (mark_index == GLYPH_NOT_COVERED) return FALSE; glyph_iterator_init(context, LOOKUP_FLAG_IGNORE_MARKS, context->cur, 1, &lig_iter); if (!glyph_iterator_prev(&lig_iter)) @@ -4241,10 +4298,23 @@ static BOOL opentype_layout_apply_gpos_mark_to_lig_attachment(struct scriptshapi lig_index = opentype_layout_is_glyph_covered(table, subtable_offset + GET_BE_WORD(format1->lig_coverage), context->u.pos.glyphs[lig_iter.pos]); - if (lig_index == GLYPH_NOT_COVERED) - return FALSE; + if (lig_index == GLYPH_NOT_COVERED) return FALSE; + + class_count = GET_BE_WORD(format1->mark_class_count); + + lig_array = GET_BE_WORD(format1->lig_array); + + if (!table_read_array_be_word(table, subtable_offset + lig_array, lig_index, &lig_attach)) return FALSE; + + comp_count = table_read_be_word(table, subtable_offset + lig_array + lig_attach); + if (!comp_count) return FALSE; + + comp_index = context->u.buffer.glyph_props[lig_iter.pos].components - + context->u.buffer.glyph_props[context->cur].lig_component - 1; + if (comp_index >= comp_count) return FALSE; - FIXME("Unimplemented.\n"); + return opentype_layout_apply_mark_array(context, subtable_offset, GET_BE_WORD(format1->mark_array), mark_index, + comp_index, lig_array + lig_attach, class_count, lig_iter.pos); } else WARN("Unknown mark-to-ligature format %u.\n", format);
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
95
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Results per page:
10
25
50
100
200