Rebase against 9c1fbe509576d7cbaada3af9736888cfa1d02847.

This commit is contained in:
Sebastian Lackner 2016-06-22 20:12:41 +02:00
parent 2f3baafeca
commit e27647e4d5
14 changed files with 788 additions and 1612 deletions

View File

@ -1,18 +1,18 @@
From e9e959a5ad7964f0f7546d0306b46342f46be4bd Mon Sep 17 00:00:00 2001
From 49a870429b6f911dccca036e9622497074c6b6bb Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Sat, 20 Feb 2016 15:21:00 +0800
Subject: gdi32/tests: Add some additional tests for ExtExtOut on a path for an
EMF DC.
EMF DC. (v2)
---
dlls/gdi32/tests/metafile.c | 119 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 119 insertions(+)
dlls/gdi32/tests/metafile.c | 118 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 118 insertions(+)
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index f464720..9247ac7 100644
index bcd085c..baeaa63 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -1101,6 +1101,44 @@ static const unsigned char EMF_TEXTOUT_ON_PATH_BITS[] =
@@ -1122,6 +1122,44 @@ static const unsigned char EMF_TEXTOUT_ON_PATH_BITS[] =
0x14, 0x00, 0x00, 0x00
};
@ -57,7 +57,7 @@ index f464720..9247ac7 100644
static const unsigned char MF_LINETO_BITS[] = {
0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x11, 0x00,
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
@@ -2224,6 +2262,8 @@ static void test_emf_ExtTextOut_on_path(void)
@@ -2384,6 +2422,8 @@ static void test_emf_ExtTextOut_on_path(void)
HDC hdcDisplay, hdcMetafile;
HENHMETAFILE hMetafile;
BOOL ret;
@ -66,7 +66,7 @@ index f464720..9247ac7 100644
static const INT dx[4] = { 3, 5, 8, 12 };
/* Win9x doesn't play EMFs on invisible windows */
@@ -2234,6 +2274,20 @@ static void test_emf_ExtTextOut_on_path(void)
@@ -2394,6 +2434,20 @@ static void test_emf_ExtTextOut_on_path(void)
hdcDisplay = GetDC(hwnd);
ok(hdcDisplay != 0, "GetDC error %d\n", GetLastError());
@ -87,18 +87,17 @@ index f464720..9247ac7 100644
hdcMetafile = CreateEnhMetaFileA(hdcDisplay, NULL, NULL, NULL);
ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError());
@@ -2246,6 +2300,10 @@ static void test_emf_ExtTextOut_on_path(void)
@@ -2406,6 +2460,9 @@ static void test_emf_ExtTextOut_on_path(void)
ret = EndPath(hdcMetafile);
ok(ret, "EndPath error %d\n", GetLastError());
+ ret = GetPath(hdcMetafile, NULL, NULL, 0);
+todo_wine
+ ok(!ret, "expected 0, got %d\n", ret);
+
hMetafile = CloseEnhMetaFile(hdcMetafile);
ok(hMetafile != 0, "CloseEnhMetaFile error %d\n", GetLastError());
@@ -2261,6 +2319,67 @@ static void test_emf_ExtTextOut_on_path(void)
@@ -2421,6 +2478,67 @@ static void test_emf_ExtTextOut_on_path(void)
ret = DeleteEnhMetaFile(hMetafile);
ok(ret, "DeleteEnhMetaFile error %d\n", GetLastError());
@ -138,13 +137,13 @@ index f464720..9247ac7 100644
+ ok(ret, "BeginPath error %d\n", GetLastError());
+
+ ret = ExtTextOutA(hdcMetafile, 11, 22, 0, NULL, "Test", 4, dx);
+todo_wine
+ ok(ret, "ExtTextOut error %d\n", GetLastError());
+
+ ret = EndPath(hdcMetafile);
+ ok(ret, "EndPath error %d\n", GetLastError());
+
+ ret = GetPath(hdcMetafile, NULL, NULL, 0);
+todo_wine
+ ok(!ret, "expected 0, got %d\n", ret);
+
+ hFont = SelectObject(hdcMetafile, hFont);
@ -167,5 +166,5 @@ index f464720..9247ac7 100644
ok(ret, "ReleaseDC error %d\n", GetLastError());
DestroyWindow(hwnd);
--
2.7.0
2.8.0

View File

@ -1,4 +1,4 @@
From 69c95a9f1db5c3e9d6958c0a994897bc5a51105d Mon Sep 17 00:00:00 2001
From 9d6023646b9d6ee4958d2de3a35d300f2f349ea2 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Sat, 20 Feb 2016 15:28:36 +0800
Subject: gdi32: ExtTextOut on a path with bitmap font selected shouldn't fail.
@ -6,14 +6,14 @@ Subject: gdi32: ExtTextOut on a path with bitmap font selected shouldn't fail.
This just leads to empty path generated.
---
dlls/gdi32/path.c | 2 +-
dlls/gdi32/tests/metafile.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
dlls/gdi32/tests/metafile.c | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index e09cd0b..8856d49 100644
index c6b87d4..9b8c9db 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -1525,7 +1525,7 @@ static BOOL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const REC
@@ -1481,7 +1481,7 @@ static BOOL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const REC
void *outline;
dwSize = GetGlyphOutlineW(dev->hdc, str[idx], ggo_flags, &gm, 0, NULL, &identity);
@ -23,10 +23,10 @@ index e09cd0b..8856d49 100644
/* add outline only if char is printable */
if(dwSize)
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index 9247ac7..e247db9 100644
index baeaa63..9d01ba8 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -2279,7 +2279,6 @@ static void test_emf_ExtTextOut_on_path(void)
@@ -2439,7 +2439,6 @@ static void test_emf_ExtTextOut_on_path(void)
ok(ret, "BeginPath error %d\n", GetLastError());
ret = ExtTextOutA(hdcDisplay, 11, 22, 0, NULL, "Test", 4, dx);
@ -34,6 +34,23 @@ index 9247ac7..e247db9 100644
ok(ret, "ExtTextOut error %d\n", GetLastError());
ret = EndPath(hdcDisplay);
@@ -2455,7 +2454,7 @@ todo_wine
ok(ret, "BeginPath error %d\n", GetLastError());
ret = ExtTextOutA(hdcMetafile, 11, 22, 0, NULL, "Test", 4, dx);
- todo_wine ok(ret, "ExtTextOut error %d\n", GetLastError());
+ ok(ret, "ExtTextOut error %d\n", GetLastError());
ret = EndPath(hdcMetafile);
ok(ret, "EndPath error %d\n", GetLastError());
@@ -2514,7 +2513,6 @@ todo_wine
ok(ret, "BeginPath error %d\n", GetLastError());
ret = ExtTextOutA(hdcMetafile, 11, 22, 0, NULL, "Test", 4, dx);
-todo_wine
ok(ret, "ExtTextOut error %d\n", GetLastError());
ret = EndPath(hdcMetafile);
--
2.7.0
2.8.0

View File

@ -1,4 +1,4 @@
From a141c787d896d28487556ef6808e7124c0c1e618 Mon Sep 17 00:00:00 2001
From 74903a2f465f98862457553f9d921db857a824ae Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 24 Feb 2016 11:58:41 +0800
Subject: gdi32/tests: Explicitly test BeginPath() return value in the metafile
@ -9,10 +9,10 @@ Subject: gdi32/tests: Explicitly test BeginPath() return value in the metafile
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index ce524f7..fd9893a 100644
index 9d01ba8..7781013 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -2805,7 +2805,8 @@ static void test_mf_GetPath(void)
@@ -2950,7 +2950,8 @@ static void test_mf_GetPath(void)
hdc = CreateMetaFileA(NULL);
ok(hdc != 0, "CreateMetaFileA error %d\n", GetLastError());
@ -22,7 +22,7 @@ index ce524f7..fd9893a 100644
ret = MoveToEx(hdc, 50, 50, NULL);
ok( ret, "MoveToEx error %d.\n", GetLastError());
ret = LineTo(hdc, 50, 150);
@@ -3581,7 +3582,8 @@ static void test_emf_GetPath(void)
@@ -3839,7 +3840,8 @@ static void test_emf_paths(void)
hdcMetafile = CreateEnhMetaFileA(GetDC(0), NULL, NULL, NULL);
ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError());
@ -33,5 +33,5 @@ index ce524f7..fd9893a 100644
ok( ret, "MoveToEx error %d.\n", GetLastError());
ret = LineTo(hdcMetafile, 50, 150);
--
2.7.1
2.8.0

View File

