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
March 2016
----- 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
722 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Get resource info from the texture in surface_blt_to_drawable().
by Alexandre Julliard
23 Mar '16
23 Mar '16
Module: wine Branch: master Commit: c526188bb30619a3df80ad08109fa18b9d9e8f5c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c526188bb30619a3df80ad081…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Mar 22 17:46:10 2016 +0100 wined3d: Get resource info from the texture in surface_blt_to_drawable(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/surface.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index c11d248..4243de6 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2512,6 +2512,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, struct wined3d_surface *src_surface, const RECT *src_rect_in, struct wined3d_surface *dst_surface, const RECT *dst_rect_in) { + struct wined3d_texture *src_texture = src_surface->container; + struct wined3d_texture *dst_texture = dst_surface->container; const struct wined3d_gl_info *gl_info; struct wined3d_context *context = old_ctx; struct wined3d_surface *restore_rt = NULL; @@ -2532,12 +2534,12 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, /* Make sure the surface is up-to-date. This should probably use * surface_load_location() and worry about the destination surface too, * unless we're overwriting it completely. */ - wined3d_texture_load(src_surface->container, context, FALSE); + wined3d_texture_load(src_texture, context, FALSE); /* Activate the destination context, set it up for blitting */ context_apply_blit_state(context, device); - if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) + if (!wined3d_resource_is_offscreen(&dst_texture->resource)) surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect); device->blitter->set_shader(device->blit_priv, context, src_surface, NULL); @@ -2550,9 +2552,9 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, /* For P8 surfaces, the alpha component contains the palette index. * Which means that the colorkey is one of the palette entries. In * other cases pixels that should be masked away have alpha set to 0. */ - if (src_surface->resource.format->id == WINED3DFMT_P8_UINT) + if (src_texture->resource.format->id == WINED3DFMT_P8_UINT) gl_info->gl_ops.gl.p_glAlphaFunc(GL_NOTEQUAL, - (float)src_surface->container->async.src_blt_color_key.color_space_low_value / 255.0f); + (float)src_texture->async.src_blt_color_key.color_space_low_value / 255.0f); else gl_info->gl_ops.gl.p_glAlphaFunc(GL_NOTEQUAL, 0.0f); checkGLcall("glAlphaFunc"); @@ -2575,8 +2577,7 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, device->blitter->unset_shader(context->gl_info); if (wined3d_settings.strict_draw_ordering - || (dst_surface->container->swapchain - && dst_surface->container->swapchain->front_buffer == dst_surface->container)) + || (dst_texture->swapchain && dst_texture->swapchain->front_buffer == dst_texture)) gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ if (restore_rt)
1
0
0
0
Henri Verbeet : ddraw/tests: Get rid of the unused "d3d" variable in test_shademode().
by Alexandre Julliard
23 Mar '16
23 Mar '16
Module: wine Branch: master Commit: 3c7ca3d5536e94078b6140d0ebeb44af2478b2f7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3c7ca3d5536e94078b6140d0e…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Mar 22 17:46:09 2016 +0100 ddraw/tests: Get rid of the unused "d3d" variable in test_shademode(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/tests/ddraw1.c | 4 ---- dlls/ddraw/tests/ddraw2.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 8462873..02eb9c9 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -7939,7 +7939,6 @@ static void test_shademode(void) DWORD color0, color1; UINT i, inst_length; IDirectDraw *ddraw; - IDirect3D *d3d; ULONG refcount; HWND window; HRESULT hr; @@ -7986,8 +7985,6 @@ static void test_shademode(void) return; } - hr = IDirect3DDevice_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#x.\n", hr); hr = IDirect3DDevice_QueryInterface(device, &IID_IDirectDrawSurface, (void **)&rt); ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); @@ -8061,7 +8058,6 @@ static void test_shademode(void) destroy_viewport(device, viewport); destroy_material(background); IDirectDrawSurface_Release(rt); - IDirect3D_Release(d3d); refcount = IDirect3DDevice_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); IDirectDraw_Release(ddraw); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index fe86149..ee3508f 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -9063,7 +9063,6 @@ static void test_shademode(void) DWORD color0, color1; IDirectDraw2 *ddraw; D3DLVERTEX *quad; - IDirect3D2 *d3d; ULONG refcount; UINT i, count; HWND window; @@ -9113,8 +9112,6 @@ static void test_shademode(void) return; } - hr = IDirect3DDevice2_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#x.\n", hr); hr = IDirect3DDevice2_GetRenderTarget(device, &rt); ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); @@ -9164,7 +9161,6 @@ static void test_shademode(void) destroy_viewport(device, viewport); destroy_material(background); IDirectDrawSurface_Release(rt); - IDirect3D2_Release(d3d); refcount = IDirect3DDevice2_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); IDirectDraw_Release(ddraw);
1
0
0
0
Henri Verbeet : ddraw/tests: Rewrite blt_test().
by Alexandre Julliard
23 Mar '16
23 Mar '16
Module: wine Branch: master Commit: f0c7c7f6276b267755d88c93531ac3dfd2180bac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f0c7c7f6276b267755d88c935…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Mar 22 17:46:08 2016 +0100 ddraw/tests: Rewrite blt_test(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/tests/ddraw1.c | 81 ++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw2.c | 81 ++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw4.c | 84 ++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw7.c | 84 ++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/visual.c | 108 ---------------------------------------------- 5 files changed, 330 insertions(+), 108 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f0c7c7f6276b267755d88…
1
0
0
0
Francois Gouget : testbot/TestAgent: Clearly identify all the 'out of eval ' return calls.
by Alexandre Julliard
23 Mar '16
23 Mar '16
Module: tools Branch: master Commit: 8a64b64f5a3ed581468096633c355b0eba4382f8 URL:
http://source.winehq.org/git/tools.git/?a=commit;h=8a64b64f5a3ed58146809663…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Mar 23 11:48:52 2016 +0100 testbot/TestAgent: Clearly identify all the 'out of eval' return calls. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/lib/WineTestBot/TestAgent.pm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/testbot/lib/WineTestBot/TestAgent.pm b/testbot/lib/WineTestBot/TestAgent.pm index a87b3f2..f255e0f 100644 --- a/testbot/lib/WineTestBot/TestAgent.pm +++ b/testbot/lib/WineTestBot/TestAgent.pm @@ -266,13 +266,13 @@ sub _RecvRawData($$$) { alarm(0); $self->_SetError($FATAL, "network read error ($self->{rpc}:$Name:$Received/$Size): $!"); - return; + return; # out of eval } if ($r == 0) { alarm(0); $self->_SetError($FATAL, "network read got a premature EOF ($self->{rpc}:$Name:$Received/$Size)"); - return; + return; # out of eval } $Data .= $Buffer; $Received += $r; @@ -310,13 +310,13 @@ sub _SkipRawData($$) { alarm(0); $self->_SetError($FATAL, "network skip failed ($self->{rpc}:$Name:$Received/$Size): $!"); - return; + return; # out of eval } if ($n == 0) { alarm(0); $self->_SetError($FATAL, "network skip got a premature EOF ($self->{rpc}:$Name:$Received/$Size)"); - return; + return; # out of eval } $Received += $n; $Remaining -= $n; @@ -481,13 +481,13 @@ sub _RecvFile($$$$) { alarm(0); $self->_SetError($FATAL, "got a network error while receiving '$Filename' ($self->{rpc}:$Name:$Received/$Size): $!"); - return; + return; # out of eval } if ($r == 0) { alarm(0); $self->_SetError($FATAL, "got a premature EOF while receiving '$Filename' ($self->{rpc}:$Name:$Received/$Size)"); - return; + return; # out of eval } $Remaining -= $r; my $w = syswrite($Dst, $Buffer, $r, 0); @@ -497,7 +497,7 @@ sub _RecvFile($$$$) alarm(0); $self->_SetError($ERROR, "an error occurred while writing to '$Filename' ($self->{rpc}:$Name:$Received/$Size): $!"); $self->_SkipRawData($Name, $Remaining); - return; + return; # out of eval } } alarm(0); @@ -795,13 +795,13 @@ sub _SendFile($$$$) { alarm(0); $self->_SetError($FATAL, "an error occurred while reading from '$Filename' ($self->{rpc}:$Name:$Sent/$Size): $!"); - return; + return; # out of eval } if ($r == 0) { alarm(0); $self->_SetError($FATAL, "got a premature EOF while reading from '$Filename' ($self->{rpc}:$Name:$Sent/$Size)"); - return; + return; # out of eval } $Remaining -= $r; my $w = $self->_Write($Name, $Buffer); @@ -810,7 +810,7 @@ sub _SendFile($$$$) { alarm(0); $self->_SetError($FATAL, "got a network error while sending '$Filename' ($self->{rpc}:$Name:$Sent+$s/$Size): $!"); - return; + return; # out of eval } } alarm(0);
1
0
0
0
Francois Gouget : testbot/TestAgent: Prevent _SendEntryHeader() from interfering with _SendFile()'s timeout mechanism.
by Alexandre Julliard
23 Mar '16
23 Mar '16
Module: tools Branch: master Commit: 2ebf75b9c5dc489974e7119fccd6b403e566cc5f URL:
http://source.winehq.org/git/tools.git/?a=commit;h=2ebf75b9c5dc489974e7119f…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Mar 23 11:48:29 2016 +0100 testbot/TestAgent: Prevent _SendEntryHeader() from interfering with _SendFile()'s timeout mechanism. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/lib/WineTestBot/TestAgent.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testbot/lib/WineTestBot/TestAgent.pm b/testbot/lib/WineTestBot/TestAgent.pm index 1b2916f..a87b3f2 100644 --- a/testbot/lib/WineTestBot/TestAgent.pm +++ b/testbot/lib/WineTestBot/TestAgent.pm @@ -777,6 +777,8 @@ sub _SendFile($$$$) debug(" SendFile('$Name', '$Filename')\n"); my $Size = -s $Filename; + return undef if (!$self->_SendEntryHeader("$Name/Size", 'd', $Size)); + my ($Start, $Sent, $Remaining) = (now(), 0, $Size); my $Success; eval @@ -784,7 +786,6 @@ sub _SendFile($$$$) local $SIG{ALRM} = sub { die "timeout" }; $self->_SetAlarm(); - return if (!$self->_SendEntryHeader("$Name/Size", 'd', $Size)); while ($Remaining) { my $Buffer;
1
0
0
0
Jeremy Newman : set plural
by Jeremy Newman
22 Mar '16
22 Mar '16
Module: appdb Branch: master Commit: 779db21a87786cb2840226015bfdfeecb7f51399 URL:
http://source.winehq.org/git/appdb.git/?a=commit;h=779db21a87786cb284022601…
Author: Jeremy Newman <jnewman(a)codeweavers.com> Date: Tue Mar 22 15:26:46 2016 -0500 set plural --- include/screenshot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/screenshot.php b/include/screenshot.php index adb0658..692da89 100644 --- a/include/screenshot.php +++ b/include/screenshot.php @@ -534,12 +534,12 @@ class screenshot $sZoomIcon = Screenshot::get_zoomicon_overlay(); /* we have screenshots */ - if($hResult && query_num_rows($hResult)) + if($hResult && $numShots = query_num_rows($hResult)) { if($iVersionId) $sImg .= "<div class=\"imgarea\"><a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<br>View/Submit Screenshot</a></div>"; else - $sImg .= "<div class=\"imgarea\"><a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<br>View Screenshot</a></div>"; + $sImg .= "<div class=\"imgarea\"><a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<br>View Screenshot".($numShots > 1 ? "s" : "")."</a></div>"; } else if($iVersionId) /* we are asking for a specific app version but it has no screenshots */ { $sImg .= "<div class=\"imgarea\"><a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<br>Submit Screenshot</a></div>";
1
0
0
0
Jeremy Newman : imagejpeg second param should be null to output directly
by Jeremy Newman
22 Mar '16
22 Mar '16
Module: appdb Branch: master Commit: f69dfc770c66885f95ae8c6e7b7de30ccdc18638 URL:
http://source.winehq.org/git/appdb.git/?a=commit;h=f69dfc770c66885f95ae8c6e…
Author: Jeremy Newman <jnewman(a)codeweavers.com> Date: Tue Mar 22 13:43:09 2016 -0500 imagejpeg second param should be null to output directly --- include/image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/image.php b/include/image.php index 16e45dc..6f22aad 100644 --- a/include/image.php +++ b/include/image.php @@ -360,7 +360,7 @@ class Image { case 2: if($bHeader) header('Content-type: image/jpeg'); - imagejpeg($this->oImage,'',$iQuality); + imagejpeg($this->oImage,null,$iQuality); $this->set_debuglog("Outputed file as jpeg to browser"); break;
1
0
0
0
Józef Kucia : d3d11/tests: Test render to depth texture.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: 329dfee70c35184329d0820a5e9edbbed8b49b37 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=329dfee70c35184329d0820a5…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Mar 22 13:41:50 2016 +0100 d3d11/tests: Test render to depth texture. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 188 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 178 insertions(+), 10 deletions(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 819c547..4953675 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -4139,20 +4139,13 @@ static void test_scissor(void) return float4(0.0, 1.0, 0.0, 1.0); } #endif - 0x43425844, 0xe70802a0, 0xee334047, 0x7bfd0c79, 0xaeff7804, 0x00000001, 0x000001b0, 0x00000005, - 0x00000034, 0x0000008c, 0x000000c0, 0x000000f4, 0x00000134, 0x46454452, 0x00000050, 0x00000000, - 0x00000000, 0x00000000, 0x0000001c, 0xffff0400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f, - 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e30332e, - 0x30303239, 0x3336312e, 0xab003438, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x43425844, 0x30240e72, 0x012f250c, 0x8673c6ea, 0x392e4cec, 0x00000001, 0x000000d4, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, 0x0000000e, 0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, - 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, 0x54415453, 0x00000074, 0x00000002, - 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, }; if (!init_test_context(&test_context, NULL)) @@ -5362,6 +5355,180 @@ static void test_clear_depth_stencil_view(void) ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_draw_depth_only(void) +{ + ID3D11DepthStencilState *depth_stencil_state; + D3D11_DEPTH_STENCIL_DESC depth_stencil_desc; + struct d3d11_test_context test_context; + ID3D11PixelShader *ps_color, *ps_depth; + D3D11_TEXTURE2D_DESC texture_desc; + D3D11_BUFFER_DESC buffer_desc; + ID3D11DeviceContext *context; + ID3D11DepthStencilView *dsv; + struct texture_readback rb; + ID3D11Texture2D *texture; + ID3D11Device *device; + unsigned int i, j; + D3D11_VIEWPORT vp; + struct vec4 depth; + ID3D11Buffer *cb; + HRESULT hr; + + static const DWORD ps_color_code[] = + { +#if 0 + float4 main(float4 position : SV_POSITION) : SV_Target + { + return float4(0.0, 1.0, 0.0, 1.0); + } +#endif + 0x43425844, 0x30240e72, 0x012f250c, 0x8673c6ea, 0x392e4cec, 0x00000001, 0x000000d4, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, + 0x0000000e, 0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, + 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, + }; + static const DWORD ps_depth_code[] = + { +#if 0 + float depth; + + float main() : SV_Depth + { + return depth; + } +#endif + 0x43425844, 0x91af6cd0, 0x7e884502, 0xcede4f54, 0x6f2c9326, 0x00000001, 0x000000b0, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff, + 0x00000e01, 0x445f5653, 0x68747065, 0xababab00, 0x52444853, 0x00000038, 0x00000040, 0x0000000e, + 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x02000065, 0x0000c001, 0x05000036, 0x0000c001, + 0x0020800a, 0x00000000, 0x00000000, 0x0100003e, + }; + + if (!init_test_context(&test_context, NULL)) + return; + + device = test_context.device; + context = test_context.immediate_context; + + buffer_desc.ByteWidth = sizeof(depth); + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, NULL, &cb); + ok(SUCCEEDED(hr), "Failed to create constant buffer, hr %#x.\n", hr); + + texture_desc.Width = 640; + texture_desc.Height = 480; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_D32_FLOAT; + texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Quality = 0; + texture_desc.Usage = D3D11_USAGE_DEFAULT; + texture_desc.BindFlags = D3D11_BIND_DEPTH_STENCIL; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + hr = ID3D11Device_CreateDepthStencilView(device, (ID3D11Resource *)texture, NULL, &dsv); + ok(SUCCEEDED(hr), "Failed to create depth stencil view, hr %#x.\n", hr); + + depth_stencil_desc.DepthEnable = TRUE; + depth_stencil_desc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; + depth_stencil_desc.DepthFunc = D3D11_COMPARISON_LESS; + depth_stencil_desc.StencilEnable = FALSE; + + hr = ID3D11Device_CreateDepthStencilState(device, &depth_stencil_desc, &depth_stencil_state); + ok(SUCCEEDED(hr), "Failed to create depth stencil state, hr %#x.\n", hr); + + hr = ID3D11Device_CreatePixelShader(device, ps_color_code, sizeof(ps_color_code), NULL, &ps_color); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_depth_code, sizeof(ps_depth_code), NULL, &ps_depth); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + + ID3D11DeviceContext_PSSetConstantBuffers(context, 0, 1, &cb); + ID3D11DeviceContext_PSSetShader(context, ps_color, NULL, 0); + ID3D11DeviceContext_OMSetRenderTargets(context, 0, NULL, dsv); + ID3D11DeviceContext_OMSetDepthStencilState(context, depth_stencil_state, 0); + + ID3D11DeviceContext_ClearDepthStencilView(context, dsv, D3D11_CLEAR_DEPTH, 1.0f, 0); + check_texture_float(texture, 1.0f, 1); + draw_quad(&test_context); + check_texture_float(texture, 0.0f, 1); + + ID3D11DeviceContext_PSSetShader(context, ps_depth, NULL, 0); + + depth.x = 0.7f; + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.0f, 1); + ID3D11DeviceContext_ClearDepthStencilView(context, dsv, D3D11_CLEAR_DEPTH, 1.0f, 0); + check_texture_float(texture, 1.0f, 1); + draw_quad(&test_context); + check_texture_float(texture, 0.7f, 1); + depth.x = 0.8f; + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.7f, 1); + depth.x = 0.5f; + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.5f, 1); + + ID3D11DeviceContext_ClearDepthStencilView(context, dsv, D3D11_CLEAR_DEPTH, 1.0f, 0); + depth.x = 0.1f; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + depth.x = 1.0f / 16.0f * (j + 4 * i); + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &depth, 0, 0); + + vp.TopLeftX = 160.0f * j; + vp.TopLeftY = 120.0f * i; + vp.Width = 160.0f; + vp.Height = 120.0f; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D11DeviceContext_RSSetViewports(context, 1, &vp); + + draw_quad(&test_context); + } + } + get_texture_readback(texture, &rb); + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + float obtained_depth, expected_depth; + + obtained_depth = get_readback_float(&rb, 80 + j * 160, 60 + i * 120); + expected_depth = 1.0f / 16.0f * (j + 4 * i); + ok(compare_float(obtained_depth, expected_depth, 1), + "Got unexpected depth %.8e at (%u, %u), expected %.8e.\n", + obtained_depth, j, i, expected_depth); + } + } + release_texture_readback(&rb); + + ID3D11Buffer_Release(cb); + ID3D11PixelShader_Release(ps_color); + ID3D11PixelShader_Release(ps_depth); + ID3D11DepthStencilView_Release(dsv); + ID3D11DepthStencilState_Release(depth_stencil_state); + ID3D11Texture2D_Release(texture); + release_test_context(&test_context); +} + static void test_cb_relative_addressing(void) { struct d3d11_test_context test_context; @@ -5594,5 +5761,6 @@ START_TEST(d3d11) test_multisample_init(); test_check_multisample_quality_levels(); test_clear_depth_stencil_view(); + test_draw_depth_only(); test_cb_relative_addressing(); }
1
0
0
0
Józef Kucia : d3d10core/tests: Test render to depth texture.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: 4037b48a4cb9cf18ed0f978d8ad43d1ed55ba2af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4037b48a4cb9cf18ed0f978d8…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Mar 22 13:41:49 2016 +0100 d3d10core/tests: Test render to depth texture. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10core/tests/device.c | 195 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 181 insertions(+), 14 deletions(-) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index a402d60..4c41d25 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -2348,24 +2348,19 @@ static void test_scissor(void) static const float red[] = {1.0f, 0.0f, 0.0f, 1.0f}; static const DWORD ps_code[] = { - /* float4 main(float4 position : SV_POSITION) : SV_Target - * { - * return float4(0.0, 1.0, 0.0, 1.0); - * } */ - 0x43425844, 0xe70802a0, 0xee334047, 0x7bfd0c79, 0xaeff7804, 0x00000001, 0x000001b0, 0x00000005, - 0x00000034, 0x0000008c, 0x000000c0, 0x000000f4, 0x00000134, 0x46454452, 0x00000050, 0x00000000, - 0x00000000, 0x00000000, 0x0000001c, 0xffff0400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f, - 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e30332e, - 0x30303239, 0x3336312e, 0xab003438, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, +#if 0 + float4 main(float4 position : SV_POSITION) : SV_Target + { + return float4(0.0, 1.0, 0.0, 1.0); + } +#endif + 0x43425844, 0x30240e72, 0x012f250c, 0x8673c6ea, 0x392e4cec, 0x00000001, 0x000000d4, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, 0x0000000e, 0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, - 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, 0x54415453, 0x00000074, 0x00000002, - 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, }; if (!init_test_context(&test_context)) @@ -5936,6 +5931,177 @@ static void test_clear_depth_stencil_view(void) ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_draw_depth_only(void) +{ + ID3D10DepthStencilState *depth_stencil_state; + D3D10_DEPTH_STENCIL_DESC depth_stencil_desc; + struct d3d10core_test_context test_context; + ID3D10PixelShader *ps_color, *ps_depth; + D3D10_TEXTURE2D_DESC texture_desc; + D3D10_BUFFER_DESC buffer_desc; + ID3D10DepthStencilView *dsv; + struct texture_readback rb; + ID3D10Texture2D *texture; + ID3D10Device *device; + unsigned int i, j; + D3D10_VIEWPORT vp; + struct vec4 depth; + ID3D10Buffer *cb; + HRESULT hr; + + static const DWORD ps_color_code[] = + { +#if 0 + float4 main(float4 position : SV_POSITION) : SV_Target + { + return float4(0.0, 1.0, 0.0, 1.0); + } +#endif + 0x43425844, 0x30240e72, 0x012f250c, 0x8673c6ea, 0x392e4cec, 0x00000001, 0x000000d4, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, + 0x0000000e, 0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, + 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, + }; + static const DWORD ps_depth_code[] = + { +#if 0 + float depth; + + float main() : SV_Depth + { + return depth; + } +#endif + 0x43425844, 0x91af6cd0, 0x7e884502, 0xcede4f54, 0x6f2c9326, 0x00000001, 0x000000b0, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff, + 0x00000e01, 0x445f5653, 0x68747065, 0xababab00, 0x52444853, 0x00000038, 0x00000040, 0x0000000e, + 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x02000065, 0x0000c001, 0x05000036, 0x0000c001, + 0x0020800a, 0x00000000, 0x00000000, 0x0100003e, + }; + + if (!init_test_context(&test_context)) + return; + + device = test_context.device; + + buffer_desc.ByteWidth = sizeof(depth); + buffer_desc.Usage = D3D10_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D10_BIND_CONSTANT_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + + hr = ID3D10Device_CreateBuffer(device, &buffer_desc, NULL, &cb); + ok(SUCCEEDED(hr), "Failed to create constant buffer, hr %#x.\n", hr); + + texture_desc.Width = 640; + texture_desc.Height = 480; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_D32_FLOAT; + texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Quality = 0; + texture_desc.Usage = D3D10_USAGE_DEFAULT; + texture_desc.BindFlags = D3D10_BIND_DEPTH_STENCIL; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + hr = ID3D10Device_CreateDepthStencilView(device, (ID3D10Resource *)texture, NULL, &dsv); + ok(SUCCEEDED(hr), "Failed to create depth stencil view, hr %#x.\n", hr); + + depth_stencil_desc.DepthEnable = TRUE; + depth_stencil_desc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ALL; + depth_stencil_desc.DepthFunc = D3D10_COMPARISON_LESS; + depth_stencil_desc.StencilEnable = FALSE; + + hr = ID3D10Device_CreateDepthStencilState(device, &depth_stencil_desc, &depth_stencil_state); + ok(SUCCEEDED(hr), "Failed to create depth stencil state, hr %#x.\n", hr); + + hr = ID3D10Device_CreatePixelShader(device, ps_color_code, sizeof(ps_color_code), &ps_color); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + hr = ID3D10Device_CreatePixelShader(device, ps_depth_code, sizeof(ps_depth_code), &ps_depth); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + + ID3D10Device_PSSetConstantBuffers(device, 0, 1, &cb); + ID3D10Device_PSSetShader(device, ps_color); + ID3D10Device_OMSetRenderTargets(device, 0, NULL, dsv); + ID3D10Device_OMSetDepthStencilState(device, depth_stencil_state, 0); + + ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH, 1.0f, 0); + check_texture_float(texture, 1.0f, 1); + draw_quad(&test_context); + check_texture_float(texture, 0.0f, 1); + + ID3D10Device_PSSetShader(device, ps_depth); + + depth.x = 0.7f; + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.0f, 1); + ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH, 1.0f, 0); + check_texture_float(texture, 1.0f, 1); + draw_quad(&test_context); + check_texture_float(texture, 0.7f, 1); + depth.x = 0.8f; + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.7f, 1); + depth.x = 0.5f; + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.5f, 1); + + ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH, 1.0f, 0); + depth.x = 0.1f; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + depth.x = 1.0f / 16.0f * (j + 4 * i); + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, NULL, &depth, 0, 0); + + vp.TopLeftX = 160 * j; + vp.TopLeftY = 120 * i; + vp.Width = 160; + vp.Height = 120; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D10Device_RSSetViewports(device, 1, &vp); + + draw_quad(&test_context); + } + } + get_texture_readback(texture, &rb); + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + float obtained_depth, expected_depth; + + obtained_depth = get_readback_float(&rb, 80 + j * 160, 60 + i * 120); + expected_depth = 1.0f / 16.0f * (j + 4 * i); + ok(compare_float(obtained_depth, expected_depth, 1), + "Got unexpected depth %.8e at (%u, %u), expected %.8e.\n", + obtained_depth, j, i, expected_depth); + } + } + release_texture_readback(&rb); + + ID3D10Buffer_Release(cb); + ID3D10PixelShader_Release(ps_color); + ID3D10PixelShader_Release(ps_depth); + ID3D10DepthStencilView_Release(dsv); + ID3D10DepthStencilState_Release(depth_stencil_state); + ID3D10Texture2D_Release(texture); + release_test_context(&test_context); +} + START_TEST(device) { test_feature_level(); @@ -5970,4 +6136,5 @@ START_TEST(device) test_cb_relative_addressing(); test_swapchain_flip(); test_clear_depth_stencil_view(); + test_draw_depth_only(); }
1
0
0
0
Józef Kucia : wined3d: Allow draw calls without color attachments.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: 53f4cc1a9eef9708e8b4d537d745161222242a74 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=53f4cc1a9eef9708e8b4d537d…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Mar 22 13:41:48 2016 +0100 wined3d: Allow draw calls without color attachments. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 2 +- dlls/wined3d/state.c | 50 ++++++++++++++++++++++++++++-------------- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index e372eaa..31fd22a 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2675,7 +2675,7 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat } context_apply_fbo_state(context, GL_FRAMEBUFFER, context->blit_targets, wined3d_rendertarget_view_get_surface(fb->depth_stencil), - fb->render_targets[0]->resource->draw_binding, + fb->render_targets[0] ? fb->render_targets[0]->resource->draw_binding : 0, fb->depth_stencil ? fb->depth_stencil->resource->draw_binding : 0); } } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index ec49d56..70f053b 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -367,11 +367,20 @@ static GLenum gl_blend_factor(enum wined3d_blend factor, const struct wined3d_fo static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - const struct wined3d_format *rt_format = state->fb->render_targets[0]->format; - unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags; const struct wined3d_gl_info *gl_info = context->gl_info; - GLenum srcBlend, dstBlend; + const struct wined3d_format *rt_format; enum wined3d_blend d3d_blend; + GLenum srcBlend, dstBlend; + unsigned int rt_fmt_flags; + + if (!state->fb->render_targets[0]) + { + gl_info->gl_ops.gl.p_glDisable(GL_BLEND); + return; + } + + rt_format = state->fb->render_targets[0]->format; + rt_fmt_flags = state->fb->render_targets[0]->format_flags; /* According to the red book, GL_LINE_SMOOTH needs GL_BLEND with specific * blending parameters to work. */ @@ -4544,31 +4553,40 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { + const struct wined3d_rendertarget_view *depth_stencil = state->fb->depth_stencil; const struct wined3d_rendertarget_view *target = state->fb->render_targets[0]; const struct wined3d_gl_info *gl_info = context->gl_info; struct wined3d_viewport vp = state->viewport; + unsigned int width, height; + + if (target) + { + if (vp.width > target->width) + vp.width = target->width; + if (vp.height > target->height) + vp.height = target->height; - if (vp.width > target->width) - vp.width = target->width; - if (vp.height > target->height) - vp.height = target->height; + surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height); + } + else if (depth_stencil) + { + width = depth_stencil->width; + height = depth_stencil->height; + } + else + { + FIXME("No attachments draw calls not supported.\n"); + return; + } gl_info->gl_ops.gl.p_glDepthRange(vp.min_z, vp.max_z); checkGLcall("glDepthRange"); /* Note: GL requires lower left, DirectX supplies upper left. This is * reversed when using offscreen rendering. */ if (context->render_offscreen) - { gl_info->gl_ops.gl.p_glViewport(vp.x, vp.y, vp.width, vp.height); - } else - { - UINT width, height; - - surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height); - gl_info->gl_ops.gl.p_glViewport(vp.x, (height - (vp.y + vp.height)), - vp.width, vp.height); - } + gl_info->gl_ops.gl.p_glViewport(vp.x, (height - (vp.y + vp.height)), vp.width, vp.height); checkGLcall("glViewport"); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 48d21d3..feb86d1 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3431,7 +3431,7 @@ static inline BOOL needs_srgb_write(const struct wined3d_context *context, { return (!(context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL) || state->render_states[WINED3D_RS_SRGBWRITEENABLE]) - && fb->render_targets[0]->format_flags & WINED3DFMT_FLAG_SRGB_WRITE; + && fb->render_targets[0] && fb->render_targets[0]->format_flags & WINED3DFMT_FLAG_SRGB_WRITE; } /* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
73
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
Results per page:
10
25
50
100
200