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
May 2024
----- 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
705 discussions
Start a n
N
ew thread
Connor McAdams : d3dx9: Fix destination rectangles passed from D3DXLoadSurfaceFromMemory() to d3dx_load_image_from_memory().
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: f9676836d672903b0ec07ec5d9d98e4f9fe047fa URL:
https://gitlab.winehq.org/wine/wine/-/commit/f9676836d672903b0ec07ec5d9d98e…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Thu Apr 25 12:27:16 2024 -0400 d3dx9: Fix destination rectangles passed from D3DXLoadSurfaceFromMemory() to d3dx_load_image_from_memory(). d3dx_load_image_from_memory() expects the address of the dst_memory argument to represent the top left corner of the surface. If a surface is locked using a rectangle that doesn't start at the top left corner of the surface, the rectangle we pass to d3dx_load_image_from_memory() needs to be adjusted so that it properly represents the locked area. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/d3dx9_36/surface.c | 10 +++++++--- dlls/d3dx9_36/tests/surface.c | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index c3d341e216d..ef6cd57c7da 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -2116,8 +2116,8 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, D3DFORMAT src_format, UINT src_pitch, const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key) { + RECT dst_rect_temp, dst_rect_aligned, dst_locked_rect, dst_locked_rect_aligned; const struct pixel_format_desc *srcformatdesc, *destformatdesc; - RECT dst_rect_temp, dst_rect_aligned; IDirect3DSurface9 *surface; D3DSURFACE_DESC surfdesc; D3DLOCKED_RECT lockrect; @@ -2192,8 +2192,12 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, if (FAILED(hr = lock_surface(dst_surface, &dst_rect_aligned, &lockrect, &surface, TRUE))) return hr; - hr = d3dx_load_image_from_memory(lockrect.pBits, lockrect.Pitch, destformatdesc, dst_palette, dst_rect, - &dst_rect_aligned, src_memory, src_pitch, srcformatdesc, src_palette, src_rect, filter, color_key); + dst_locked_rect_aligned = dst_rect_aligned; + dst_locked_rect = *dst_rect; + OffsetRect(&dst_locked_rect_aligned, -dst_rect_aligned.left, -dst_rect_aligned.top); + OffsetRect(&dst_locked_rect, -dst_rect_aligned.left, -dst_rect_aligned.top); + hr = d3dx_load_image_from_memory(lockrect.pBits, lockrect.Pitch, destformatdesc, dst_palette, &dst_locked_rect, + &dst_locked_rect_aligned, src_memory, src_pitch, srcformatdesc, src_palette, src_rect, filter, color_key); if (FAILED(hr)) WARN("d3dx_load_image_from_memory failed with hr %#lx\n", hr); diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 2a4bc5c1652..3c88eec5dcb 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -1697,7 +1697,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device) * Bottom left of green block, should still be black from prior * operation. */ - check_readback_pixel_4bpp(&surface_rb, 4, 3, 0xff000000, TRUE); + check_readback_pixel_4bpp(&surface_rb, 4, 3, 0xff000000, FALSE); release_surface_readback(&surface_rb);
1
0
0
0
Connor McAdams : d3dx9: Only do direct copies of full blocks for compressed formats.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: e6f79a8059400cd92ec58cee03d6b89865a056ff URL:
https://gitlab.winehq.org/wine/wine/-/commit/e6f79a8059400cd92ec58cee03d6b8…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Thu Apr 25 12:22:00 2024 -0400 d3dx9: Only do direct copies of full blocks for compressed formats. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/d3dx9_36/surface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index bbeba9c8b23..c3d341e216d 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -1969,8 +1969,8 @@ static HRESULT d3dx_load_image_from_memory(void *dst_memory, uint32_t dst_row_pi /* Everything matches, simply copy the pixels. */ if (src_desc->format == dst_desc->format - && dst_size.width == src_size.width - && dst_size.height == src_size.height + && (dst_size.width == src_size.width && !(dst_size.width % dst_desc->block_width)) + && (dst_size.height == src_size.height && !(dst_size.height % dst_desc->block_height)) && color_key == 0 && !(src_rect->left & (src_desc->block_width - 1)) && !(src_rect->top & (src_desc->block_height - 1))
1
0
0
0
Connor McAdams : d3dx9/tests: Add a new compressed surface loading test.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 7ebd102886aaa423e4a10cb2d9694e122eb06f4a URL:
https://gitlab.winehq.org/wine/wine/-/commit/7ebd102886aaa423e4a10cb2d9694e…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Thu Apr 25 12:19:14 2024 -0400 d3dx9/tests: Add a new compressed surface loading test. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/d3dx9_36/tests/surface.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index feabd0f465b..2a4bc5c1652 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -1680,6 +1680,27 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device) release_surface_readback(&surface_rb); + /* + * Our source and destination rectangles start on aligned + * boundaries, but the size is not the entire block. + */ + SetRect(&rect, 4, 0, 6, 2); + SetRect(&destrect, 4, 0, 6, 2); + hr = D3DXLoadSurfaceFromMemory(newsurf, NULL, &destrect, dxt5_8_8, + D3DFMT_DXT5, 16 * 2, NULL, &rect, D3DX_FILTER_NONE, 0); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + get_surface_decompressed_readback(device, newsurf, &surface_rb); + + check_readback_pixel_4bpp(&surface_rb, 4, 0, 0xff00ff00, FALSE); /* Green block, top left. */ + /* + * Bottom left of green block, should still be black from prior + * operation. + */ + check_readback_pixel_4bpp(&surface_rb, 4, 3, 0xff000000, TRUE); + + release_surface_readback(&surface_rb); + check_release((IUnknown *)newsurf, 1); check_release((IUnknown *)tex, 0); }
1
0
0
0
Connor McAdams : d3dx9/tests: Add a test for negative values in the source rectangle passed to D3DXLoadSurfaceFromMemory.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: c04d5622accc3f0f30e9255e297a95a743c49e18 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c04d5622accc3f0f30e9255e297a95…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Thu Apr 25 11:36:10 2024 -0400 d3dx9/tests: Add a test for negative values in the source rectangle passed to D3DXLoadSurfaceFromMemory. This behavior is mentioned in the wine code documentation comment for this function as being allowed, but the behavior is not tested. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/d3dx9_36/tests/surface.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 036326c56cf..feabd0f465b 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -1173,6 +1173,24 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device) IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY); check_pixel_4bpp(&lockrect, 0, 0, 0x8dc32bf6); IDirect3DSurface9_UnlockRect(surf); + + /* + * Test negative offsets in the source rectangle. Causes an access + * violation when run on 64-bit Windows. + */ + if (sizeof(void *) != 8) + { + SetRect(&rect, 0, -1, 1, 0); + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, &pixdata_a8b8g8r8[2], + D3DFMT_A8R8G8B8, 8, NULL, &rect, D3DX_FILTER_NONE, 0); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY); + check_pixel_4bpp(&lockrect, 0, 0, pixdata_a8b8g8r8[0]); + IDirect3DSurface9_UnlockRect(surf); + } + else + skip("Skipping test for negative source rectangle values on 64-bit.\n"); + check_release((IUnknown *)surf, 0); /* test color conversion */
1
0
0
0
Elizabeth Figura : wined3d: Remove the redundant "pow2_width" and "pow2_height" fields.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 5160533b42fe57b14c941bb46c684c216442a399 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5160533b42fe57b14c941bb46c684c…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Wed Mar 20 16:05:50 2024 -0500 wined3d: Remove the redundant "pow2_width" and "pow2_height" fields. --- dlls/wined3d/context_gl.c | 8 ++++---- dlls/wined3d/glsl_shader.c | 4 ++-- dlls/wined3d/texture.c | 44 ++++++++++++++++++------------------------ dlls/wined3d/view.c | 4 ++-- dlls/wined3d/wined3d_private.h | 14 -------------- 5 files changed, 27 insertions(+), 47 deletions(-)
1
0
0
0
Elizabeth Figura : wined3d: Collapse together NPOT d3d_info flags.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: dcb0136cc064af3f0d09862da42707bf09031d3c URL:
https://gitlab.winehq.org/wine/wine/-/commit/dcb0136cc064af3f0d09862da42707…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Wed Mar 20 16:00:47 2024 -0500 wined3d: Collapse together NPOT d3d_info flags. --- dlls/wined3d/adapter_gl.c | 8 +++----- dlls/wined3d/adapter_vk.c | 4 +--- dlls/wined3d/directx.c | 10 +++------- dlls/wined3d/stateblock.c | 2 +- dlls/wined3d/texture.c | 2 +- dlls/wined3d/wined3d_private.h | 6 +++--- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 2ff75eb0788..59c85df5a9a 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4298,7 +4298,7 @@ static void adapter_gl_get_wined3d_caps(const struct wined3d_adapter *adapter, s { caps->TextureCaps |= WINED3DPTEXTURECAPS_VOLUMEMAP | WINED3DPTEXTURECAPS_MIPVOLUMEMAP; - if (!d3d_info->texture_npot) + if (!d3d_info->unconditional_npot) caps->TextureCaps |= WINED3DPTEXTURECAPS_VOLUMEMAP_POW2; caps->VolumeTextureFilterCaps |= WINED3DPTFILTERCAPS_MAGFLINEAR @@ -4338,7 +4338,7 @@ static void adapter_gl_get_wined3d_caps(const struct wined3d_adapter *adapter, s { caps->TextureCaps |= WINED3DPTEXTURECAPS_CUBEMAP | WINED3DPTEXTURECAPS_MIPCUBEMAP; - if (!d3d_info->texture_npot) + if (!d3d_info->unconditional_npot) caps->TextureCaps |= WINED3DPTEXTURECAPS_CUBEMAP_POW2; caps->CubeTextureFilterCaps |= WINED3DPTFILTERCAPS_MAGFLINEAR @@ -5045,9 +5045,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_ d3d_info->shader_output_interpolation = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION); d3d_info->viewport_array_index_any_shader = !!gl_info->supported[ARB_SHADER_VIEWPORT_LAYER_ARRAY]; d3d_info->stencil_export = !!gl_info->supported[ARB_SHADER_STENCIL_EXPORT]; - d3d_info->texture_npot = !!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]; - d3d_info->texture_npot_conditional = gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT]; - d3d_info->normalized_texrect = gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT]; + d3d_info->unconditional_npot = !!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]; d3d_info->draw_base_vertex_offset = !!gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]; d3d_info->vertex_bgra = !!gl_info->supported[ARB_VERTEX_ARRAY_BGRA]; d3d_info->texture_swizzle = !!gl_info->supported[ARB_TEXTURE_SWIZZLE]; diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 39b263872ed..10c62c3b7ca 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -2356,9 +2356,7 @@ static void wined3d_adapter_vk_init_d3d_info(struct wined3d_adapter_vk *adapter_ d3d_info->shader_output_interpolation = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION); d3d_info->viewport_array_index_any_shader = false; /* VK_EXT_shader_viewport_index_layer */ d3d_info->stencil_export = vk_info->supported[WINED3D_VK_EXT_SHADER_STENCIL_EXPORT]; - d3d_info->texture_npot = true; - d3d_info->texture_npot_conditional = true; - d3d_info->normalized_texrect = false; + d3d_info->unconditional_npot = true; d3d_info->draw_base_vertex_offset = true; d3d_info->vertex_bgra = true; d3d_info->texture_swizzle = true; diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 97e1880f3f1..b11d284c10b 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2437,12 +2437,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d_adapter *adapter, WINED3DPTEXTURECAPS_PROJECTED | WINED3DPTEXTURECAPS_PERSPECTIVE; - if (!d3d_info->texture_npot) - { - caps->TextureCaps |= WINED3DPTEXTURECAPS_POW2; - if (d3d_info->texture_npot_conditional) - caps->TextureCaps |= WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL; - } + if (!d3d_info->unconditional_npot) + caps->TextureCaps |= WINED3DPTEXTURECAPS_POW2 | WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL; caps->TextureFilterCaps = WINED3DPTFILTERCAPS_MAGFLINEAR | WINED3DPTFILTERCAPS_MAGFPOINT | @@ -3323,7 +3319,7 @@ static void wined3d_adapter_no3d_init_d3d_info(struct wined3d_adapter *adapter, struct wined3d_d3d_info *d3d_info = &adapter->d3d_info; d3d_info->wined3d_creation_flags = wined3d_creation_flags; - d3d_info->texture_npot = TRUE; + d3d_info->unconditional_npot = true; d3d_info->feature_level = WINED3D_FEATURE_LEVEL_5; } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 1dcc3e3be49..ad5753e5d99 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -2667,7 +2667,7 @@ static void sampler_desc_from_sampler_states(struct wined3d_sampler_desc *desc, if (texture->flags & WINED3D_TEXTURE_COND_NP2) { desc->mip_filter = WINED3D_TEXF_NONE; - if (d3d_info->normalized_texrect) + if (!d3d_info->unconditional_npot) desc->min_filter = WINED3D_TEXF_POINT; } } diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index b3defb1f2fe..94429628035 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -3713,7 +3713,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc pow2_width = desc->width; pow2_height = desc->height; if (((desc->width & (desc->width - 1)) || (desc->height & (desc->height - 1)) || (desc->depth & (desc->depth - 1))) - && !d3d_info->texture_npot) + && !d3d_info->unconditional_npot) { /* level_count == 0 returns an error as well. */ if (level_count != 1 || layer_count != 1 || desc->resource_type == WINED3D_RTYPE_TEXTURE_3D) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index cb97a2587ba..8ecac000379 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -232,9 +232,9 @@ struct wined3d_d3d_info uint32_t shader_output_interpolation : 1; uint32_t viewport_array_index_any_shader : 1; uint32_t stencil_export : 1; - uint32_t texture_npot : 1; - uint32_t texture_npot_conditional : 1; - uint32_t normalized_texrect : 1; + /* If zero, only conditional NPOT textures are supported, via + * WINED3D_GL_NORMALIZED_TEXRECT. */ + uint32_t unconditional_npot : 1; uint32_t draw_base_vertex_offset : 1; uint32_t vertex_bgra : 1; uint32_t texture_swizzle : 1;
1
0
0
0
Elizabeth Figura : wined3d: Remove the last vestiges of ARB_texture_rectangle support.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 65cc641719eac5eff54446ee692fe0df7f14b4fa URL:
https://gitlab.winehq.org/wine/wine/-/commit/65cc641719eac5eff54446ee692fe0…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Wed Mar 20 15:56:57 2024 -0500 wined3d: Remove the last vestiges of ARB_texture_rectangle support. --- dlls/wined3d/adapter_gl.c | 22 ++-------------------- dlls/wined3d/context_gl.c | 11 ----------- dlls/wined3d/device.c | 12 ------------ dlls/wined3d/glsl_shader.c | 7 ------- dlls/wined3d/texture.c | 28 ++++------------------------ dlls/wined3d/view.c | 1 - dlls/wined3d/wined3d_gl.h | 1 - 7 files changed, 6 insertions(+), 76 deletions(-)
1
0
0
0
Elizabeth Figura : wined3d: Remove texture non-power-of-two fixup.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: d257c47f072a789db9a3f61f73164b97cc01c586 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d257c47f072a789db9a3f61f73164b…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Wed Mar 20 15:49:17 2024 -0500 wined3d: Remove texture non-power-of-two fixup. --- dlls/wined3d/context_gl.c | 2 - dlls/wined3d/glsl_shader.c | 201 ++--------------------------------------- dlls/wined3d/resource.c | 18 +--- dlls/wined3d/shader.c | 5 - dlls/wined3d/texture.c | 8 +- dlls/wined3d/utils.c | 14 --- dlls/wined3d/view.c | 4 - dlls/wined3d/wined3d_private.h | 31 +------ 8 files changed, 11 insertions(+), 272 deletions(-)
1
0
0
0
Elizabeth Figura : wined3d: Remove no longer used support for rectangle textures.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 1fc3522163bbd02f0409c39815b6959c9c769af9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1fc3522163bbd02f0409c39815b695…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Wed Mar 20 15:37:21 2024 -0500 wined3d: Remove no longer used support for rectangle textures. --- dlls/wined3d/glsl_shader.c | 7 ------- dlls/wined3d/resource.c | 1 - dlls/wined3d/texture.c | 17 ++--------------- dlls/wined3d/utils.c | 9 --------- dlls/wined3d/wined3d_private.h | 7 +++---- 5 files changed, 5 insertions(+), 36 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index d249f14bc8a..f3ac9e1095c 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -9841,9 +9841,6 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * case WINED3D_GL_RES_TYPE_TEX_CUBE: sampler_type = "Cube"; break; - case WINED3D_GL_RES_TYPE_TEX_RECT: - sampler_type = "2DRect"; - break; default: FIXME("Unhandled sampler type %#x.\n", settings->op[stage].tex_type); sampler_type = NULL; @@ -9984,10 +9981,6 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * texture_function = "textureCube"; coord_mask = "xyz"; break; - case WINED3D_GL_RES_TYPE_TEX_RECT: - texture_function = "texture2DRect"; - coord_mask = "xy"; - break; default: FIXME("Unhandled texture type %#x.\n", settings->op[stage].tex_type); texture_function = ""; diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index e336e0048e0..b0537ffd305 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -75,7 +75,6 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * {WINED3D_RTYPE_BUFFER, 0, WINED3D_GL_RES_TYPE_BUFFER}, {WINED3D_RTYPE_TEXTURE_1D, 0, WINED3D_GL_RES_TYPE_TEX_1D}, {WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_TEX_2D}, - {WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_TEX_RECT}, {WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_RB}, {WINED3D_RTYPE_TEXTURE_2D, WINED3DUSAGE_LEGACY_CUBEMAP, WINED3D_GL_RES_TYPE_TEX_CUBE}, {WINED3D_RTYPE_TEXTURE_3D, 0, WINED3D_GL_RES_TYPE_TEX_3D}, diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index d1b24b4dc2e..bbf8a8bc249 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -3855,18 +3855,8 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc wined3d_texture_dirty_region_add(texture, i, NULL); } - /* Precalculated scaling for 'faked' non power of two texture coords. */ - if (texture->resource.gl_type == WINED3D_GL_RES_TYPE_TEX_RECT) - { - texture->pow2_matrix[0] = (float)desc->width; - texture->pow2_matrix[5] = (float)desc->height; - texture->flags &= ~WINED3D_TEXTURE_POW2_MAT_IDENT; - } - else - { - texture->pow2_matrix[0] = 1.0f; - texture->pow2_matrix[5] = 1.0f; - } + texture->pow2_matrix[0] = 1.0f; + texture->pow2_matrix[5] = 1.0f; texture->pow2_matrix[10] = 1.0f; texture->pow2_matrix[15] = 1.0f; TRACE("x scale %.8e, y scale %.8e.\n", texture->pow2_matrix[0], texture->pow2_matrix[5]); @@ -4233,9 +4223,6 @@ HRESULT wined3d_texture_gl_init(struct wined3d_texture_gl *texture_gl, struct wi flags, device, parent, parent_ops, &texture_gl[1], &texture_gl_ops))) return hr; - if (texture_gl->t.resource.gl_type == WINED3D_GL_RES_TYPE_TEX_RECT) - texture_gl->target = GL_TEXTURE_RECTANGLE_ARB; - if (texture_gl->target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY || texture_gl->target == GL_TEXTURE_2D_MULTISAMPLE) texture_gl->t.flags &= ~WINED3D_TEXTURE_DOWNLOADABLE; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index c0695762795..25cb992d021 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -2235,8 +2235,6 @@ static GLenum wined3d_gl_type_to_enum(enum wined3d_gl_resource_type type) return GL_TEXTURE_3D; case WINED3D_GL_RES_TYPE_TEX_CUBE: return GL_TEXTURE_CUBE_MAP_ARB; - case WINED3D_GL_RES_TYPE_TEX_RECT: - return GL_TEXTURE_RECTANGLE_ARB; case WINED3D_GL_RES_TYPE_BUFFER: return GL_TEXTURE_2D; /* TODO: GL_TEXTURE_BUFFER. */ case WINED3D_GL_RES_TYPE_RB: @@ -2255,7 +2253,6 @@ static void delete_fbo_attachment(const struct wined3d_gl_info *gl_info, { case WINED3D_GL_RES_TYPE_TEX_1D: case WINED3D_GL_RES_TYPE_TEX_2D: - case WINED3D_GL_RES_TYPE_TEX_RECT: case WINED3D_GL_RES_TYPE_TEX_3D: case WINED3D_GL_RES_TYPE_TEX_CUBE: gl_info->gl_ops.gl.p_glDeleteTextures(1, &object); @@ -2296,7 +2293,6 @@ static void create_and_bind_fbo_attachment(const struct wined3d_gl_info *gl_info break; case WINED3D_GL_RES_TYPE_TEX_2D: - case WINED3D_GL_RES_TYPE_TEX_RECT: gl_info->gl_ops.gl.p_glGenTextures(1, object); gl_info->gl_ops.gl.p_glBindTexture(wined3d_gl_type_to_enum(d3d_type), *object); gl_info->gl_ops.gl.p_glTexImage2D(wined3d_gl_type_to_enum(d3d_type), 0, internal, 16, 16, 0, @@ -2658,7 +2654,6 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for case WINED3D_GL_RES_TYPE_TEX_2D: case WINED3D_GL_RES_TYPE_TEX_3D: - case WINED3D_GL_RES_TYPE_TEX_RECT: /* Rebinding texture to workaround a fglrx bug. */ gl_info->gl_ops.gl.p_glBindTexture(wined3d_gl_type_to_enum(type), object); gl_info->gl_ops.gl.p_glGetTexImage(wined3d_gl_type_to_enum(type), 0, GL_BGRA, @@ -3132,7 +3127,6 @@ static void query_internal_format(struct wined3d_adapter *adapter, format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] &= ~WINED3D_FORMAT_CAP_TEXTURE; format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; format->f.caps[WINED3D_GL_RES_TYPE_TEX_CUBE] &= ~WINED3D_FORMAT_CAP_TEXTURE; - format->f.caps[WINED3D_GL_RES_TYPE_TEX_RECT] &= ~WINED3D_FORMAT_CAP_TEXTURE; } query_view_class(format); @@ -3223,9 +3217,6 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) format->f.caps[WINED3D_GL_RES_TYPE_TEX_CUBE] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT; - if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) - format->f.caps[WINED3D_GL_RES_TYPE_TEX_RECT] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT; - format->f.caps[WINED3D_GL_RES_TYPE_RB] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT; format->f.caps[WINED3D_GL_RES_TYPE_RB] &= ~WINED3D_FORMAT_CAP_TEXTURE; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index de4b2108365..431ccff6316 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1437,10 +1437,9 @@ enum wined3d_gl_resource_type WINED3D_GL_RES_TYPE_TEX_2D = 1, WINED3D_GL_RES_TYPE_TEX_3D = 2, WINED3D_GL_RES_TYPE_TEX_CUBE = 3, - WINED3D_GL_RES_TYPE_TEX_RECT = 4, - WINED3D_GL_RES_TYPE_BUFFER = 5, - WINED3D_GL_RES_TYPE_RB = 6, - WINED3D_GL_RES_TYPE_COUNT = 7, + WINED3D_GL_RES_TYPE_BUFFER = 4, + WINED3D_GL_RES_TYPE_RB = 5, + WINED3D_GL_RES_TYPE_COUNT = 6, }; enum wined3d_vertex_processing_mode
1
0
0
0
Elizabeth Figura : wined3d: Remove no longer used support for emulated non-power-of-two textures.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 62523c78992f19ef397f8a8a79b2bab25e231573 URL:
https://gitlab.winehq.org/wine/wine/-/commit/62523c78992f19ef397f8a8a79b2ba…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Wed Mar 20 15:31:26 2024 -0500 wined3d: Remove no longer used support for emulated non-power-of-two textures. --- dlls/wined3d/texture.c | 124 +---------------------------------------- dlls/wined3d/wined3d_private.h | 1 - 2 files changed, 2 insertions(+), 123 deletions(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index a4eee054528..d1b24b4dc2e 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -58,8 +58,7 @@ bool wined3d_texture_validate_sub_resource_idx(const struct wined3d_texture *tex BOOL wined3d_texture_can_use_pbo(const struct wined3d_texture *texture, const struct wined3d_d3d_info *d3d_info) { - if (!d3d_info->pbo || texture->resource.format->conv_byte_count || texture->resource.pin_sysmem - || (texture->flags & WINED3D_TEXTURE_COND_NP2_EMULATED)) + if (!d3d_info->pbo || texture->resource.format->conv_byte_count || texture->resource.pin_sysmem) return FALSE; return TRUE; @@ -2643,10 +2642,6 @@ static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl return; } - /* NP2 emulation is not allowed on array textures. */ - if (texture_gl->t.flags & WINED3D_TEXTURE_COND_NP2_EMULATED) - ERR("Array texture %p uses NP2 emulation.\n", texture_gl); - WARN_(d3d_perf)("Downloading all miplevel layers to get the data for a single sub-resource.\n"); if (!(temporary_mem = calloc(texture_gl->t.layer_count, sub_resource->size))) @@ -2656,31 +2651,6 @@ static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl } } - if (texture_gl->t.flags & WINED3D_TEXTURE_COND_NP2_EMULATED) - { - if (format_gl->f.download) - { - FIXME("Reading back converted texture %p with NP2 emulation is not supported.\n", texture_gl); - return; - } - - wined3d_texture_get_pitch(&texture_gl->t, level, &dst_row_pitch, &dst_slice_pitch); - wined3d_format_calculate_pitch(&format_gl->f, texture_gl->t.resource.device->surface_alignment, - wined3d_texture_get_level_pow2_width(&texture_gl->t, level), - wined3d_texture_get_level_pow2_height(&texture_gl->t, level), - &src_row_pitch, &src_slice_pitch); - if (!(temporary_mem = malloc(src_slice_pitch))) - { - ERR("Out of memory.\n"); - return; - } - - if (bo) - ERR("NP2 emulated texture uses PBO unexpectedly.\n"); - if (texture_gl->t.resource.format_attrs & WINED3D_FORMAT_ATTR_COMPRESSED) - ERR("Unexpected compressed format for NP2 emulated texture.\n"); - } - if (format_gl->f.download) { struct wined3d_format f; @@ -2748,71 +2718,6 @@ static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl wined3d_texture_get_level_width(&texture_gl->t, level), wined3d_texture_get_level_height(&texture_gl->t, level), 1); } - else if (texture_gl->t.flags & WINED3D_TEXTURE_COND_NP2_EMULATED) - { - const BYTE *src_data; - unsigned int h, y; - BYTE *dst_data; - /* Some games (e.g. Warhammer 40,000) don't properly handle texture - * pitches, preventing us from using the texture pitch to box NPOT - * textures. Instead, we repack the texture's CPU copy so that its - * pitch equals bpp * width instead of bpp * pow2width. - * - * Instead of boxing the texture: - * - * │<── texture width ──>│ pow2 width ──>│ - * ├─────────────────────┼───────────────┼─ - * │111111111111111111111│ │ʌ - * │222222222222222222222│ ││ - * │333333333333333333333│ padding │texture height - * │444444444444444444444│ ││ - * │555555555555555555555│ │v - * ├─────────────────────┘ ├─ - * │ │pow2 height - * │ padding padding ││ - * │ │v - * └─────────────────────────────────────┴─ - * - * we're repacking the data to the expected texture width - * - * │<── texture width ──>│ pow2 width ──>│ - * ├─────────────────────┴───────────────┼─ - * │1111111111111111111112222222222222222│ʌ - * │2222233333333333333333333344444444444││ - * │4444444444555555555555555555555 │texture height - * │ ││ - * │ padding padding │v - * │ ├─ - * │ │pow2 height - * │ padding padding ││ - * │ │v - * └─────────────────────────────────────┴─ - * - * == is the same as - * - * │<── texture width ──>│ - * ├─────────────────────┼─ - * │111111111111111111111│ʌ - * │222222222222222222222││ - * │333333333333333333333│texture height - * │444444444444444444444││ - * │555555555555555555555│v - * └─────────────────────┴─ - * - * This also means that any references to surface memory should work - * with the data as if it were a standard texture with a NPOT width - * instead of a texture boxed up to be a power-of-two texture. */ - src_data = mem; - dst_data = data->addr; - TRACE("Repacking the surface data from pitch %u to pitch %u.\n", src_row_pitch, dst_row_pitch); - h = wined3d_texture_get_level_height(&texture_gl->t, level); - for (y = 0; y < h; ++y) - { - memcpy(dst_data, src_data, dst_row_pitch); - src_data += src_row_pitch; - dst_data += dst_row_pitch; - } - } else if (temporary_mem) { unsigned int layer = sub_resource_idx / texture_gl->t.level_count; @@ -2914,7 +2819,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context, if ((src_texture->resource.type == WINED3D_RTYPE_TEXTURE_2D && (target == GL_TEXTURE_2D_ARRAY || format_gl->f.conv_byte_count - || src_texture->flags & (WINED3D_TEXTURE_CONVERTED | WINED3D_TEXTURE_COND_NP2_EMULATED))) + || (src_texture->flags & WINED3D_TEXTURE_CONVERTED))) || target == GL_TEXTURE_1D_ARRAY) { wined3d_texture_gl_download_data_slow_path(src_texture_gl, src_sub_resource_idx, context_gl, dst_bo_addr); @@ -3838,25 +3743,6 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc WARN("Creating a scratch mipmapped/cube/array NPOT texture despite lack of HW support.\n"); } texture->flags |= WINED3D_TEXTURE_COND_NP2; - - if (desc->resource_type != WINED3D_RTYPE_TEXTURE_3D && !d3d_info->texture_npot_conditional) - { - /* TODO: Add support for non-power-of-two compressed textures. */ - if (format->attrs & (WINED3D_FORMAT_ATTR_COMPRESSED | WINED3D_FORMAT_ATTR_HEIGHT_SCALE)) - { - FIXME("Compressed or height scaled non-power-of-two (%ux%u) textures are not supported.\n", - desc->width, desc->height); - return WINED3DERR_NOTAVAILABLE; - } - - /* Find the nearest pow2 match. */ - pow2_width = pow2_height = 1; - while (pow2_width < desc->width) - pow2_width <<= 1; - while (pow2_height < desc->height) - pow2_height <<= 1; - texture->flags |= WINED3D_TEXTURE_COND_NP2_EMULATED; - } } texture->pow2_width = pow2_width; texture->pow2_height = pow2_height; @@ -3976,12 +3862,6 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc texture->pow2_matrix[5] = (float)desc->height; texture->flags &= ~WINED3D_TEXTURE_POW2_MAT_IDENT; } - else if (texture->flags & WINED3D_TEXTURE_COND_NP2_EMULATED) - { - texture->pow2_matrix[0] = (((float)desc->width) / ((float)pow2_width)); - texture->pow2_matrix[5] = (((float)desc->height) / ((float)pow2_height)); - texture->flags &= ~WINED3D_TEXTURE_POW2_MAT_IDENT; - } else { texture->pow2_matrix[0] = 1.0f; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index dc802bdd5d5..de4b2108365 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3301,7 +3301,6 @@ struct wined3d_texture_ops }; #define WINED3D_TEXTURE_COND_NP2 0x00000001 -#define WINED3D_TEXTURE_COND_NP2_EMULATED 0x00000002 #define WINED3D_TEXTURE_POW2_MAT_IDENT 0x00000004 #define WINED3D_TEXTURE_IS_SRGB 0x00000008 #define WINED3D_TEXTURE_RGB_ALLOCATED 0x00000010
1
0
0
0
← Newer
1
...
34
35
36
37
38
39
40
...
71
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
Results per page:
10
25
50
100
200