@ -1,392 +0,0 @@
From aad8c5691d2fd196c3f6f7f84d56e002f1a6ce0e Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Tue, 21 Jun 2016 11:39:41 +0800
Subject: gdi32: Add support for paths on a metafile HDC. (v5)
---
dlls/gdi32/enhmfdrv/dc.c | 4 +-
dlls/gdi32/path.c | 170 +++++++++++++++++++++++++++++++++++++++++---
dlls/gdi32/tests/metafile.c | 2 -
3 files changed, 164 insertions(+), 12 deletions(-)
diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c
index 8525067..7a31224 100644
--- a/dlls/gdi32/enhmfdrv/dc.c
+++ b/dlls/gdi32/enhmfdrv/dc.c
@@ -420,6 +420,7 @@ BOOL EMFDRV_AbortPath( PHYSDEV dev )
BOOL EMFDRV_BeginPath( PHYSDEV dev )
{
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pBeginPath );
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev;
EMRBEGINPATH emr;
@@ -428,7 +429,8 @@ BOOL EMFDRV_BeginPath( PHYSDEV dev )
emr.emr.iType = EMR_BEGINPATH;
emr.emr.nSize = sizeof(emr);
- return EMFDRV_WriteRecord( dev, &emr.emr );
+ if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
+ return next->funcs->pBeginPath( next );
}
BOOL EMFDRV_CloseFigure( PHYSDEV dev )
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index f3dc79b..65d79db 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -752,13 +752,21 @@ static BOOL pathdrv_AbortPath( PHYSDEV dev )
{
struct path_physdev *physdev = get_path_physdev( dev );
DC *dc = get_dc_ptr( dev->hdc );
+ BOOL ret = TRUE;
if (!dc) return FALSE;
+
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pAbortPath );
+ ret = next->funcs->pAbortPath( next );
+ }
+
free_gdi_path( physdev->path );
pop_dc_driver( dc, &path_driver );
HeapFree( GetProcessHeap(), 0, physdev );
release_dc_ptr( dc );
- return TRUE;
+ return ret;
}
@@ -769,13 +777,21 @@ static BOOL pathdrv_EndPath( PHYSDEV dev )
{
struct path_physdev *physdev = get_path_physdev( dev );
DC *dc = get_dc_ptr( dev->hdc );
+ BOOL ret = TRUE;
if (!dc) return FALSE;
+
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pEndPath );
+ ret = next->funcs->pEndPath( next );
+ }
+
dc->path = physdev->path;
pop_dc_driver( dc, &path_driver );
HeapFree( GetProcessHeap(), 0, physdev );
release_dc_ptr( dc );
- return TRUE;
+ return ret;
}
@@ -858,6 +874,13 @@ BOOL PATH_RestorePath( DC *dst, DC *src )
static BOOL pathdrv_MoveTo( PHYSDEV dev, INT x, INT y )
{
struct path_physdev *physdev = get_path_physdev( dev );
+
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pMoveTo );
+ if (!next->funcs->pMoveTo( next, x, y )) return FALSE;
+ }
+
physdev->path->newStroke = TRUE;
physdev->path->pos.x = x;
physdev->path->pos.y = y;
@@ -874,6 +897,12 @@ static BOOL pathdrv_LineTo( PHYSDEV dev, INT x, INT y )
struct path_physdev *physdev = get_path_physdev( dev );
POINT point;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pLineTo );
+ if (!next->funcs->pLineTo( next, x, y )) return FALSE;
+ }
+
point.x = x;
point.y = y;
return add_log_points_new_stroke( physdev, &point, 1, PT_LINETO );
@@ -893,6 +922,13 @@ static BOOL pathdrv_RoundRect( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2, INT
POINT corners[2], pointTemp;
FLOAT_POINT ellCorners[2];
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pRoundRect );
+ if (!next->funcs->pRoundRect( next, x1, y1, x2, y2, ell_width, ell_height ))
+ return FALSE;
+ }
+
PATH_CheckCorners(dev->hdc,corners,x1,y1,x2,y2);
/* Add points to the roundrect path */
@@ -942,6 +978,12 @@ static BOOL pathdrv_Rectangle( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2 )
POINT corners[2], points[4];
BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pRectangle );
+ if (!next->funcs->pRectangle( next, x1, y1, x2, y2 )) return FALSE;
+ }
+
PATH_CheckCorners(dev->hdc,corners,x1,y1,x2,y2);
points[0].x = corners[1].x;
@@ -1111,10 +1153,19 @@ static BOOL PATH_Arc( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2,
*/
static BOOL pathdrv_AngleArc( PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT eStartAngle, FLOAT eSweepAngle)
{
- int x1 = GDI_ROUND( x + cos(eStartAngle*M_PI/180) * radius );
- int y1 = GDI_ROUND( y - sin(eStartAngle*M_PI/180) * radius );
- int x2 = GDI_ROUND( x + cos((eStartAngle+eSweepAngle)*M_PI/180) * radius );
- int y2 = GDI_ROUND( y - sin((eStartAngle+eSweepAngle)*M_PI/180) * radius );
+ int x1, x2, y1, y2;
+
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pAngleArc );
+ if (!next->funcs->pAngleArc( next, x, y, radius, eStartAngle, eSweepAngle ))
+ return FALSE;
+ }
+
+ x1 = GDI_ROUND( x + cos(eStartAngle*M_PI/180) * radius );
+ y1 = GDI_ROUND( y - sin(eStartAngle*M_PI/180) * radius );
+ x2 = GDI_ROUND( x + cos((eStartAngle+eSweepAngle)*M_PI/180) * radius );
+ y2 = GDI_ROUND( y - sin((eStartAngle+eSweepAngle)*M_PI/180) * radius );
return PATH_Arc( dev, x-radius, y-radius, x+radius, y+radius, x1, y1, x2, y2,
eSweepAngle >= 0 ? AD_COUNTERCLOCKWISE : AD_CLOCKWISE, -1 );
}
@@ -1126,6 +1177,13 @@ static BOOL pathdrv_AngleArc( PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT eSt
static BOOL pathdrv_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pArc );
+ if (!next->funcs->pArc( next, left, top, right, bottom, xstart, ystart, xend, yend ))
+ return FALSE;
+ }
+
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
GetArcDirection( dev->hdc ), 0 );
}
@@ -1137,6 +1195,13 @@ static BOOL pathdrv_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
static BOOL pathdrv_ArcTo( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pArcTo );
+ if (!next->funcs->pArcTo( next, left, top, right, bottom, xstart, ystart, xend, yend ))
+ return FALSE;
+ }
+
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
GetArcDirection( dev->hdc ), -1 );
}
@@ -1148,6 +1213,13 @@ static BOOL pathdrv_ArcTo( PHYSDEV dev, INT left, INT top, INT right, INT bottom
static BOOL pathdrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pChord );
+ if (!next->funcs->pChord( next, left, top, right, bottom, xstart, ystart, xend, yend ))
+ return FALSE;
+ }
+
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
GetArcDirection( dev->hdc ), 1 );
}
@@ -1159,6 +1231,13 @@ static BOOL pathdrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom
static BOOL pathdrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPie );
+ if (!next->funcs->pPie( next, left, top, right, bottom, xstart, ystart, xend, yend ))
+ return FALSE;
+ }
+
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
GetArcDirection( dev->hdc ), 2 );
}
@@ -1169,6 +1248,13 @@ static BOOL pathdrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
*/
static BOOL pathdrv_Ellipse( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2 )
{
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pEllipse );
+ if (!next->funcs->pEllipse( next, x1, y1, x2, y2 ))
+ return FALSE;
+ }
+
return PATH_Arc( dev, x1, y1, x2, y2, x1, (y1+y2)/2, x1, (y1+y2)/2, GetArcDirection( dev->hdc ), 1 );
}
@@ -1180,6 +1266,13 @@ static BOOL pathdrv_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD cbPoints
{
struct path_physdev *physdev = get_path_physdev( dev );
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyBezierTo );
+ if (!next->funcs->pPolyBezierTo( next, pts, cbPoints ))
+ return FALSE;
+ }
+
return add_log_points_new_stroke( physdev, pts, cbPoints, PT_BEZIERTO );
}
@@ -1190,8 +1283,16 @@ static BOOL pathdrv_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD cbPoints
static BOOL pathdrv_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD cbPoints )
{
struct path_physdev *physdev = get_path_physdev( dev );
- BYTE *type = add_log_points( physdev, pts, cbPoints, PT_BEZIERTO );
+ BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyBezier );
+ if (!next->funcs->pPolyBezier( next, pts, cbPoints ))
+ return FALSE;
+ }
+
+ type = add_log_points( physdev, pts, cbPoints, PT_BEZIERTO );
if (!type) return FALSE;
type[0] = PT_MOVETO;
return TRUE;
@@ -1208,6 +1309,13 @@ static BOOL pathdrv_PolyDraw( PHYSDEV dev, const POINT *pts, const BYTE *types,
POINT orig_pos;
INT i, lastmove = 0;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyDraw );
+ if (!next->funcs->pPolyDraw( next, pts, types, cbPoints ))
+ return FALSE;
+ }
+
for (i = 0; i < path->count; i++) if (path->flags[i] == PT_MOVETO) lastmove = i;
orig_pos = path->pos;
@@ -1260,8 +1368,16 @@ static BOOL pathdrv_PolyDraw( PHYSDEV dev, const POINT *pts, const BYTE *types,
static BOOL pathdrv_Polyline( PHYSDEV dev, const POINT *pts, INT cbPoints )
{
struct path_physdev *physdev = get_path_physdev( dev );
- BYTE *type = add_log_points( physdev, pts, cbPoints, PT_LINETO );
+ BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyline );
+ if (!next->funcs->pPolyline( next, pts, cbPoints ))
+ return FALSE;
+ }
+
+ type = add_log_points( physdev, pts, cbPoints, PT_LINETO );
if (!type) return FALSE;
if (cbPoints) type[0] = PT_MOVETO;
return TRUE;
@@ -1275,6 +1391,13 @@ static BOOL pathdrv_PolylineTo( PHYSDEV dev, const POINT *pts, INT cbPoints )
{
struct path_physdev *physdev = get_path_physdev( dev );
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolylineTo );
+ if (!next->funcs->pPolylineTo( next, pts, cbPoints ))
+ return FALSE;
+ }
+
return add_log_points_new_stroke( physdev, pts, cbPoints, PT_LINETO );
}
@@ -1285,8 +1408,16 @@ static BOOL pathdrv_PolylineTo( PHYSDEV dev, const POINT *pts, INT cbPoints )
static BOOL pathdrv_Polygon( PHYSDEV dev, const POINT *pts, INT cbPoints )
{
struct path_physdev *physdev = get_path_physdev( dev );
- BYTE *type = add_log_points( physdev, pts, cbPoints, PT_LINETO );
+ BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolygon );
+ if (!next->funcs->pPolygon( next, pts, cbPoints ))
+ return FALSE;
+ }
+
+ type = add_log_points( physdev, pts, cbPoints, PT_LINETO );
if (!type) return FALSE;
if (cbPoints) type[0] = PT_MOVETO;
if (cbPoints > 1) type[cbPoints - 1] = PT_LINETO | PT_CLOSEFIGURE;
@@ -1303,6 +1434,13 @@ static BOOL pathdrv_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* count
UINT poly;
BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyPolygon );
+ if (!next->funcs->pPolyPolygon( next, pts, counts, polygons ))
+ return FALSE;
+ }
+
for(poly = 0; poly < polygons; poly++) {
type = add_log_points( physdev, pts, counts[poly], PT_LINETO );
if (!type) return FALSE;
@@ -1324,6 +1462,13 @@ static BOOL pathdrv_PolyPolyline( PHYSDEV dev, const POINT* pts, const DWORD* co
UINT poly, count;
BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyPolyline );
+ if (!next->funcs->pPolyPolyline( next, pts, counts, polylines ))
+ return FALSE;
+ }
+
for (poly = count = 0; poly < polylines; poly++) count += counts[poly];
type = add_log_points( physdev, pts, count, PT_LINETO );
@@ -1472,6 +1617,13 @@ static BOOL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const REC
unsigned int idx, ggo_flags = GGO_NATIVE;
POINT offset = {0, 0};
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pExtTextOut );
+ if (!next->funcs->pExtTextOut( next, x, y, flags, lprc, str, count, dx ))
+ return FALSE;
+ }
+
if (!count) return TRUE;
if (flags & ETO_GLYPH_INDEX) ggo_flags |= GGO_GLYPH_INDEX;
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index 4bd4778..d3848b0 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -2460,7 +2460,6 @@ static void test_emf_ExtTextOut_on_path(void)
ok(ret, "EndPath error %d\n", GetLastError());
ret = GetPath(hdcMetafile, NULL, NULL, 0);
-todo_wine
ok(!ret, "expected 0, got %d\n", ret);
hMetafile = CloseEnhMetaFile(hdcMetafile);
@@ -2520,7 +2519,6 @@ todo_wine
ok(ret, "EndPath error %d\n", GetLastError());
ret = GetPath(hdcMetafile, NULL, NULL, 0);
-todo_wine
ok(!ret, "expected 0, got %d\n", ret);
hFont = SelectObject(hdcMetafile, hFont);
--
2.8.0

View File

@ -1 +0,0 @@
Fixes: [39185] Add support for paths on a metafile HDC

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "025c54344230ca8b32e80f08b9af13a16dfd2445"
echo "9c1fbe509576d7cbaada3af9736888cfa1d02847"
}
# Show version information
@ -3720,22 +3720,17 @@ fi
# Patchset gdi32-Path_Metafile
# |
# | This patchset fixes the following Wine bugs:
# | * [#39185] Add support for paths on a metafile HDC
# |
# | Modified files:
# | * dlls/gdi32/enhmfdrv/dc.c, dlls/gdi32/path.c, dlls/gdi32/tests/metafile.c
# | * dlls/gdi32/path.c, dlls/gdi32/tests/metafile.c
# |
if test "$enable_gdi32_Path_Metafile" -eq 1; then
patch_apply gdi32-Path_Metafile/0001-gdi32-tests-Add-some-additional-tests-for-ExtExtOut-.patch
patch_apply gdi32-Path_Metafile/0002-gdi32-ExtTextOut-on-a-path-with-bitmap-font-selected.patch
patch_apply gdi32-Path_Metafile/0003-gdi32-tests-Explicitly-test-BeginPath-return-value-i.patch
patch_apply gdi32-Path_Metafile/0004-gdi32-Add-support-for-paths-on-a-metafile-HDC.-v2.patch
(
echo '+ { "Dmitry Timoshkov", "gdi32/tests: Add some additional tests for ExtExtOut on a path for an EMF DC.", 1 },';
echo '+ { "Dmitry Timoshkov", "gdi32/tests: Add some additional tests for ExtExtOut on a path for an EMF DC.", 2 },';
echo '+ { "Dmitry Timoshkov", "gdi32: ExtTextOut on a path with bitmap font selected shouldn'\''t fail.", 1 },';
echo '+ { "Dmitry Timoshkov", "gdi32/tests: Explicitly test BeginPath() return value in the metafile path tests.", 1 },';
echo '+ { "Dmitry Timoshkov", "gdi32: Add support for paths on a metafile HDC.", 5 },';
) >> "$patchlist"
fi

View File

@ -1,4 +1,4 @@
From a0ee8c9dc2a5cde4458088ec20f6abe1c497ea24 Mon Sep 17 00:00:00 2001
From fadbf97ae4a90df1342e5bc07707a8e8ee5bbd4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 20 Dec 2012 13:09:17 +0100
Subject: wined3d: Move the framebuffer into wined3d_state
@ -20,7 +20,7 @@ Subject: wined3d: Move the framebuffer into wined3d_state
13 files changed, 178 insertions(+), 120 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 11dac92..01367b8 100644
index 6a1c9d6..ef9e462 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -704,7 +704,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv,
@ -42,10 +42,10 @@ index 11dac92..01367b8 100644
}
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 65e6bcc..c6b776a 100644
index d49e2d0..f2425df 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1680,6 +1680,11 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
@@ -1699,6 +1699,11 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
goto out;
}
@ -57,7 +57,7 @@ index 65e6bcc..c6b776a 100644
/* Initialize the texture unit mapping to a 1:1 mapping */
for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s)
{
@@ -1984,6 +1989,7 @@ out:
@@ -2003,6 +2008,7 @@ out:
if (hdc) wined3d_release_dc(swapchain->win_handle, hdc);
device->shader_backend->shader_free_context_data(ret);
device->adapter->fragment_pipe->free_context_data(ret);
@ -65,7 +65,7 @@ index 65e6bcc..c6b776a 100644
HeapFree(GetProcessHeap(), 0, ret->free_event_queries);
HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries);
HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries);
@@ -2020,6 +2026,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont
@@ -2039,6 +2045,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont
device->shader_backend->shader_free_context_data(context);
device->adapter->fragment_pipe->free_context_data(context);
HeapFree(GetProcessHeap(), 0, context->fbo_key);
@ -73,7 +73,7 @@ index 65e6bcc..c6b776a 100644
HeapFree(GetProcessHeap(), 0, context->draw_buffers);
HeapFree(GetProcessHeap(), 0, context->blit_targets);
device_context_remove(device, context);
@@ -2556,7 +2563,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
@@ -2575,7 +2582,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
DWORD rt_mask = 0, *cur_mask;
UINT i;
@ -82,7 +82,7 @@ index 65e6bcc..c6b776a 100644
|| rt_count != gl_info->limits.buffers)
{
if (!context_validate_rt_config(rt_count, rts, dsv))
@@ -2601,6 +2608,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
@@ -2620,6 +2627,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
rt_mask = context_generate_rt_mask_no_fbo(context,
rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL);
}
@ -91,7 +91,7 @@ index 65e6bcc..c6b776a 100644
}
else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
&& (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource)))
@@ -2658,7 +2667,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
@@ -2677,7 +2686,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_state *state)
{
@ -100,7 +100,7 @@ index 65e6bcc..c6b776a 100644
struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL];
DWORD rt_mask, rt_mask_bits;
unsigned int i;
@@ -2688,7 +2697,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const
@@ -2707,7 +2716,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const
void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
DWORD rt_mask = find_draw_buffers_mask(context, state);
@ -109,7 +109,7 @@ index 65e6bcc..c6b776a 100644
DWORD *cur_mask;
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
@@ -2719,6 +2728,8 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat
@@ -2738,6 +2747,8 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat
context_apply_draw_buffers(context, rt_mask);
*cur_mask = rt_mask;
}
@ -118,7 +118,7 @@ index 65e6bcc..c6b776a 100644
}
static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit)
@@ -3366,7 +3377,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context,
@@ -3369,7 +3380,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context,
const struct wined3d_device *device, const struct wined3d_state *state)
{
const struct StateEntry *state_table = context->state_table;
@ -128,10 +128,10 @@ index 65e6bcc..c6b776a 100644
WORD map;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index a5d0269..14dfefb 100644
index d74b312..433145e 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -286,7 +286,7 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -288,7 +288,7 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
device = cs->device;
wined3d_get_draw_rect(&device->state, &draw_rect);
device_clear_render_targets(device, device->adapter->gl_info.limits.buffers,
@ -140,7 +140,7 @@ index a5d0269..14dfefb 100644
&op->color, op->depth, op->stencil);
}
@@ -393,7 +393,7 @@ static void wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const v
@@ -396,7 +396,7 @@ static void wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const v
{
const struct wined3d_cs_set_rendertarget_view *op = data;
@ -149,7 +149,7 @@ index a5d0269..14dfefb 100644
device_invalidate_state(cs->device, STATE_FRAMEBUFFER);
}
@@ -416,7 +416,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
@@ -419,7 +419,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
struct wined3d_device *device = cs->device;
struct wined3d_rendertarget_view *prev;
@ -158,7 +158,7 @@ index a5d0269..14dfefb 100644
{
struct wined3d_surface *prev_surface = wined3d_rendertarget_view_get_surface(prev);
@@ -432,7 +432,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
@@ -435,7 +435,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
}
}
@ -167,7 +167,7 @@ index a5d0269..14dfefb 100644
if (!prev != !op->view)
{
@@ -999,11 +999,13 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1004,11 +1004,13 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
{
struct wined3d_adapter *adapter = cs->device->adapter;
@ -183,7 +183,7 @@ index a5d0269..14dfefb 100644
}
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1084,15 +1086,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1089,15 +1091,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs))))
return NULL;
@ -201,7 +201,7 @@ index a5d0269..14dfefb 100644
cs->ops = &wined3d_cs_st_ops;
cs->device = device;
@@ -1100,7 +1100,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1105,7 +1105,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size)))
{
state_cleanup(&cs->state);
@ -209,7 +209,7 @@ index a5d0269..14dfefb 100644
HeapFree(GetProcessHeap(), 0, cs);
return NULL;
}
@@ -1111,7 +1110,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1116,7 +1115,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
void wined3d_cs_destroy(struct wined3d_cs *cs)
{
state_cleanup(&cs->state);
@ -218,10 +218,10 @@ index a5d0269..14dfefb 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 040f5ea..2d11549 100644
index 7bec75a..c72c8b2 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -978,7 +978,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi
@@ -987,7 +987,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi
BOOL ds_enable = !!swapchain->desc.enable_auto_depth_stencil;
unsigned int i;
@ -230,7 +230,7 @@ index 040f5ea..2d11549 100644
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -996,7 +996,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
@@ -1005,7 +1005,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
struct wined3d_swapchain_desc *swapchain_desc)
{
static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f};
@ -238,7 +238,7 @@ index 040f5ea..2d11549 100644
struct wined3d_swapchain *swapchain = NULL;
struct wined3d_context *context;
DWORD clear_flags = 0;
@@ -1009,9 +1008,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
@@ -1018,9 +1017,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
if (device->wined3d->flags & WINED3D_NO3D)
return WINED3DERR_INVALIDCALL;
@ -248,7 +248,7 @@ index 040f5ea..2d11549 100644
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
device->adapter->vertex_pipe, device->adapter->fragment_pipe)))
{
@@ -1085,7 +1081,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
@@ -1095,7 +1091,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
return WINED3D_OK;
err_out:
@ -256,7 +256,7 @@ index 040f5ea..2d11549 100644
HeapFree(GetProcessHeap(), 0, device->swapchains);
device->swapchain_count = 0;
if (device->back_buffer_view)
@@ -1163,8 +1158,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -1173,8 +1168,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
if (device->cursor_texture)
wined3d_texture_decref(device->cursor_texture);
@ -282,7 +282,7 @@ index 040f5ea..2d11549 100644
/* Unload resources */
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
@@ -1195,37 +1207,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -1205,37 +1217,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
* destroy the context. */
context_release(context);
@ -320,7 +320,7 @@ index 040f5ea..2d11549 100644
if (device->back_buffer_view)
{
wined3d_rendertarget_view_decref(device->back_buffer_view);
@@ -1243,9 +1224,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -1253,9 +1234,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
device->swapchains = NULL;
device->swapchain_count = 0;
@ -330,7 +330,7 @@ index 040f5ea..2d11549 100644
device->d3d_initialized = FALSE;
return WINED3D_OK;
@@ -2057,7 +2035,7 @@ static void resolve_depth_buffer(struct wined3d_state *state)
@@ -2072,7 +2050,7 @@ static void resolve_depth_buffer(struct wined3d_state *state)
|| !(dst_texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH))
return;
@ -339,7 +339,7 @@ index 040f5ea..2d11549 100644
return;
if (src_view->resource->type == WINED3D_RTYPE_BUFFER)
{
@@ -3426,6 +3404,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
@@ -3441,6 +3419,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count,
const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
{
@ -348,7 +348,7 @@ index 040f5ea..2d11549 100644
TRACE("device %p, rect_count %u, rects %p, flags %#x, color %s, depth %.8e, stencil %u.\n",
device, rect_count, rects, flags, debug_color(color), depth, stencil);
@@ -3437,7 +3417,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3452,7 +3432,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
{
@ -357,7 +357,7 @@ index 040f5ea..2d11549 100644
if (!ds)
{
WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
@@ -3446,8 +3426,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3461,8 +3441,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
}
else if (flags & WINED3DCLEAR_TARGET)
{
@ -368,7 +368,7 @@ index 040f5ea..2d11549 100644
{
WARN("Silently ignoring depth and target clear with mismatching sizes\n");
return WINED3D_OK;
@@ -3777,8 +3757,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
@@ -3793,8 +3773,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE]
|| state->render_states[WINED3D_RS_STENCILENABLE])
{
@ -379,7 +379,7 @@ index 040f5ea..2d11549 100644
if (ds && rt && (ds->width < rt->width || ds->height < rt->height))
{
@@ -4236,20 +4216,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
@@ -4252,20 +4232,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
return NULL;
}
@ -403,7 +403,7 @@ index 040f5ea..2d11549 100644
TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n",
device, view_idx, view, set_viewport);
@@ -4289,13 +4270,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4305,13 +4286,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
}
@ -419,7 +419,7 @@ index 040f5ea..2d11549 100644
wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view);
/* Release after the assignment, to prevent device_resource_released()
* from seeing the surface as still in use. */
@@ -4307,18 +4288,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4323,18 +4304,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
{
@ -441,7 +441,7 @@ index 040f5ea..2d11549 100644
wined3d_rendertarget_view_incref(view);
wined3d_cs_emit_set_depth_stencil_view(device->cs, view);
if (prev)
@@ -4681,10 +4663,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4697,10 +4679,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_texture_decref(device->cursor_texture);
device->cursor_texture = NULL;
}
@ -453,7 +453,7 @@ index 040f5ea..2d11549 100644
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -4693,6 +4674,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4709,6 +4690,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
}
wined3d_device_set_depth_stencil_view(device, NULL);
@ -465,7 +465,7 @@ index 040f5ea..2d11549 100644
if (device->onscreen_depth_stencil)
{
wined3d_texture_decref(device->onscreen_depth_stencil->container);
@@ -4916,30 +4902,30 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4934,30 +4920,30 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if (device->d3d_initialized)
delete_opengl_contexts(device, swapchain);
@ -504,7 +504,7 @@ index 040f5ea..2d11549 100644
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}
@@ -5031,11 +5017,11 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
@@ -5049,11 +5035,11 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@ -518,7 +518,7 @@ index 040f5ea..2d11549 100644
ERR("Resource %p is still in use as depth/stencil buffer.\n", resource);
switch (type)
@@ -5171,8 +5157,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
@@ -5189,8 +5175,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
device->blitter = adapter->blitter;
@ -534,12 +534,12 @@ index 040f5ea..2d11549 100644
if (!(device->cs = wined3d_cs_create(device)))
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 9103d42..0b67c48 100644
index dd82654..dd0f1d9 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -411,7 +411,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
unsigned int start_idx, unsigned int index_count, unsigned int start_instance,
unsigned int instance_count, BOOL indexed)
@@ -412,7 +412,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
unsigned int start_instance, unsigned int instance_count, BOOL indexed)
{
- const struct wined3d_fb_state *fb = state->fb;
+ const struct wined3d_fb_state *fb = &state->fb;
@ -547,10 +547,10 @@ index 9103d42..0b67c48 100644
struct wined3d_event_query *ib_query = NULL;
struct wined3d_stream_info si_emulated;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 0d9c044..0216baf 100644
index 889342d..5cfc3c9 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1448,7 +1448,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1470,7 +1470,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
const struct wined3d_vec4 correction_params =
{
/* Position is relative to the framebuffer, not the viewport. */
@ -560,10 +560,10 @@ index 0d9c044..0216baf 100644
0.0f,
0.0f,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index ef2f70b..51c0b5c 100644
index 33c6280..9b0c811 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -2923,7 +2923,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
@@ -2943,7 +2943,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
UINT i;
memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
@ -573,7 +573,7 @@ index ef2f70b..51c0b5c 100644
static unsigned int warned = 0;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index e4a089c..799d736 100644
index bd0eba2..ed578b8 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -105,7 +105,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_
@ -639,7 +639,7 @@ index e4a089c..799d736 100644
float scale;
union
@@ -4572,8 +4572,8 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine
@@ -4580,8 +4580,8 @@ 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)
{
@ -650,7 +650,7 @@ index e4a089c..799d736 100644
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_viewport vp = state->viewport;
unsigned int width, height;
@@ -4759,7 +4759,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
@@ -4767,7 +4767,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
}
else
{
@ -659,7 +659,7 @@ index e4a089c..799d736 100644
UINT height;
UINT width;
@@ -4827,7 +4827,7 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state
@@ -4835,7 +4835,7 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
@ -669,7 +669,7 @@ index e4a089c..799d736 100644
else
gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB);
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index cb5a141..1a65698 100644
index bb15995..08f5ed5 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -430,6 +430,7 @@ void state_unbind_resources(struct wined3d_state *state)
@ -721,7 +721,7 @@ index cb5a141..1a65698 100644
}
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
@@ -1241,32 +1269,41 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
@@ -1244,32 +1272,41 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
}
}
@ -795,10 +795,10 @@ index aba7ac0..92abd3b 100644
struct wined3d_texture *logo_texture;
struct wined3d_context *context;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index f85fcc9..92e0b7b 100644
index 878de10..2da8399 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4320,7 +4320,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
@@ -4465,7 +4465,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
float y_offset = context->render_offscreen
? (center_offset - (2.0f * y) - h) / h
: (center_offset - (2.0f * y) - h) / -h;
@ -807,7 +807,7 @@ index f85fcc9..92e0b7b 100644
state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE;
float z_scale = zenable ? 2.0f : 0.0f;
float z_offset = zenable ? -1.0f : 0.0f;
@@ -5117,7 +5117,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
@@ -5262,7 +5262,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
break;
}
}
@ -817,10 +817,10 @@ index f85fcc9..92e0b7b 100644
|| !state->render_states[WINED3D_RS_CLIPPLANEENABLE])
{
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7d202b6..ad7e89c 100644
index 45e4714..e804970 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1341,6 +1341,36 @@ struct wined3d_timestamp_query
@@ -1354,6 +1354,36 @@ struct wined3d_timestamp_query
void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
@ -857,7 +857,7 @@ index 7d202b6..ad7e89c 100644
struct wined3d_context
{
const struct wined3d_gl_info *gl_info;
@@ -1355,6 +1385,7 @@ struct wined3d_context
@@ -1368,6 +1398,7 @@ struct wined3d_context
DWORD dirtyArray[STATE_HIGHEST + 1]; /* Won't get bigger than that, a state is never marked dirty 2 times */
DWORD numDirtyEntries;
DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */
@ -865,7 +865,7 @@ index 7d202b6..ad7e89c 100644
struct wined3d_swapchain *swapchain;
struct
@@ -1462,12 +1493,6 @@ struct wined3d_context
@@ -1475,12 +1506,6 @@ struct wined3d_context
GLuint dummy_arbfp_prog;
};
@ -878,7 +878,7 @@ index 7d202b6..ad7e89c 100644
typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
struct StateEntry
@@ -2218,7 +2243,7 @@ struct wined3d_stream_state
@@ -2239,7 +2264,7 @@ struct wined3d_stream_state
struct wined3d_state
{
DWORD flags;
@ -887,7 +887,7 @@ index 7d202b6..ad7e89c 100644
struct wined3d_vertex_declaration *vertex_declaration;
struct wined3d_stream_output stream_output[MAX_STREAM_OUT];
@@ -2321,7 +2346,6 @@ struct wined3d_device
@@ -2343,7 +2368,6 @@ struct wined3d_device
struct wine_rb_tree samplers;
/* Render Target Support */
@ -895,7 +895,7 @@ index 7d202b6..ad7e89c 100644
struct wined3d_surface *onscreen_depth_stencil;
struct wined3d_rendertarget_view *auto_depth_stencil_view;
@@ -2856,9 +2880,8 @@ struct wined3d_stateblock
@@ -2879,9 +2903,8 @@ struct wined3d_stateblock
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -907,7 +907,7 @@ index 7d202b6..ad7e89c 100644
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
struct wined3d_cs_ops
@@ -2871,7 +2894,6 @@ struct wined3d_cs
@@ -2894,7 +2917,6 @@ struct wined3d_cs
{
const struct wined3d_cs_ops *ops;
struct wined3d_device *device;

View File

@ -1,4 +1,4 @@
From 34fd405a87bdc2ac8b528488c5738ff57c644190 Mon Sep 17 00:00:00 2001
From 56cb75721dc3a1a1e4f9866ec2cc24ab627e84da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 14:31:56 +0200
Subject: wined3d: Hackily introduce a multithreaded command stream
@ -10,7 +10,7 @@ Subject: wined3d: Hackily introduce a multithreaded command stream
3 files changed, 357 insertions(+), 27 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 3150f25..d92ce21 100644
index 433145e..cd59c60 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -24,8 +24,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
@ -52,7 +52,7 @@ index 3150f25..d92ce21 100644
};
struct wined3d_cs_present
@@ -250,7 +273,134 @@ struct wined3d_cs_reset_state
@@ -252,7 +275,134 @@ struct wined3d_cs_reset_state
enum wined3d_cs_op opcode;
};
@ -188,7 +188,7 @@ index 3150f25..d92ce21 100644
{
const struct wined3d_cs_present *op = data;
struct wined3d_swapchain *swapchain;
@@ -259,6 +409,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
@@ -261,6 +411,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
wined3d_swapchain_set_window(swapchain, op->dst_window_override);
swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags);
@ -197,7 +197,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
@@ -277,17 +429,20 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -279,17 +431,20 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
cs->ops->submit(cs);
}
@ -219,7 +219,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
@@ -307,12 +462,14 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -309,12 +464,14 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
cs->ops->submit(cs);
}
@ -228,14 +228,14 @@ index 3150f25..d92ce21 100644
{
const struct wined3d_cs_draw *op = data;
draw_primitive(cs->device, &cs->device->state, op->start_idx, op->index_count,
op->start_instance, op->instance_count, op->indexed);
draw_primitive(cs->device, &cs->device->state, op->base_vertex_idx, op->start_idx,
op->index_count, op->start_instance, op->instance_count, op->indexed);
+
+ return sizeof(*op);
}
void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_count,
@@ -331,12 +488,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx,
@@ -334,12 +491,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
cs->ops->submit(cs);
}
@ -251,7 +251,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value)
@@ -351,12 +510,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -354,12 +513,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
cs->ops->submit(cs);
}
@ -267,7 +267,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport)
@@ -370,12 +531,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -373,12 +534,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
cs->ops->submit(cs);
}
@ -283,7 +283,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -389,12 +552,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -392,12 +555,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
cs->ops->submit(cs);
}
@ -299,7 +299,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx,
@@ -410,7 +575,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -413,7 +578,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
cs->ops->submit(cs);
}
@ -308,7 +308,7 @@ index 3150f25..d92ce21 100644
{
const struct wined3d_cs_set_depth_stencil_view *op = data;
struct wined3d_device *device = cs->device;
@@ -449,6 +614,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
@@ -452,6 +617,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
}
device_invalidate_state(device, STATE_FRAMEBUFFER);
@ -317,7 +317,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view)
@@ -462,12 +629,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -465,12 +632,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
cs->ops->submit(cs);
}
@ -333,7 +333,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration)
@@ -481,7 +650,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -484,7 +653,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
cs->ops->submit(cs);
}
@ -342,7 +342,7 @@ index 3150f25..d92ce21 100644
{
const struct wined3d_cs_set_stream_source *op = data;
struct wined3d_stream_state *stream;
@@ -499,6 +668,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void
@@ -502,6 +671,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void
InterlockedDecrement(&prev->resource.bind_count);
device_invalidate_state(cs->device, STATE_STREAMSRC);
@ -351,7 +351,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -516,7 +687,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -519,7 +690,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
cs->ops->submit(cs);
}
@ -360,7 +360,7 @@ index 3150f25..d92ce21 100644
{
const struct wined3d_cs_set_stream_source_freq *op = data;
struct wined3d_stream_state *stream;
@@ -526,6 +697,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const
@@ -529,6 +700,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const
stream->flags = op->flags;
device_invalidate_state(cs->device, STATE_STREAMSRC);
@ -369,7 +369,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags)
@@ -541,7 +714,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -544,7 +717,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
cs->ops->submit(cs);
}
@ -378,7 +378,7 @@ index 3150f25..d92ce21 100644
{
const struct wined3d_cs_set_stream_output *op = data;
struct wined3d_stream_output *stream;
@@ -556,6 +729,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
@@ -559,6 +732,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
InterlockedIncrement(&op->buffer->resource.bind_count);
if (prev)
InterlockedDecrement(&prev->resource.bind_count);
@ -387,7 +387,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -572,7 +747,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -575,7 +750,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
cs->ops->submit(cs);
}
@ -396,7 +396,7 @@ index 3150f25..d92ce21 100644
{
const struct wined3d_cs_set_index_buffer *op = data;
struct wined3d_buffer *prev;
@@ -587,6 +762,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *
@@ -591,6 +766,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *
InterlockedDecrement(&prev->resource.bind_count);
device_invalidate_state(cs->device, STATE_INDEXBUFFER);
@ -405,7 +405,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
@@ -602,7 +779,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -607,7 +784,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
cs->ops->submit(cs);
}
@ -414,7 +414,7 @@ index 3150f25..d92ce21 100644
{
const struct wined3d_cs_set_constant_buffer *op = data;
struct wined3d_buffer *prev;
@@ -616,6 +793,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi
@@ -621,6 +798,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi
InterlockedDecrement(&prev->resource.bind_count);
device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type));
@ -422,7 +422,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -632,7 +810,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -637,7 +815,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
cs->ops->submit(cs);
}
@ -431,7 +431,7 @@ index 3150f25..d92ce21 100644
{
const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info;
const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info;
@@ -709,6 +887,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -714,6 +892,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
if (new_use_color_key)
device_invalidate_state(cs->device, STATE_COLOR_KEY);
@ -440,7 +440,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture)
@@ -723,12 +903,14 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -728,12 +908,14 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
cs->ops->submit(cs);
}
@ -456,7 +456,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -745,12 +927,14 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -750,12 +932,14 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
cs->ops->submit(cs);
}
@ -472,7 +472,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -767,13 +951,15 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -772,13 +956,15 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
cs->ops->submit(cs);
}
@ -489,7 +489,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader)
@@ -788,12 +974,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -793,12 +979,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
cs->ops->submit(cs);
}
@ -505,7 +505,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value)
@@ -808,12 +996,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -813,12 +1001,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
cs->ops->submit(cs);
}
@ -521,7 +521,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -830,12 +1020,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -835,12 +1025,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
cs->ops->submit(cs);
}
@ -537,7 +537,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -852,13 +1044,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -857,13 +1049,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
cs->ops->submit(cs);
}
@ -554,7 +554,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state,
@@ -874,12 +1068,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -879,12 +1073,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
cs->ops->submit(cs);
}
@ -570,7 +570,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane)
@@ -894,7 +1090,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -899,7 +1095,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
cs->ops->submit(cs);
}
@ -579,7 +579,7 @@ index 3150f25..d92ce21 100644
{
const struct wined3d_cs_set_color_key *op = data;
struct wined3d_texture *texture = op->texture;
@@ -955,6 +1151,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
@@ -960,6 +1156,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
break;
}
}
@ -588,7 +588,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture,
@@ -977,12 +1175,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -982,12 +1180,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
cs->ops->submit(cs);
}
@ -604,7 +604,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material)
@@ -996,7 +1196,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1001,7 +1201,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
cs->ops->submit(cs);
}
@ -613,7 +613,7 @@ index 3150f25..d92ce21 100644
{
struct wined3d_adapter *adapter = cs->device->adapter;
HRESULT hr;
@@ -1006,6 +1206,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1011,6 +1211,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
if (FAILED(hr = state_init(&cs->state, &adapter->gl_info, &adapter->d3d_info,
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
ERR("Failed to initialize CS state, hr %#x.\n", hr);
@ -622,7 +622,7 @@ index 3150f25..d92ce21 100644
}
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1018,8 +1220,9 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1023,8 +1225,9 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
cs->ops->submit(cs);
}
@ -633,7 +633,7 @@ index 3150f25..d92ce21 100644
/* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present,
/* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear,
/* WINED3D_CS_OP_DRAW */ wined3d_cs_exec_draw,
@@ -1078,6 +1281,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -1083,6 +1286,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
wined3d_cs_st_submit,
};
@ -692,7 +692,7 @@ index 3150f25..d92ce21 100644
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -1103,12 +1358,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1109,12 +1364,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return NULL;
}
@ -754,7 +754,7 @@ index 3150f25..d92ce21 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
index 9d1c11d..2415aed 100644
index 434d32e..beeb9fa 100644
--- a/dlls/wined3d/wined3d_main.c
+++ b/dlls/wined3d/wined3d_main.c
@@ -90,6 +90,7 @@ struct wined3d_settings wined3d_settings =
@ -781,10 +781,10 @@ index 9d1c11d..2415aed 100644
if (appkey) RegCloseKey( appkey );
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 2fffc07..4e3a326 100644
index 427a119..84405f2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -302,6 +302,7 @@ struct wined3d_settings
@@ -309,6 +309,7 @@ struct wined3d_settings
unsigned int max_sm_gs;
unsigned int max_sm_ps;
BOOL no_3d;
@ -792,7 +792,7 @@ index 2fffc07..4e3a326 100644
};
extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;
@@ -2862,6 +2863,18 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl
@@ -2907,6 +2908,18 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl
const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN;
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -811,7 +811,7 @@ index 2fffc07..4e3a326 100644
struct wined3d_cs_ops
{
void *(*require_space)(struct wined3d_cs *cs, size_t size);
@@ -2873,9 +2886,14 @@ struct wined3d_cs
@@ -2918,9 +2931,14 @@ struct wined3d_cs
const struct wined3d_cs_ops *ops;
struct wined3d_device *device;
struct wined3d_state state;

View File

@ -1,4 +1,4 @@
From c7b4f23f1e496b7cf3ee419e9f33fa308b297113 Mon Sep 17 00:00:00 2001
From cdd637351cebe6fec79d281710138246e7367c85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 15:30:26 +0200
Subject: wined3d: Give the cs its own state
@ -10,7 +10,7 @@ Subject: wined3d: Give the cs its own state
3 files changed, 83 insertions(+), 17 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index ebb078a..55cd5d6 100644
index 006cb96..4dcc7f5 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -63,6 +63,7 @@ enum wined3d_cs_op
@ -21,7 +21,7 @@ index ebb078a..55cd5d6 100644
WINED3D_CS_OP_STOP,
};
@@ -273,6 +274,12 @@ struct wined3d_cs_reset_state
@@ -275,6 +276,12 @@ struct wined3d_cs_reset_state
enum wined3d_cs_op opcode;
};
@ -34,7 +34,7 @@ index ebb078a..55cd5d6 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -437,7 +444,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -439,7 +446,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
size_t size = FIELD_OFFSET(struct wined3d_cs_clear, rects[op->rect_count]);
device = cs->device;
@ -43,16 +43,16 @@ index ebb078a..55cd5d6 100644
device_clear_render_targets(device, device->adapter->gl_info.limits.buffers,
&cs->state.fb, op->rect_count, op->rects, &draw_rect, op->flags,
&op->color, op->depth, op->stencil);
@@ -466,7 +473,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@@ -468,7 +475,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_draw *op = data;
- draw_primitive(cs->device, &cs->device->state, op->start_idx, op->index_count,
+ draw_primitive(cs->device, &cs->state, op->start_idx, op->index_count,
op->start_instance, op->instance_count, op->indexed);
- draw_primitive(cs->device, &cs->device->state, op->base_vertex_idx, op->start_idx,
+ draw_primitive(cs->device, &cs->state, op->base_vertex_idx, op->start_idx,
op->index_count, op->start_instance, op->instance_count, op->indexed);
return sizeof(*op);
@@ -899,6 +906,57 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -904,6 +911,57 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
op->opcode = WINED3D_CS_OP_SET_TEXTURE;
op->stage = stage;
op->texture = texture;
@ -110,7 +110,7 @@ index ebb078a..55cd5d6 100644
cs->ops->submit(cs);
}
@@ -1249,6 +1307,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1254,6 +1312,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key,
/* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material,
/* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state,
@ -118,7 +118,7 @@ index ebb078a..55cd5d6 100644
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
@@ -1338,7 +1397,7 @@ done:
@@ -1343,7 +1402,7 @@ done:
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@ -127,7 +127,7 @@ index ebb078a..55cd5d6 100644
if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs))))
return NULL;
@@ -1346,8 +1405,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1351,8 +1410,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (FAILED(state_init(&cs->state, gl_info, &device->adapter->d3d_info,
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
{
@ -137,7 +137,7 @@ index ebb078a..55cd5d6 100644
}
cs->ops = &wined3d_cs_st_ops;
@@ -1356,17 +1414,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1361,17 +1419,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->data_size = WINED3D_INITIAL_CS_SIZE;
if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size)))
{
@ -157,7 +157,7 @@ index ebb078a..55cd5d6 100644
}
if (wined3d_settings.cs_multithreaded)
@@ -1379,15 +1433,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1384,15 +1438,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL)))
{
ERR("Failed to create wined3d command stream thread.\n");
@ -186,38 +186,38 @@ index ebb078a..55cd5d6 100644
void wined3d_cs_destroy(struct wined3d_cs *cs)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4dddef1..7ca03fd 100644
index d10ac7a..eee99b7 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3510,6 +3510,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
@@ -3525,6 +3525,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
device_invalidate_state(device, STATE_BASEVERTEXINDEX);
}
+ wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE);
wined3d_cs_emit_draw(device->cs, 0, start_vertex, vertex_count, 0, 0, FALSE);
return WINED3D_OK;
@@ -3547,6 +3548,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
@@ -3562,6 +3563,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
device_invalidate_state(device, STATE_BASEVERTEXINDEX);
}
+ wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE);
wined3d_cs_emit_draw(device->cs, device->state.base_vertex_index, start_idx, index_count, 0, 0, TRUE);
return WINED3D_OK;
@@ -3558,6 +3560,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@@ -3573,6 +3575,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n",
device, start_idx, index_count, start_instance, instance_count);
+ wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
wined3d_cs_emit_draw(device->cs, start_idx, index_count, start_instance, instance_count, TRUE);
wined3d_cs_emit_draw(device->cs, device->state.base_vertex_index,
start_idx, index_count, start_instance, instance_count, TRUE);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 05bf6da..046c9d9 100644
index b6bbb9f..662f326 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2888,7 +2888,7 @@ struct wined3d_cs_block
@@ -2917,7 +2917,7 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -226,7 +226,7 @@ index 05bf6da..046c9d9 100644
};
struct wined3d_cs_ops
@@ -2929,6 +2929,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -2958,6 +2958,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 88fabe417bf9eacefc5b563c01320535365a6247 Mon Sep 17 00:00:00 2001
From f6f55889f720713874299fe21ad82438339a11dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 7 Apr 2013 17:33:20 +0200
Subject: wined3d: Send base vertex index updates through the cs
@ -10,7 +10,7 @@ Subject: wined3d: Send base vertex index updates through the cs
3 files changed, 50 insertions(+), 18 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 12bbcff..bbe0d4f 100644
index 1e05fa0..81c4bff 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -67,6 +67,7 @@ enum wined3d_cs_op
@ -21,7 +21,7 @@ index 12bbcff..bbe0d4f 100644
WINED3D_CS_OP_STOP,
};
@@ -296,6 +297,12 @@ struct wined3d_cs_finish
@@ -298,6 +299,12 @@ struct wined3d_cs_finish
enum wined3d_cs_op opcode;
};
@ -34,7 +34,7 @@ index 12bbcff..bbe0d4f 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -489,6 +496,21 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -491,6 +498,21 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_draw *op = data;
@ -54,9 +54,9 @@ index 12bbcff..bbe0d4f 100644
+ device_invalidate_state(cs->device, STATE_BASEVERTEXINDEX);
+ }
draw_primitive(cs->device, &cs->state, op->start_idx, op->index_count,
op->start_instance, op->instance_count, op->indexed);
@@ -933,8 +955,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi
draw_primitive(cs->device, &cs->state, op->base_vertex_idx, op->start_idx,
op->index_count, op->start_instance, op->instance_count, op->indexed);
@@ -938,8 +960,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi
/* Don't memcpy the entire struct, we'll remove single items as we add dedicated
* ops for setting states */
@ -65,7 +65,7 @@ index 12bbcff..bbe0d4f 100644
cs->state.gl_primitive_type = op->state.gl_primitive_type;
memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b));
@@ -957,8 +977,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win
@@ -962,8 +982,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win
/* Don't memcpy the entire struct, we'll remove single items as we add dedicated
* ops for setting states */
@ -74,7 +74,7 @@ index 12bbcff..bbe0d4f 100644
op->state.gl_primitive_type = state->gl_primitive_type;
memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b));
@@ -1372,6 +1390,28 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -1377,6 +1395,28 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
cs->ops->submit(cs);
}
@ -103,7 +103,7 @@ index 12bbcff..bbe0d4f 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -1405,6 +1445,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1410,6 +1450,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f,
/* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f,
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
@ -112,10 +112,10 @@ index 12bbcff..bbe0d4f 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 72dc4e2..7319a83 100644
index 2998de7..9b4cb86 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1972,6 +1972,9 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I
@@ -1987,6 +1987,9 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I
TRACE("device %p, base_index %d.\n", device, base_index);
device->update_state->base_vertex_index = base_index;
@ -125,7 +125,7 @@ index 72dc4e2..7319a83 100644
}
INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device)
@@ -3493,12 +3496,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
@@ -3508,12 +3511,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
{
TRACE("device %p, start_vertex %u, vertex_count %u.\n", device, start_vertex, vertex_count);
@ -136,9 +136,9 @@ index 72dc4e2..7319a83 100644
- }
-
wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE);
wined3d_cs_emit_draw(device->cs, 0, start_vertex, vertex_count, 0, 0, FALSE);
@@ -3516,8 +3513,6 @@ void CDECL wined3d_device_draw_primitive_instanced(struct wined3d_device *device
@@ -3531,8 +3528,6 @@ void CDECL wined3d_device_draw_primitive_instanced(struct wined3d_device *device
HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count)
{
@ -147,7 +147,7 @@ index 72dc4e2..7319a83 100644
TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count);
if (!device->state.index_buffer)
@@ -3530,12 +3525,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
@@ -3545,12 +3540,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
return WINED3DERR_INVALIDCALL;
}
@ -159,12 +159,12 @@ index 72dc4e2..7319a83 100644
- }
wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE);
wined3d_cs_emit_draw(device->cs, device->state.base_vertex_index, start_idx, index_count, 0, 0, TRUE);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 222a76a..a5f99ed 100644
index b5f7937..6fe7b09 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2966,6 +2966,8 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -2995,6 +2995,8 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx,
unsigned int count, const struct wined3d_vec4 *constants, enum wined3d_shader_type type) DECLSPEC_HIDDEN;
void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 5efe6c30c29fba801d533fa5071aaae3d5652c47 Mon Sep 17 00:00:00 2001
From 62f39fc5f53ad7f90b8aea7fd6905c2f51ab3abf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 10 Apr 2013 17:16:02 +0200
Subject: wined3d: Send light updates through the command stream
@ -10,7 +10,7 @@ Subject: wined3d: Send light updates through the command stream
3 files changed, 174 insertions(+), 65 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 03bed96..220f05f 100644
index b82a153..1f5e739 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -63,7 +63,6 @@ enum wined3d_cs_op
@ -30,7 +30,7 @@ index 03bed96..220f05f 100644
WINED3D_CS_OP_STOP,
};
@@ -283,12 +284,6 @@ struct wined3d_cs_reset_state
@@ -285,12 +286,6 @@ struct wined3d_cs_reset_state
enum wined3d_cs_op opcode;
};
@ -43,7 +43,7 @@ index 03bed96..220f05f 100644
struct wined3d_cs_set_consts_f
{
enum wined3d_cs_op opcode;
@@ -330,6 +325,19 @@ struct wined3d_cs_set_primitive_type
@@ -332,6 +327,19 @@ struct wined3d_cs_set_primitive_type
GLenum gl_primitive_type;
};
@ -63,7 +63,7 @@ index 03bed96..220f05f 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -975,35 +983,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -980,35 +988,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
cs->ops->submit(cs);
}
@ -99,7 +99,7 @@ index 03bed96..220f05f 100644
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_shader_resource_view *op = data;
@@ -1562,6 +1541,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -1567,6 +1546,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
cs->ops->submit(cs);
}
@ -252,7 +252,7 @@ index 03bed96..220f05f 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -1591,7 +1716,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1596,7 +1721,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key,
/* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material,
/* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state,
@ -260,7 +260,7 @@ index 03bed96..220f05f 100644
/* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f,
/* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b,
/* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i,
@@ -1601,6 +1725,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1606,6 +1730,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
/* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index,
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
@ -270,10 +270,10 @@ index 03bed96..220f05f 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 6560687..b713dfc 100644
index 408eb40..cb6f2ee 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1591,14 +1591,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
@@ -1601,14 +1601,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
light->direction.x, light->direction.y, light->direction.z,
light->range, light->falloff, light->theta, light->phi);
@ -288,7 +288,7 @@ index 6560687..b713dfc 100644
/* Save away the information. */
object->OriginalParms = *light;
@@ -1678,6 +1670,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
@@ -1688,6 +1680,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
FIXME("Unrecognized light type %#x.\n", light->type);
}
@ -298,7 +298,7 @@ index 6560687..b713dfc 100644
return WINED3D_OK;
}
@@ -1750,12 +1745,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
@@ -1760,12 +1755,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
{
if (light_info->glIndex != -1)
{
@ -311,7 +311,7 @@ index 6560687..b713dfc 100644
device->update_state->lights[light_info->glIndex] = NULL;
light_info->glIndex = -1;
}
@@ -1797,16 +1786,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
@@ -1807,16 +1796,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
WARN("Too many concurrently active lights\n");
return WINED3D_OK;
}
@ -331,36 +331,36 @@ index 6560687..b713dfc 100644
return WINED3D_OK;
}
@@ -3499,7 +3484,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
@@ -3514,7 +3499,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
{
TRACE("device %p, start_vertex %u, vertex_count %u.\n", device, start_vertex, vertex_count);
- wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE);
wined3d_cs_emit_draw(device->cs, 0, start_vertex, vertex_count, 0, 0, FALSE);
return WINED3D_OK;
@@ -3528,8 +3512,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
@@ -3543,8 +3527,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
return WINED3DERR_INVALIDCALL;
}
-
- wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE);
wined3d_cs_emit_draw(device->cs, device->state.base_vertex_index, start_idx, index_count, 0, 0, TRUE);
return WINED3D_OK;
@@ -3541,7 +3523,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@@ -3556,7 +3538,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n",
device, start_idx, index_count, start_instance, instance_count);
- wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
wined3d_cs_emit_draw(device->cs, start_idx, index_count, start_instance, instance_count, TRUE);
wined3d_cs_emit_draw(device->cs, device->state.base_vertex_index,
start_idx, index_count, start_instance, instance_count, TRUE);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c39fd9c..4a78bfa 100644
index 7c7009b..cd42a74 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2884,7 +2884,9 @@ struct wined3d_cs_block
@@ -2913,7 +2913,9 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -371,7 +371,7 @@ index c39fd9c..4a78bfa 100644
};
struct wined3d_cs_ops
@@ -2928,8 +2930,6 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -2957,8 +2959,6 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
@ -380,7 +380,7 @@ index c39fd9c..4a78bfa 100644
void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs,
struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
@@ -2975,6 +2975,8 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
@@ -3004,6 +3004,8 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
UINT base_vertex_index) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs,
GLenum primitive_type) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From cf1752b14719e02a4fac71ba32c6986d67cd8e71 Mon Sep 17 00:00:00 2001
From d4219aaabd252d45506c391898326af17c1d1417 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 1 Aug 2013 00:33:48 +0200
Subject: wined3d: Send update_texture calls through the CS
@ -11,7 +11,7 @@ FIXME: This logic duplication is ugly.
3 files changed, 137 insertions(+), 82 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index f0d9834..0ef6d4b 100644
index d65f27a..9a4aec1 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -71,6 +71,7 @@ enum wined3d_cs_op
@ -22,7 +22,7 @@ index f0d9834..0ef6d4b 100644
WINED3D_CS_OP_STOP,
};
@@ -397,6 +398,12 @@ struct wined3d_cs_texture_preload
@@ -402,6 +403,12 @@ struct wined3d_cs_texture_preload
struct wined3d_texture *texture;
};
@ -35,7 +35,7 @@ index f0d9834..0ef6d4b 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -1920,6 +1927,31 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu
@@ -1919,6 +1926,31 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu
cs->ops->submit(cs, sizeof(*op));
}
@ -67,7 +67,7 @@ index f0d9834..0ef6d4b 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -1969,6 +2001,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1968,6 +2000,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
/* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy,
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
@ -76,11 +76,11 @@ index f0d9834..0ef6d4b 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 76a2f88..955f061 100644
index 903b091..6dc0a25 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3491,34 +3491,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
wined3d_cs_emit_draw(device->cs, start_idx, index_count, start_instance, instance_count, TRUE);
@@ -3532,34 +3532,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
start_idx, index_count, start_instance, instance_count, TRUE);
}
-static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
@ -118,7 +118,7 @@ index 76a2f88..955f061 100644
/* Only a prepare, since we're uploading entire volumes. */
wined3d_texture_prepare_texture(dst_texture, context, FALSE);
@@ -3526,32 +3509,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
@@ -3567,32 +3550,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
for (i = 0; i < level_count; ++i)
{
@ -218,7 +218,7 @@ index 76a2f88..955f061 100644
TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture);
@@ -3588,70 +3628,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
@@ -3629,70 +3669,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
return WINED3DERR_INVALIDCALL;
}
@ -319,10 +319,10 @@ index 76a2f88..955f061 100644
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c3df935..a6ff922 100644
index 4eb0689..9519e5d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2371,6 +2371,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource
@@ -2421,6 +2421,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN;
@ -331,7 +331,7 @@ index c3df935..a6ff922 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -2989,6 +2991,8 @@ void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query
@@ -3034,6 +3036,8 @@ void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query
UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN;
void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 58c0fcb83ed6aa1070dee8f451bf9b7c06728d5b Mon Sep 17 00:00:00 2001
From 1fcb7da2ca24d554dee67856a20c4fcef4728f44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 20 Aug 2014 18:01:36 +0200
Subject: wined3d: Introduce resource fencing.
@ -10,10 +10,10 @@ FIXME: The buffer part doesn't really make sense without dynamic buffer maps.
2 files changed, 35 insertions(+)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index e036b3e..3991111 100644
index 48a5112..df78a87 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -547,6 +547,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@@ -552,6 +552,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_draw *op = data;
const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info;
@ -21,9 +21,9 @@ index e036b3e..3991111 100644
if (op->indexed && !gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX])
{
@@ -565,6 +566,14 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
draw_primitive(cs->device, &cs->state, op->start_idx, op->index_count,
op->start_instance, op->instance_count, op->indexed);
@@ -570,6 +571,14 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
draw_primitive(cs->device, &cs->state, op->base_vertex_idx, op->start_idx,
op->index_count, op->start_instance, op->instance_count, op->indexed);
+ if (op->indexed)
+ wined3d_resource_dec_fence(&cs->state.index_buffer->resource);
@ -36,8 +36,8 @@ index e036b3e..3991111 100644
return sizeof(*op);
}
@@ -572,6 +581,8 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
UINT start_instance, UINT instance_count, BOOL indexed)
@@ -577,6 +586,8 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
unsigned int index_count, unsigned int start_instance, unsigned int instance_count, BOOL indexed)
{
struct wined3d_cs_draw *op;
+ unsigned int i;
@ -45,7 +45,7 @@ index e036b3e..3991111 100644
op = cs->ops->require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_DRAW;
@@ -581,6 +592,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
@@ -587,6 +598,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
op->instance_count = instance_count;
op->indexed = indexed;
@ -61,10 +61,10 @@ index e036b3e..3991111 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 38a72de..19ec752 100644
index c9e467b..a70d88f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2418,6 +2418,7 @@ struct wined3d_resource
@@ -2468,6 +2468,7 @@ struct wined3d_resource
DWORD priority;
void *heap_memory;
struct list resource_list_entry;
@ -72,7 +72,7 @@ index 38a72de..19ec752 100644
void *parent;
const struct wined3d_parent_ops *parent_ops;
@@ -2450,6 +2451,21 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_H
@@ -2500,6 +2501,21 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_H
DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN;

File diff suppressed because it is too large Load Diff