Rebase against 8b9ba16e9ad9ca85b93b05c13d6c5044a1a5ecf3.

This commit is contained in:
Zebediah Figura 2018-05-21 20:30:37 -05:00
parent 53a402bde4
commit da46ed3444
15 changed files with 313 additions and 1338 deletions

View File

@ -1,65 +1,36 @@
From 6bb2d09fd7d71ccf338f3a32d52dfbc3029b104c Mon Sep 17 00:00:00 2001
From b9218f8580e217d01bbef80ff78b21c877fd4a3f Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucian.poston@gmail.com>
Date: Wed, 2 May 2018 22:38:33 -0700
Subject: [PATCH 1/7] d2d1: Add d2d1_1.idl for drawing ID2D1Bitmap1
Subject: d2d1: Add d2d1_1.idl for drawing ID2D1Bitmap1
https://bugs.winehq.org/show_bug.cgi?id=44052
Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
---
include/d2d1_1.idl | 523 ++++++++++++++++++++++++++++++++++++++++++++++++++++
include/d2d1_1.idl | 462 ++++++++++++++++++++++++++++++++++++++++++++++++++++
include/dcommon.idl | 15 ++
2 files changed, 538 insertions(+)
2 files changed, 477 insertions(+)
diff --git a/include/d2d1_1.idl b/include/d2d1_1.idl
index 1fbbb30..2ff042f 100644
index 2b1ef2e..33a661c 100644
--- a/include/d2d1_1.idl
+++ b/include/d2d1_1.idl
@@ -17,7 +17,17 @@
*/
@@ -18,6 +18,11 @@
import "d2d1.idl";
+import "dxgi.idl";
+interface IWICImagingFactory;
+interface IWICColorContext;
+interface IPrintDocumentPackageTarget;
+interface ID2D1PrintControl;
+interface ID2D1ColorContext;
+interface ID2D1Bitmap1;
+interface ID2D1CommandSink;
+interface ID2D1Effect;
+interface ID2D1ImageBrush;
interface ID2D1Device;
interface ID2D1DeviceContext;
interface ID2D1StrokeStyle1;
interface ID2D1PathGeometry1;
@@ -50,6 +60,105 @@ typedef enum D2D1_UNIT_MODE
D2D1_UNIT_MODE_FORCE_DWORD = 0xffffffff,
} D2D1_UNIT_MODE;
@@ -76,6 +81,82 @@ typedef enum D2D1_COLOR_SPACE
D2D1_COLOR_SPACE_FORCE_DWORD = 0xffffffff,
} D2D1_COLOR_SPACE;
+typedef enum D2D1_DEVICE_CONTEXT_OPTIONS
+{
+ D2D1_DEVICE_CONTEXT_OPTIONS_NONE = 0,
+ D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS = 1,
+ D2D1_DEVICE_CONTEXT_OPTIONS_FORCE_DWORD = 0xffffffff,
+} D2D1_DEVICE_CONTEXT_OPTIONS;
+
+typedef enum D2D1_PRINT_FONT_SUBSET_MODE
+{
+ D2D1_PRINT_FONT_SUBSET_DEFAULT = 0,
+ D2D1_PRINT_FONT_SUBSET_EACHPAGE = 1,
+ D2D1_PRINT_FONT_SUBSET_NONE = 2,
+ D2D1_PRINT_FONT_SUBSET_FORCE_DWORD = 0xffffffff,
+} D2D1_PRINT_FONT_SUBSET_MODE;
+
+typedef enum D2D1_COLOR_SPACE
+{
+ D2D1_COLOR_SPACE_CUSTOM = 0,
+ D2D1_COLOR_SPACE_SRGB = 1,
+ D2D1_COLOR_SPACE_SCRGB = 2,
+ D2D1_COLOR_SPACE_FORCE_DWORD = 0xffffffff,
+} D2D1_COLOR_SPACE;
+
+typedef enum D2D1_BITMAP_OPTIONS
+{
+ D2D1_BITMAP_OPTIONS_NONE = 0,
@ -139,9 +110,9 @@ index 1fbbb30..2ff042f 100644
typedef struct D2D1_PROPERTY_BINDING D2D1_PROPERTY_BINDING;
typedef struct D2D1_STROKE_STYLE_PROPERTIES1
@@ -75,6 +184,76 @@ typedef struct D2D1_DRAWING_STATE_DESCRIPTION1
D2D1_UNIT_MODE unitMode;
} D2D1_DRAWING_STATE_DESCRIPTION1;
@@ -108,6 +189,69 @@ typedef struct D2D1_PRINT_CONTROL_PROPERTIES
D2D1_COLOR_SPACE colorSpace;
} D2D1_PRINT_CONTROL_PROPERTIES;
+typedef struct D2D1_MAPPED_RECT
+{
@ -197,13 +168,6 @@ index 1fbbb30..2ff042f 100644
+ ID2D1ColorContext *colorContext;
+} D2D1_BITMAP_PROPERTIES1;
+
+typedef struct D2D1_PRINT_CONTROL_PROPERTIES
+{
+ D2D1_PRINT_FONT_SUBSET_MODE fontSubset;
+ float rasterDPI;
+ D2D1_COLOR_SPACE colorSpace;
+} D2D1_PRINT_CONTROL_PROPERTIES;
+
+typedef struct D2D1_POINT_DESCRIPTION
+{
+ D2D1_POINT_2F point;
@ -216,7 +180,7 @@ index 1fbbb30..2ff042f 100644
typedef HRESULT (__stdcall *PD2D1_EFFECT_FACTORY)(IUnknown **effect);
[
@@ -134,3 +313,347 @@ interface ID2D1Factory1 : ID2D1Factory
@@ -193,3 +337,321 @@ interface ID2D1Factory1 : ID2D1Factory
[out] ID2D1Properties **props
);
}
@ -538,32 +502,6 @@ index 1fbbb30..2ff042f 100644
+ [in] const D2D1_RECT_F *src_rect
+ );
+}
+
+[
+ local,
+ object,
+ uuid(47dd575d-ac05-4cdd-8049-9b02cd16f44c)
+]
+interface ID2D1Device : ID2D1Resource
+{
+ HRESULT CreateDeviceContext(
+ [in] D2D1_DEVICE_CONTEXT_OPTIONS options,
+ [out] ID2D1DeviceContext **context
+ );
+ HRESULT CreatePrintControl(
+ [in] IWICImagingFactory *wic_factory,
+ [in] IPrintDocumentPackageTarget *document_target,
+ [in] const D2D1_PRINT_CONTROL_PROPERTIES *desc,
+ [out] ID2D1PrintControl **print_control
+ );
+ void SetMaximumTextureMemory(
+ [in] UINT64 max_texture_memory
+ );
+ UINT64 GetMaximumTextureMemory();
+ HRESULT ClearResources(
+ [in, defaultvalue(0)] UINT msec_since_use
+ );
+}
diff --git a/include/dcommon.idl b/include/dcommon.idl
index db5055d..18f2fbe 100644
--- a/include/dcommon.idl
@ -588,5 +526,5 @@ index db5055d..18f2fbe 100644
+ };
+} D2D_MATRIX_4X4_F;
--
1.9.1
2.7.4

View File

@ -1,152 +0,0 @@
From 041f7ef0b4e4d0ca72470032b2ce7eac9b3a118b Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucian.poston@gmail.com>
Date: Wed, 2 May 2018 23:38:21 -0700
Subject: [PATCH 2/7] d2d1: Test ID2D1DeviceContext drawing ID2D1Bitmap1
This test is based on the d2d usage in the Temple+ app referred to in
the winehq bug at https://bugs.winehq.org/show_bug.cgi?id=44052
Essentially, this test draws a rectangle using a d2d device context,
similar to the basic how-to in the link below.
https://msdn.microsoft.com/en-us/library/windows/desktop/hh780339(v=vs.85).aspx
Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
---
dlls/d2d1/tests/d2d1.c | 107 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 107 insertions(+)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 9bd9e2b..21b4e53 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -20,6 +20,7 @@
#include <limits.h>
#include <math.h>
#include "d2d1.h"
+#include "d2d1_1.h"
#include "wincrypt.h"
#include "wine/test.h"
#include "initguid.h"
@@ -4635,6 +4636,111 @@ todo_wine
DestroyWindow(window);
}
+static void test_draw_via_ID2D1DeviceContext(void)
+{
+ HRESULT hr;
+ ID2D1Factory1 *factory;
+ ID2D1Device *device;
+ ID3D10Device1 *d3d10_device;
+ IDXGIDevice *dxgi_device;
+ ID2D1DeviceContext *context;
+ IDXGISurface *dxgi_surface;
+ ID2D1Bitmap1 *bitmap;
+ D2D1_BITMAP_PROPERTIES1 bitmap_properties;
+ IDXGISwapChain *swapchain;
+ HWND window;
+ ID2D1SolidColorBrush *brush;
+ D2D1_COLOR_F c;
+ D2D1_RECT_F r;
+ set_color(&c, 0.5f, 0.5f, 0.5f, 0.5f);
+ set_rect(&r, 10.0f, 480.0f, 10.0f, 480.0f);
+
+ if (!(d3d10_device = create_device()))
+ {
+ skip("Failed to create device, skipping test.\n");
+ return;
+ }
+
+ window = create_window();
+ swapchain = create_swapchain(d3d10_device, window, TRUE);
+ hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&dxgi_surface);
+ ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
+
+ hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED,
+ &IID_ID2D1Factory1, NULL, (void**)&factory);
+ if (FAILED(hr))
+ {
+ skip("ID2D1Factory1 unavailable, skipping test.\n");
+ return;
+ }
+
+ hr = ID3D10Device1_QueryInterface(d3d10_device, &IID_IDXGIDevice,
+ (void**)&dxgi_device);
+ ok(SUCCEEDED(hr), "Failed to create dxgi_device, hr %#x.\n", hr);
+ if (FAILED(hr))
+ {
+ skip("dxgi_device unavailable, skipping test.\n");
+ return;
+ }
+
+ hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device);
+ todo_wine
+ ok(SUCCEEDED(hr), "Failed to create device, hr %#x.\n", hr);
+ if (FAILED(hr))
+ {
+ skip("device unavailable, skipping test.\n");
+ return;
+ }
+
+ hr = ID2D1Device_CreateDeviceContext(device,
+ D2D1_DEVICE_CONTEXT_OPTIONS_NONE, &context);
+ todo_wine
+ ok(SUCCEEDED(hr), "Failed to create device context, hr %#x.\n", hr);
+ if (FAILED(hr))
+ {
+ skip("device context unavailable, skipping test.\n");
+ return;
+ }
+
+ bitmap_properties.pixelFormat.format = DXGI_FORMAT_UNKNOWN;
+ bitmap_properties.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
+ bitmap_properties.dpiX = 96.0;
+ bitmap_properties.dpiY = 96.0;
+ bitmap_properties.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
+ hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(context, dxgi_surface,
+ &bitmap_properties, &bitmap);
+ todo_wine
+ ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+ if (FAILED(hr))
+ {
+ skip("bitmap unavailable for use as device context target, skipping test.\n");
+ return;
+ }
+
+ ID2D1DeviceContext_SetTarget(context, (ID2D1Image *)bitmap);
+ ID2D1DeviceContext_CreateSolidColorBrush(context, &c, NULL, &brush);
+
+ ID2D1DeviceContext_BeginDraw(context);
+ ID2D1DeviceContext_DrawRectangle(context, &r, (ID2D1Brush *)brush, 1.0f, NULL);
+ hr = ID2D1DeviceContext_EndDraw(context, NULL, NULL);
+ todo_wine
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
+ hr = IDXGISwapChain_Present(swapchain, 0, 0);
+ todo_wine
+ ok(SUCCEEDED(hr), "Failed to present image, hr %#x.\n", hr);
+
+ ID2D1SolidColorBrush_Release(brush);
+ DestroyWindow(window);
+ IDXGISwapChain_Release(swapchain);
+ ID2D1Bitmap1_Release(bitmap);
+ IDXGISurface_Release(dxgi_surface);
+ ID2D1DeviceContext_Release(context);
+ IDXGIDevice_Release(dxgi_device);
+ ID3D10Device1_Release(d3d10_device);
+ ID2D1Device_Release(device);
+ ID2D1Factory1_Release(factory);
+}
+
static void create_target_dibsection(HDC hdc, UINT32 width, UINT32 height)
{
char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
@@ -6444,6 +6550,7 @@ START_TEST(d2d1)
test_opacity_brush();
test_create_target();
test_draw_text_layout();
+ test_draw_via_ID2D1DeviceContext();
test_dc_target();
test_hwnd_target();
test_bitmap_target();
--
1.9.1

View File

@ -1,18 +1,19 @@
From f2291f6639479555979f1f403518f86a1ef31640 Mon Sep 17 00:00:00 2001
From 2af2d1c51ec73862a156850d702dcb4608d73558 Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucian.poston@gmail.com>
Date: Thu, 3 May 2018 00:38:06 -0700
Subject: [PATCH 3/7] d2d1: Use ID2D1Factory1 in d2d_geometry
Subject: d2d1: Use ID2D1Factory1 in d2d_geometry
https://bugs.winehq.org/show_bug.cgi?id=44052
Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
---
dlls/d2d1/d2d1_private.h | 8 ++++----
dlls/d2d1/factory.c | 6 +++---
dlls/d2d1/geometry.c | 30 +++++++++++++++++++++---------
2 files changed, 25 insertions(+), 13 deletions(-)
3 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
index dbfb83c..ed29c4c 100644
index 21e2b88..0bb0112 100644
--- a/dlls/d2d1/d2d1_private.h
+++ b/dlls/d2d1/d2d1_private.h
@@ -406,7 +406,7 @@ struct d2d_geometry
@ -38,6 +39,37 @@ index dbfb83c..ed29c4c 100644
ID2D1Geometry *src_geometry, const D2D_MATRIX_3X2_F *transform) DECLSPEC_HIDDEN;
struct d2d_geometry *unsafe_impl_from_ID2D1Geometry(ID2D1Geometry *iface) DECLSPEC_HIDDEN;
diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c
index 7810e95..2a1a536 100644
--- a/dlls/d2d1/factory.c
+++ b/dlls/d2d1/factory.c
@@ -140,7 +140,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRectangleGeometry(ID2D1Factor
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
- if (FAILED(hr = d2d_rectangle_geometry_init(object, (ID2D1Factory *)iface, rect)))
+ if (FAILED(hr = d2d_rectangle_geometry_init(object, iface, rect)))
{
WARN("Failed to initialize rectangle geometry, hr %#x.\n", hr);
heap_free(object);
@@ -190,7 +190,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateTransformedGeometry(ID2D1Fact
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
- d2d_transformed_geometry_init(object, (ID2D1Factory *)iface, src_geometry, transform);
+ d2d_transformed_geometry_init(object, iface, src_geometry, transform);
TRACE("Created transformed geometry %p.\n", object);
*transformed_geometry = (ID2D1TransformedGeometry *)&object->ID2D1Geometry_iface;
@@ -207,7 +207,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry(ID2D1Factory1 *i
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
- d2d_path_geometry_init(object, (ID2D1Factory *)iface);
+ d2d_path_geometry_init(object, iface);
TRACE("Created path geometry %p.\n", object);
*geometry = (ID2D1PathGeometry *)&object->ID2D1Geometry_iface;
diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
index d716fb1..5bf63f6 100644
--- a/dlls/d2d1/geometry.c
@ -137,5 +169,5 @@ index d716fb1..5bf63f6 100644
{
struct d2d_geometry *src_impl;
--
1.9.1
2.7.4

View File

@ -1,253 +0,0 @@
From d8f2ab6b92e9c845c57df905d13c60d9dec0f94f Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucian.poston@gmail.com>
Date: Thu, 3 May 2018 01:37:52 -0700
Subject: [PATCH 4/7] d2d1: Implement ID2D1Device
https://bugs.winehq.org/show_bug.cgi?id=44052
Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
---
dlls/d2d1/Makefile.in | 1 +
dlls/d2d1/d2d1_private.h | 10 +++
dlls/d2d1/device.c | 159 +++++++++++++++++++++++++++++++++++++++++++++++
dlls/d2d1/factory.c | 13 +++-
dlls/d2d1/tests/d2d1.c | 1 -
5 files changed, 181 insertions(+), 3 deletions(-)
create mode 100644 dlls/d2d1/device.c
diff --git a/dlls/d2d1/Makefile.in b/dlls/d2d1/Makefile.in
index 20d3f26..5aa2f4c 100644
--- a/dlls/d2d1/Makefile.in
+++ b/dlls/d2d1/Makefile.in
@@ -8,6 +8,7 @@ C_SRCS = \
bitmap_render_target.c \
brush.c \
dc_render_target.c \
+ device.c \
factory.c \
geometry.c \
hwnd_render_target.c \
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
index ed29c4c..4af5372 100644
--- a/dlls/d2d1/d2d1_private.h
+++ b/dlls/d2d1/d2d1_private.h
@@ -567,4 +567,14 @@ static inline const char *debug_d2d_rect_f(const D2D1_RECT_F *rect)
return wine_dbg_sprintf("(%.8e,%.8e)-(%.8e,%.8e)", rect->left, rect->top, rect->right, rect->bottom );
}
+struct d2d_device
+{
+ ID2D1Device ID2D1Device_iface;
+ LONG refcount;
+ ID2D1Factory1 *factory;
+ IDXGIDevice *dxgi_device;
+};
+
+void d2d_device_init(struct d2d_device *This, ID2D1Factory1 *iface, IDXGIDevice *dxgiDevice) DECLSPEC_HIDDEN;
+
#endif /* __WINE_D2D1_PRIVATE_H */
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
new file mode 100644
index 0000000..c060d4f
--- /dev/null
+++ b/dlls/d2d1/device.c
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2018 Lucian Poston
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+#include "wine/port.h"
+
+#include "d2d1_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d2d);
+
+static inline struct d2d_device *impl_from_ID2D1Device(ID2D1Device *iface)
+{
+ return CONTAINING_RECORD(iface, struct d2d_device, ID2D1Device_iface);
+}
+
+static HRESULT WINAPI d2d_device_QueryInterface(
+ ID2D1Device *iface,
+ REFIID riid,
+ void **ppvObject)
+{
+ TRACE("iface %p, riid %s, ppvObject %p.\n", iface, debugstr_guid(riid), ppvObject);
+ if (ppvObject == NULL)
+ return E_POINTER;
+
+ if (IsEqualGUID(riid, &IID_ID2D1Device)
+ || IsEqualGUID(riid, &IID_ID2D1Resource)
+ || IsEqualGUID(riid, &IID_IUnknown))
+ {
+ ID2D1Device_AddRef(iface);
+ *ppvObject = iface;
+ return S_OK;
+ }
+
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
+ *ppvObject = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI d2d_device_AddRef(
+ ID2D1Device *iface)
+{
+ struct d2d_device *This = impl_from_ID2D1Device(iface);
+ ULONG refcount = InterlockedIncrement(&This->refcount);
+ TRACE("%p increasing refcount to %u.\n", iface, refcount);
+ return refcount;
+}
+
+static ULONG WINAPI d2d_device_Release(
+ ID2D1Device *iface)
+{
+ struct d2d_device *This = impl_from_ID2D1Device(iface);
+ ULONG refcount = InterlockedDecrement(&This->refcount);
+ TRACE("%p decreasing refcount to %u.\n", iface, refcount);
+
+ if (refcount == 0)
+ {
+ IDXGIDevice_Release(This->dxgi_device);
+ ID2D1Factory1_Release(This->factory);
+ HeapFree(GetProcessHeap(), 0, This);
+ }
+
+ return refcount;
+}
+
+static void WINAPI d2d_device_GetFactory(
+ ID2D1Device *iface,
+ ID2D1Factory **factory)
+{
+ struct d2d_device *This = impl_from_ID2D1Device(iface);
+
+ TRACE("iface %p, factory %p.\n", iface, factory);
+ *factory = (ID2D1Factory *)This->factory;
+ ID2D1Factory1_AddRef(This->factory);
+}
+
+static HRESULT WINAPI d2d_device_CreateDeviceContext(
+ ID2D1Device *iface,
+ D2D1_DEVICE_CONTEXT_OPTIONS options,
+ ID2D1DeviceContext **deviceContext)
+{
+ struct d2d_device *This = impl_from_ID2D1Device(iface);
+ FIXME("%p stub!\n", This);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d2d_device_CreatePrintControl(
+ ID2D1Device *iface,
+ IWICImagingFactory *wicFactory,
+ IPrintDocumentPackageTarget *documentTarget,
+ const D2D1_PRINT_CONTROL_PROPERTIES *printControlProperties,
+ ID2D1PrintControl **printControl)
+{
+ struct d2d_device *This = impl_from_ID2D1Device(iface);
+ FIXME("%p stub!\n", This);
+ return E_NOTIMPL;
+}
+
+static void WINAPI d2d_device_SetMaximumTextureMemory(
+ ID2D1Device *iface,
+ UINT64 maximumInBytes)
+{
+ struct d2d_device *This = impl_from_ID2D1Device(iface);
+ FIXME("%p stub!\n", This);
+}
+
+static UINT64 WINAPI d2d_device_GetMaximumTextureMemory(
+ ID2D1Device *iface)
+{
+ struct d2d_device *This = impl_from_ID2D1Device(iface);
+ FIXME("%p stub!\n", This);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d2d_device_ClearResources(
+ ID2D1Device *iface,
+ UINT millisecondsSinceUse)
+{
+ struct d2d_device *This = impl_from_ID2D1Device(iface);
+ FIXME("%p stub!\n", This);
+ return E_NOTIMPL;
+}
+
+static const struct ID2D1DeviceVtbl d2d_device_vtbl =
+{
+ d2d_device_QueryInterface,
+ d2d_device_AddRef,
+ d2d_device_Release,
+ d2d_device_GetFactory,
+ d2d_device_CreateDeviceContext,
+ d2d_device_CreatePrintControl,
+ d2d_device_SetMaximumTextureMemory,
+ d2d_device_GetMaximumTextureMemory,
+ d2d_device_ClearResources,
+};
+
+void d2d_device_init(struct d2d_device *device, ID2D1Factory1 *iface, IDXGIDevice *dxgi_device)
+{
+ device->ID2D1Device_iface.lpVtbl = &d2d_device_vtbl;
+ device->refcount = 1;
+ device->factory = iface;
+ ID2D1Factory1_AddRef(device->factory);
+ device->dxgi_device = dxgi_device;
+ IDXGIDevice_AddRef(device->dxgi_device);
+}
diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c
index 9bacc85..a6bc6e2 100644
--- a/dlls/d2d1/factory.c
+++ b/dlls/d2d1/factory.c
@@ -375,9 +375,18 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDCRenderTarget(ID2D1Factory1
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDevice(ID2D1Factory1 *iface,
IDXGIDevice *dxgi_device, ID2D1Device **device)
{
- FIXME("iface %p, dxgi_device %p, device %p stub!\n", iface, dxgi_device, device);
+ struct d2d_device *object;
- return E_NOTIMPL;
+ TRACE("iface %p, dxgi_device %p, device %p\n", iface, dxgi_device, device);
+
+ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+ return E_OUTOFMEMORY;
+
+ d2d_device_init(object, iface, dxgi_device);
+ *device = &object->ID2D1Device_iface;
+ TRACE("Created device %p.\n", object);
+
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle1(ID2D1Factory1 *iface,
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 21b4e53..cf0ddd7 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -4684,7 +4684,6 @@ static void test_draw_via_ID2D1DeviceContext(void)
}
hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device);
- todo_wine
ok(SUCCEEDED(hr), "Failed to create device, hr %#x.\n", hr);
if (FAILED(hr))
{
--
1.9.1

View File

@ -1,7 +1,7 @@
From a4a71ac89b388fa8346a2ce31b0da3adc794ef68 Mon Sep 17 00:00:00 2001
From d74d9f9e5c1502418932e75101979794763706c0 Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucian.poston@gmail.com>
Date: Thu, 3 May 2018 02:37:30 -0700
Subject: [PATCH 5/7] d2d1: Stub ID2D1DeviceContext
Subject: d2d1: Stub ID2D1DeviceContext
This commit contains only stubs in order to keep its size down so the
mailing list doesn't reject it.
@ -16,7 +16,7 @@ Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
create mode 100644 dlls/d2d1/device_context.c
diff --git a/dlls/d2d1/Makefile.in b/dlls/d2d1/Makefile.in
index 5aa2f4c..a0eea3e 100644
index 4bfe3b5..ce3d42d 100644
--- a/dlls/d2d1/Makefile.in
+++ b/dlls/d2d1/Makefile.in
@@ -9,6 +9,7 @@ C_SRCS = \
@ -29,7 +29,7 @@ index 5aa2f4c..a0eea3e 100644
hwnd_render_target.c \
diff --git a/dlls/d2d1/device_context.c b/dlls/d2d1/device_context.c
new file mode 100644
index 0000000..3b7b7dc
index 0000000..04da4bf
--- /dev/null
+++ b/dlls/d2d1/device_context.c
@@ -0,0 +1,1040 @@
@ -728,8 +728,8 @@ index 0000000..3b7b7dc
+static HRESULT WINAPI d2d_device_context_ID2D1DeviceContext_CreateBitmapBrush(
+ ID2D1DeviceContext *iface,
+ ID2D1Bitmap *bitmap,
+ D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmapBrushProperties,
+ D2D1_BRUSH_PROPERTIES *brushProperties,
+ const D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmapBrushProperties,
+ const D2D1_BRUSH_PROPERTIES *brushProperties,
+ ID2D1BitmapBrush1 **bitmapBrush)
+{
+ struct d2d_device_context *This = impl_from_ID2D1DeviceContext(iface);
@ -903,11 +903,11 @@ index 0000000..3b7b7dc
+static void WINAPI d2d_device_context_ID2D1DeviceContext_DrawBitmap(
+ ID2D1DeviceContext *iface,
+ ID2D1Bitmap *bitmap,
+ D2D1_RECT_F *destinationRectangle,
+ const D2D1_RECT_F *destinationRectangle,
+ float opacity,
+ D2D1_INTERPOLATION_MODE interpolationMode,
+ const D2D1_RECT_F sourceRectangle,
+ const D2D1_MATRIX_4X4_F perspectiveTransform)
+ const D2D1_RECT_F *sourceRectangle,
+ const D2D1_MATRIX_4X4_F *perspectiveTransform)
+{
+ struct d2d_device_context *This = impl_from_ID2D1DeviceContext(iface);
+ FIXME("%p stub!\n", This);
@ -1074,5 +1074,5 @@ index 0000000..3b7b7dc
+ d2d_device_context_ID2D1DeviceContext_FillOpacityMask,
+};
--
1.9.1
2.7.4

View File

@ -1,21 +1,19 @@
From b2a226371fa61a959cae4fcfed7e3503e1f3fd8c Mon Sep 17 00:00:00 2001
From a1de88de49c28a61ecc21f380e6ad3c25037eb59 Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucian.poston@gmail.com>
Date: Thu, 3 May 2018 03:37:07 -0700
Subject: [PATCH 6/7] d2d1: Implement ID2D1DeviceContext
Subject: d2d1: Implement ID2D1DeviceContext
https://bugs.winehq.org/show_bug.cgi?id=44052
Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
---
dlls/d2d1/d2d1_private.h | 16 +++
dlls/d2d1/device.c | 36 ++++-
dlls/d2d1/device_context.c | 328 ++++++++++++++++++++++++++++++++-------------
dlls/d2d1/render_target.c | 82 ++++++++----
dlls/d2d1/tests/d2d1.c | 1 -
5 files changed, 341 insertions(+), 122 deletions(-)
dlls/d2d1/device.c | 118 +++++++++++++----
dlls/d2d1/device_context.c | 318 ++++++++++++++++++++++++++++++++-------------
3 files changed, 336 insertions(+), 116 deletions(-)
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
index 4af5372..1cb57e4 100644
index 0bb0112..1958aa0 100644
--- a/dlls/d2d1/d2d1_private.h
+++ b/dlls/d2d1/d2d1_private.h
@@ -154,6 +154,10 @@ struct d2d_d3d_render_target
@ -29,9 +27,9 @@ index 4af5372..1cb57e4 100644
HRESULT d2d_d3d_render_target_create_rtv(ID2D1RenderTarget *render_target, IDXGISurface1 *surface) DECLSPEC_HIDDEN;
struct d2d_wic_render_target
@@ -577,4 +581,16 @@ struct d2d_device
void d2d_device_init(struct d2d_device *This, ID2D1Factory1 *iface, IDXGIDevice *dxgiDevice) DECLSPEC_HIDDEN;
@@ -577,4 +581,16 @@ static inline const char *debug_d2d_rect_f(const D2D1_RECT_F *rect)
return wine_dbg_sprintf("(%.8e,%.8e)-(%.8e,%.8e)", rect->left, rect->top, rect->right, rect->bottom );
}
+struct d2d_device_context
+{
@ -47,24 +45,140 @@ index 4af5372..1cb57e4 100644
+
#endif /* __WINE_D2D1_PRIVATE_H */
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
index c060d4f..c5075b4 100644
index f74e9f8..24fb3c9 100644
--- a/dlls/d2d1/device.c
+++ b/dlls/d2d1/device.c
@@ -94,8 +94,40 @@ static HRESULT WINAPI d2d_device_CreateDeviceContext(
ID2D1DeviceContext **deviceContext)
@@ -2144,7 +2144,7 @@ static const struct ID2D1GdiInteropRenderTargetVtbl d2d_gdi_interop_render_targe
};
static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target, ID2D1Factory *factory,
- IDXGISurface *surface, IUnknown *outer_unknown, const D2D1_RENDER_TARGET_PROPERTIES *desc)
+ IDXGISurface *surface, ID3D10Device *device, IUnknown *outer_unknown, const D2D1_RENDER_TARGET_PROPERTIES *desc)
{
struct d2d_device *This = impl_from_ID2D1Device(iface);
- FIXME("%p stub!\n", This);
- return E_NOTIMPL;
D3D10_SUBRESOURCE_DATA buffer_data;
D3D10_STATE_BLOCK_MASK state_mask;
@@ -3033,25 +3033,41 @@ static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_t
render_target->outer_unknown = outer_unknown ? outer_unknown :
(IUnknown *)&render_target->ID2D1RenderTarget_iface;
- if (FAILED(hr = IDXGISurface_GetDevice(surface, &IID_ID3D10Device, (void **)&render_target->device)))
+ if (surface == NULL)
{
- WARN("Failed to get device interface, hr %#x.\n", hr);
- ID2D1Factory_Release(render_target->factory);
- return hr;
+ ID3D10Device_AddRef(render_target->device = device);
}
-
- if (FAILED(hr = IDXGISurface_QueryInterface(surface, &IID_ID3D10Resource, (void **)&resource)))
+ else
{
- WARN("Failed to get ID3D10Resource interface, hr %#x.\n", hr);
- goto err;
- }
+ if (FAILED(hr = IDXGISurface_GetDevice(surface, &IID_ID3D10Device, (void **)&render_target->device)))
+ {
+ WARN("Failed to get device interface, hr %#x.\n", hr);
+ ID2D1Factory_Release(render_target->factory);
+ return hr;
+ }
- hr = ID3D10Device_CreateRenderTargetView(render_target->device, resource, NULL, &render_target->view);
- ID3D10Resource_Release(resource);
- if (FAILED(hr))
- {
- WARN("Failed to create rendertarget view, hr %#x.\n", hr);
- goto err;
+ if (FAILED(hr = IDXGISurface_QueryInterface(surface, &IID_ID3D10Resource, (void **)&resource)))
+ {
+ WARN("Failed to get ID3D10Resource interface, hr %#x.\n", hr);
+ goto err;
+ }
+
+ hr = ID3D10Device_CreateRenderTargetView(render_target->device, resource, NULL, &render_target->view);
+ ID3D10Resource_Release(resource);
+ if (FAILED(hr))
+ {
+ WARN("Failed to create rendertarget view, hr %#x.\n", hr);
+ goto err;
+ }
+
+ if (FAILED(hr = IDXGISurface_GetDesc(surface, &surface_desc)))
+ {
+ WARN("Failed to get surface desc, hr %#x.\n", hr);
+ goto err;
+ }
+
+ render_target->pixel_size.width = surface_desc.Width;
+ render_target->pixel_size.height = surface_desc.Height;
}
if (FAILED(hr = D3D10StateBlockMaskEnableAll(&state_mask)))
@@ -3176,15 +3192,7 @@ static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_t
goto err;
}
- if (FAILED(hr = IDXGISurface_GetDesc(surface, &surface_desc)))
- {
- WARN("Failed to get surface desc, hr %#x.\n", hr);
- goto err;
- }
-
render_target->desc.pixelFormat = desc->pixelFormat;
- render_target->pixel_size.width = surface_desc.Width;
- render_target->pixel_size.height = surface_desc.Height;
render_target->drawing_state.transform = identity;
if (!d2d_clip_stack_init(&render_target->clip_stack))
@@ -3238,7 +3246,31 @@ HRESULT d2d_d3d_create_render_target(ID2D1Factory *factory, IDXGISurface *surfac
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
- if (FAILED(hr = d2d_d3d_render_target_init(object, factory, surface, outer_unknown, desc)))
+ if (FAILED(hr = d2d_d3d_render_target_init(object, factory, surface, NULL, outer_unknown, desc)))
+ {
+ WARN("Failed to initialize render target, hr %#x.\n", hr);
+ HeapFree(GetProcessHeap(), 0, object);
+ return hr;
+ }
+
+ TRACE("Created render target %p.\n", object);
+ *render_target = &object->ID2D1RenderTarget_iface;
+
+ return S_OK;
+}
+
+HRESULT d2d_d3d_create_render_target_with_device(ID2D1Factory *factory,
+ ID3D10Device *device, IUnknown *outer_unknown,
+ const D2D1_RENDER_TARGET_PROPERTIES *desc,
+ ID2D1RenderTarget **render_target)
+{
+ struct d2d_d3d_render_target *object;
+ HRESULT hr;
+
+ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+ return E_OUTOFMEMORY;
+
+ if (FAILED(hr = d2d_d3d_render_target_init(object, factory, NULL, device, outer_unknown, desc)))
{
WARN("Failed to initialize render target, hr %#x.\n", hr);
heap_free(object);
@@ -3354,9 +3386,41 @@ static void WINAPI d2d_device_GetFactory(ID2D1Device *iface, ID2D1Factory **fact
static HRESULT WINAPI d2d_device_CreateDeviceContext(ID2D1Device *iface, D2D1_DEVICE_CONTEXT_OPTIONS options,
ID2D1DeviceContext **context)
{
- FIXME("iface %p, options %#x, context %p stub!\n", iface, options, context);
+ struct d2d_device *device = impl_from_ID2D1Device(iface);
+ struct d2d_device_context *object;
+ ID3D10Device *d3d_device;
+ HRESULT hr;
+
+ TRACE("This %p, options %#x\n", This, options);
+ if (deviceContext == NULL)
- return E_NOTIMPL;
+ TRACE("iface %p, options %#x, context %p.\n", iface, options, context);
+ if (!context)
+ return E_POINTER;
+
+ if (FAILED(hr = IDXGIDevice_QueryInterface(This->dxgi_device,
+ if (FAILED(hr = IDXGIDevice_QueryInterface(device->dxgi_device,
+ &IID_ID3D10Device, (void **)&d3d_device)))
+ {
+ WARN("Failed to query d3d device, hr %#x.\n", hr);
@ -86,15 +200,15 @@ index c060d4f..c5075b4 100644
+ return hr;
+ }
+
+ *deviceContext = &object->ID2D1DeviceContext_iface;
+ *context = &object->ID2D1DeviceContext_iface;
+ TRACE("Created device context %p.\n", object);
+
+ return S_OK;
}
static HRESULT WINAPI d2d_device_CreatePrintControl(
static HRESULT WINAPI d2d_device_CreatePrintControl(ID2D1Device *iface, IWICImagingFactory *wic_factory,
diff --git a/dlls/d2d1/device_context.c b/dlls/d2d1/device_context.c
index 3b7b7dc..75d163c 100644
index 04da4bf..75d163c 100644
--- a/dlls/d2d1/device_context.c
+++ b/dlls/d2d1/device_context.c
@@ -23,12 +23,6 @@
@ -739,17 +853,6 @@ index 3b7b7dc..75d163c 100644
}
static HRESULT WINAPI d2d_device_context_ID2D1DeviceContext_CreateBitmap(
@@ -693,8 +763,8 @@ static HRESULT WINAPI d2d_device_context_CreateImageBrush(
static HRESULT WINAPI d2d_device_context_ID2D1DeviceContext_CreateBitmapBrush(
ID2D1DeviceContext *iface,
ID2D1Bitmap *bitmap,
- D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmapBrushProperties,
- D2D1_BRUSH_PROPERTIES *brushProperties,
+ const D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmapBrushProperties,
+ const D2D1_BRUSH_PROPERTIES *brushProperties,
ID2D1BitmapBrush1 **bitmapBrush)
{
struct d2d_device_context *This = impl_from_ID2D1DeviceContext(iface);
@@ -765,7 +835,12 @@ static void WINAPI d2d_device_context_GetDevice(
ID2D1Device **device)
{
@ -800,21 +903,6 @@ index 3b7b7dc..75d163c 100644
}
static void WINAPI d2d_device_context_GetTarget(
@@ -868,11 +970,11 @@ static void WINAPI d2d_device_context_DrawGdiMetafile(
static void WINAPI d2d_device_context_ID2D1DeviceContext_DrawBitmap(
ID2D1DeviceContext *iface,
ID2D1Bitmap *bitmap,
- D2D1_RECT_F *destinationRectangle,
+ const D2D1_RECT_F *destinationRectangle,
float opacity,
D2D1_INTERPOLATION_MODE interpolationMode,
- const D2D1_RECT_F sourceRectangle,
- const D2D1_MATRIX_4X4_F perspectiveTransform)
+ const D2D1_RECT_F *sourceRectangle,
+ const D2D1_MATRIX_4X4_F *perspectiveTransform)
{
struct d2d_device_context *This = impl_from_ID2D1DeviceContext(iface);
FIXME("%p stub!\n", This);
@@ -1038,3 +1140,41 @@ static const struct ID2D1DeviceContextVtbl d2d_device_context_vtbl =
d2d_device_context_GetEffectRequiredInputRectangles,
d2d_device_context_ID2D1DeviceContext_FillOpacityMask,
@ -857,137 +945,6 @@ index 3b7b7dc..75d163c 100644
+
+ return S_OK;
+}
diff --git a/dlls/d2d1/render_target.c b/dlls/d2d1/render_target.c
index 7afbc84..3f15406 100644
--- a/dlls/d2d1/render_target.c
+++ b/dlls/d2d1/render_target.c
@@ -2139,7 +2139,7 @@ static const struct ID2D1GdiInteropRenderTargetVtbl d2d_gdi_interop_render_targe
};
static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target, ID2D1Factory *factory,
- IDXGISurface *surface, IUnknown *outer_unknown, const D2D1_RENDER_TARGET_PROPERTIES *desc)
+ IDXGISurface *surface, ID3D10Device *device, IUnknown *outer_unknown, const D2D1_RENDER_TARGET_PROPERTIES *desc)
{
D3D10_SUBRESOURCE_DATA buffer_data;
D3D10_STATE_BLOCK_MASK state_mask;
@@ -3028,25 +3028,41 @@ static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_t
render_target->outer_unknown = outer_unknown ? outer_unknown :
(IUnknown *)&render_target->ID2D1RenderTarget_iface;
- if (FAILED(hr = IDXGISurface_GetDevice(surface, &IID_ID3D10Device, (void **)&render_target->device)))
+ if (surface == NULL)
{
- WARN("Failed to get device interface, hr %#x.\n", hr);
- ID2D1Factory_Release(render_target->factory);
- return hr;
+ ID3D10Device_AddRef(render_target->device = device);
}
-
- if (FAILED(hr = IDXGISurface_QueryInterface(surface, &IID_ID3D10Resource, (void **)&resource)))
+ else
{
- WARN("Failed to get ID3D10Resource interface, hr %#x.\n", hr);
- goto err;
- }
+ if (FAILED(hr = IDXGISurface_GetDevice(surface, &IID_ID3D10Device, (void **)&render_target->device)))
+ {
+ WARN("Failed to get device interface, hr %#x.\n", hr);
+ ID2D1Factory_Release(render_target->factory);
+ return hr;
+ }
- hr = ID3D10Device_CreateRenderTargetView(render_target->device, resource, NULL, &render_target->view);
- ID3D10Resource_Release(resource);
- if (FAILED(hr))
- {
- WARN("Failed to create rendertarget view, hr %#x.\n", hr);
- goto err;
+ if (FAILED(hr = IDXGISurface_QueryInterface(surface, &IID_ID3D10Resource, (void **)&resource)))
+ {
+ WARN("Failed to get ID3D10Resource interface, hr %#x.\n", hr);
+ goto err;
+ }
+
+ hr = ID3D10Device_CreateRenderTargetView(render_target->device, resource, NULL, &render_target->view);
+ ID3D10Resource_Release(resource);
+ if (FAILED(hr))
+ {
+ WARN("Failed to create rendertarget view, hr %#x.\n", hr);
+ goto err;
+ }
+
+ if (FAILED(hr = IDXGISurface_GetDesc(surface, &surface_desc)))
+ {
+ WARN("Failed to get surface desc, hr %#x.\n", hr);
+ goto err;
+ }
+
+ render_target->pixel_size.width = surface_desc.Width;
+ render_target->pixel_size.height = surface_desc.Height;
}
if (FAILED(hr = D3D10StateBlockMaskEnableAll(&state_mask)))
@@ -3171,15 +3187,7 @@ static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_t
goto err;
}
- if (FAILED(hr = IDXGISurface_GetDesc(surface, &surface_desc)))
- {
- WARN("Failed to get surface desc, hr %#x.\n", hr);
- goto err;
- }
-
render_target->desc.pixelFormat = desc->pixelFormat;
- render_target->pixel_size.width = surface_desc.Width;
- render_target->pixel_size.height = surface_desc.Height;
render_target->drawing_state.transform = identity;
if (!d2d_clip_stack_init(&render_target->clip_stack))
@@ -3233,7 +3241,31 @@ HRESULT d2d_d3d_create_render_target(ID2D1Factory *factory, IDXGISurface *surfac
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
- if (FAILED(hr = d2d_d3d_render_target_init(object, factory, surface, outer_unknown, desc)))
+ if (FAILED(hr = d2d_d3d_render_target_init(object, factory, surface, NULL, outer_unknown, desc)))
+ {
+ WARN("Failed to initialize render target, hr %#x.\n", hr);
+ HeapFree(GetProcessHeap(), 0, object);
+ return hr;
+ }
+
+ TRACE("Created render target %p.\n", object);
+ *render_target = &object->ID2D1RenderTarget_iface;
+
+ return S_OK;
+}
+
+HRESULT d2d_d3d_create_render_target_with_device(ID2D1Factory *factory,
+ ID3D10Device *device, IUnknown *outer_unknown,
+ const D2D1_RENDER_TARGET_PROPERTIES *desc,
+ ID2D1RenderTarget **render_target)
+{
+ struct d2d_d3d_render_target *object;
+ HRESULT hr;
+
+ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+ return E_OUTOFMEMORY;
+
+ if (FAILED(hr = d2d_d3d_render_target_init(object, factory, NULL, device, outer_unknown, desc)))
{
WARN("Failed to initialize render target, hr %#x.\n", hr);
heap_free(object);
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index cf0ddd7..5e9bf97 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -4693,7 +4693,6 @@ static void test_draw_via_ID2D1DeviceContext(void)
hr = ID2D1Device_CreateDeviceContext(device,
D2D1_DEVICE_CONTEXT_OPTIONS_NONE, &context);
- todo_wine
ok(SUCCEEDED(hr), "Failed to create device context, hr %#x.\n", hr);
if (FAILED(hr))
{
--
1.9.1
2.7.4

View File

@ -1,7 +1,7 @@
From 986ff7ac31a4413b83b665d828ebc0844f50b526 Mon Sep 17 00:00:00 2001
From 4da54c6040345f0a4d2f9d11e1d24461dec69e77 Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucian.poston@gmail.com>
Date: Thu, 3 May 2018 04:36:13 -0700
Subject: [PATCH 7/7] d2d1: Implement ID2D1Bitmap1
Subject: d2d1: Implement ID2D1Bitmap1
https://bugs.winehq.org/show_bug.cgi?id=44052
@ -10,10 +10,9 @@ Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
dlls/d2d1/bitmap.c | 277 +++++++++++++++++++++++++++++++++------------
dlls/d2d1/brush.c | 8 +-
dlls/d2d1/d2d1_private.h | 8 +-
dlls/d2d1/device.c | 6 +-
dlls/d2d1/device_context.c | 24 +++-
dlls/d2d1/render_target.c | 6 +-
dlls/d2d1/tests/d2d1.c | 3 -
6 files changed, 243 insertions(+), 83 deletions(-)
5 files changed, 243 insertions(+), 80 deletions(-)
diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
index 0d4098f..32e6085 100644
@ -556,7 +555,7 @@ index c46d940..b00629f 100644
{
(*brush)->u.bitmap.extend_mode_x = bitmap_brush_desc->extendModeX;
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
index 1cb57e4..2169ff1 100644
index 1958aa0..9db671e 100644
--- a/dlls/d2d1/d2d1_private.h
+++ b/dlls/d2d1/d2d1_private.h
@@ -330,7 +330,8 @@ HRESULT d2d_mesh_create(ID2D1Factory *factory, struct d2d_mesh **mesh) DECLSPEC_
@ -585,6 +584,37 @@ index 1cb57e4..2169ff1 100644
HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device *device, REFIID iid, void *data,
const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
HRESULT d2d_bitmap_create_from_wic_bitmap(ID2D1Factory *factory, ID3D10Device *device, IWICBitmapSource *bitmap_source,
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
index 24fb3c9..5ba3d07 100644
--- a/dlls/d2d1/device.c
+++ b/dlls/d2d1/device.c
@@ -291,7 +291,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmap(ID2D1RenderT
iface, size.width, size.height, src_data, pitch, desc, bitmap);
if (SUCCEEDED(hr = d2d_bitmap_create(render_target->factory, render_target->device, size, src_data, pitch, desc, &object)))
- *bitmap = &object->ID2D1Bitmap_iface;
+ *bitmap = (ID2D1Bitmap *)&object->ID2D1Bitmap_iface;
return hr;
}
@@ -308,7 +308,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapFromWicBitmap
if (SUCCEEDED(hr = d2d_bitmap_create_from_wic_bitmap(render_target->factory, render_target->device, bitmap_source,
desc, &object)))
- *bitmap = &object->ID2D1Bitmap_iface;
+ *bitmap = (ID2D1Bitmap *)&object->ID2D1Bitmap_iface;
return hr;
}
@@ -324,7 +324,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSharedBitmap(ID2D1R
iface, debugstr_guid(iid), data, desc, bitmap);
if (SUCCEEDED(hr = d2d_bitmap_create_shared(iface, render_target->device, iid, data, desc, &object)))
- *bitmap = &object->ID2D1Bitmap_iface;
+ *bitmap = (ID2D1Bitmap *)&object->ID2D1Bitmap_iface;
return hr;
}
diff --git a/dlls/d2d1/device_context.c b/dlls/d2d1/device_context.c
index 75d163c..e5577b0 100644
--- a/dlls/d2d1/device_context.c
@ -620,60 +650,6 @@ index 75d163c..e5577b0 100644
}
static HRESULT WINAPI d2d_device_context_CreateEffect(
diff --git a/dlls/d2d1/render_target.c b/dlls/d2d1/render_target.c
index 3f15406..7c6752f 100644
--- a/dlls/d2d1/render_target.c
+++ b/dlls/d2d1/render_target.c
@@ -286,7 +286,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmap(ID2D1RenderT
iface, size.width, size.height, src_data, pitch, desc, bitmap);
if (SUCCEEDED(hr = d2d_bitmap_create(render_target->factory, render_target->device, size, src_data, pitch, desc, &object)))
- *bitmap = &object->ID2D1Bitmap_iface;
+ *bitmap = (ID2D1Bitmap *)&object->ID2D1Bitmap_iface;
return hr;
}
@@ -303,7 +303,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapFromWicBitmap
if (SUCCEEDED(hr = d2d_bitmap_create_from_wic_bitmap(render_target->factory, render_target->device, bitmap_source,
desc, &object)))
- *bitmap = &object->ID2D1Bitmap_iface;
+ *bitmap = (ID2D1Bitmap *)&object->ID2D1Bitmap_iface;
return hr;
}
@@ -319,7 +319,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSharedBitmap(ID2D1R
iface, debugstr_guid(iid), data, desc, bitmap);
if (SUCCEEDED(hr = d2d_bitmap_create_shared(iface, render_target->device, iid, data, desc, &object)))
- *bitmap = &object->ID2D1Bitmap_iface;
+ *bitmap = (ID2D1Bitmap *)&object->ID2D1Bitmap_iface;
return hr;
}
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 5e9bf97..5d38672 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -4707,7 +4707,6 @@ static void test_draw_via_ID2D1DeviceContext(void)
bitmap_properties.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(context, dxgi_surface,
&bitmap_properties, &bitmap);
- todo_wine
ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
if (FAILED(hr))
{
@@ -4721,10 +4720,8 @@ static void test_draw_via_ID2D1DeviceContext(void)
ID2D1DeviceContext_BeginDraw(context);
ID2D1DeviceContext_DrawRectangle(context, &r, (ID2D1Brush *)brush, 1.0f, NULL);
hr = ID2D1DeviceContext_EndDraw(context, NULL, NULL);
- todo_wine
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDXGISwapChain_Present(swapchain, 0, 0);
- todo_wine
ok(SUCCEEDED(hr), "Failed to present image, hr %#x.\n", hr);
ID2D1SolidColorBrush_Release(brush);
--
1.9.1
2.7.4

View File

@ -1,255 +0,0 @@
From bdc2d668649d5810b88bcdd842228f7d44d7a012 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 7 Jul 2017 05:44:09 +0200
Subject: [PATCH] d3d11/tests: Add some basic depth tests.
---
dlls/d3d11/tests/d3d11.c | 210 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 207 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 8279e7b..5831bbc 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -1476,10 +1476,11 @@ static void set_quad_color(struct d3d11_test_context *context, const struct vec4
(ID3D11Resource *)context->ps_cb, 0, NULL, color, 0, 0);
}
-#define draw_color_quad(a, b) draw_color_quad_(__LINE__, a, b, NULL, 0)
-#define draw_color_quad_vs(a, b, c, d) draw_color_quad_(__LINE__, a, b, c, d)
+#define draw_color_quad(a, b) draw_color_quad_(__LINE__, a, b, NULL, 0, 0.0)
+#define draw_color_quad_vs(a, b, c, d) draw_color_quad_(__LINE__, a, b, c, d, 0.0)
+#define draw_color_quad_z(context, color, z) draw_color_quad_(__LINE__, context, color, NULL, 0, z)
static void draw_color_quad_(unsigned int line, struct d3d11_test_context *context,
- const struct vec4 *color, const DWORD *vs_code, size_t vs_code_size)
+ const struct vec4 *color, const DWORD *vs_code, size_t vs_code_size, float z)
{
static const DWORD ps_color_code[] =
{
@@ -1522,6 +1523,7 @@ static void draw_color_quad_(unsigned int line, struct d3d11_test_context *conte
set_quad_color(context, color);
draw_quad_vs_(line, context, vs_code, vs_code_size);
+ draw_quad_z_(line, context, z);
}
static void test_create_device(void)
@@ -17583,6 +17585,207 @@ static void test_stencil_separate(void)
release_test_context(&test_context);
}
+static void test_depth_separate(void)
+{
+ struct d3d11_test_context test_context;
+ D3D11_TEXTURE2D_DESC texture_desc;
+ D3D11_DEPTH_STENCIL_DESC ds_desc;
+ ID3D11DepthStencilState *ds_state;
+ ID3D11DepthStencilView *ds_view;
+ D3D11_RASTERIZER_DESC rs_desc;
+ ID3D11DeviceContext *context;
+ struct resource_readback rb;
+ ID3D11RasterizerState *rs;
+ ID3D11Texture2D *texture;
+ ID3D11Device *device;
+ D3D11_VIEWPORT vp;
+ DWORD color;
+ HRESULT hr;
+
+ static const float red[] = {1.0f, 0.0f, 0.0f, 1.0f};
+ static const struct vec4 green = {0.0f, 1.0f, 0.0f, 1.0f};
+ static const struct vec4 blue = {0.0f, 0.0f, 1.0f, 1.0f};
+ static const struct vec4 white = {1.0f, 1.0f, 1.0f, 1.0f};
+ static const DWORD green_d = 0xff00ff00;
+ static const DWORD blue_d = 0xffff0000;
+ static const DWORD red_d = 0xff0000ff;
+ static const DWORD white_d = 0xffffffff;
+
+ if (!init_test_context(&test_context, NULL))
+ return;
+
+ device = test_context.device;
+ context = test_context.immediate_context;
+
+ texture_desc.Width = 640;
+ texture_desc.Height = 480;
+ texture_desc.MipLevels = 1;
+ texture_desc.ArraySize = 1;
+ texture_desc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
+ texture_desc.SampleDesc.Count = 1;
+ texture_desc.SampleDesc.Quality = 0;
+ texture_desc.Usage = D3D11_USAGE_DEFAULT;
+ texture_desc.BindFlags = D3D11_BIND_DEPTH_STENCIL;
+ texture_desc.CPUAccessFlags = 0;
+ texture_desc.MiscFlags = 0;
+ hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture);
+ ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr);
+ hr = ID3D11Device_CreateDepthStencilView(device, (ID3D11Resource *)texture, NULL, &ds_view);
+ ok(SUCCEEDED(hr), "Failed to create depth stencil view, hr %#x.\n", hr);
+
+ ds_desc.DepthEnable = TRUE;
+ ds_desc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
+ ds_desc.DepthFunc = D3D11_COMPARISON_LESS;
+ ds_desc.StencilEnable = FALSE;
+ ds_desc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK;
+ ds_desc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
+ ds_desc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_ZERO;
+ ds_desc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_ZERO;
+ ds_desc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_ZERO;
+ ds_desc.FrontFace.StencilFunc = D3D11_COMPARISON_NEVER;
+ ds_desc.BackFace.StencilFailOp = D3D11_STENCIL_OP_ZERO;
+ ds_desc.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_ZERO;
+ ds_desc.BackFace.StencilPassOp = D3D11_STENCIL_OP_ZERO;
+ ds_desc.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
+ hr = ID3D11Device_CreateDepthStencilState(device, &ds_desc, &ds_state);
+ ok(SUCCEEDED(hr), "Failed to create depth stencil state, hr %#x.\n", hr);
+
+ rs_desc.FillMode = D3D11_FILL_SOLID;
+ rs_desc.CullMode = D3D11_CULL_NONE;
+ rs_desc.FrontCounterClockwise = FALSE;
+ rs_desc.DepthBias = 0;
+ rs_desc.DepthBiasClamp = 0.0f;
+ rs_desc.SlopeScaledDepthBias = 0.0f;
+ rs_desc.DepthClipEnable = TRUE;
+ rs_desc.ScissorEnable = FALSE;
+ rs_desc.MultisampleEnable = FALSE;
+ rs_desc.AntialiasedLineEnable = FALSE;
+ ID3D11Device_CreateRasterizerState(device, &rs_desc, &rs);
+ ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr);
+
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ ID3D11DeviceContext_ClearDepthStencilView(context, ds_view, D3D11_CLEAR_DEPTH, 1.1f, 0);
+ ID3D11DeviceContext_OMSetRenderTargets(context, 1, &test_context.backbuffer_rtv, ds_view);
+ ID3D11DeviceContext_OMSetDepthStencilState(context, ds_state, 0);
+ ID3D11DeviceContext_RSSetState(context, rs);
+
+ vp.TopLeftX = 0.0f;
+ vp.TopLeftY = 0.0f;
+ vp.Width = texture_desc.Width;
+ vp.Height = texture_desc.Height;
+ vp.MinDepth = 0.0f;
+ vp.MaxDepth = 0.7f;
+ ID3D11DeviceContext_RSSetViewports(context, 1, &vp);
+
+ /* simple depth tests */
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ ID3D11DeviceContext_ClearDepthStencilView(context, ds_view, D3D11_CLEAR_DEPTH, 1.0f, 0);
+ draw_color_quad_z(&test_context, &green, 0.0f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ ok(compare_color(color, green_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ ID3D11DeviceContext_ClearDepthStencilView(context, ds_view, D3D11_CLEAR_DEPTH, 1.0f, 0);
+ draw_color_quad_z(&test_context, &green, 0.7f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ ok(compare_color(color, green_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ ID3D11DeviceContext_ClearDepthStencilView(context, ds_view, D3D11_CLEAR_DEPTH, 1.0f, 0);
+ draw_color_quad_z(&test_context, &green, 0.0f);
+ draw_color_quad_z(&test_context, &blue, 0.0f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ ok(compare_color(color, green_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+
+ /* clipped */
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ ID3D11DeviceContext_ClearDepthStencilView(context, ds_view, D3D11_CLEAR_DEPTH, 1.0f, 0);
+ draw_color_quad_z(&test_context, &green, 1.1f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ ok(compare_color(color, red_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ ID3D11DeviceContext_ClearDepthStencilView(context, ds_view, D3D11_CLEAR_DEPTH, 1.0f, 0);
+ draw_color_quad_z(&test_context, &green, -0.1f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ ok(compare_color(color, red_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+
+ /* clipping disabled */
+ ID3D11RasterizerState_Release(rs);
+ rs_desc.DepthClipEnable = FALSE;
+ ID3D11Device_CreateRasterizerState(device, &rs_desc, &rs);
+ ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr);
+ ID3D11DeviceContext_RSSetState(context, rs);
+
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ ID3D11DeviceContext_ClearDepthStencilView(context, ds_view, D3D11_CLEAR_DEPTH, 1.0f, 0);
+ draw_color_quad_z(&test_context, &green, 1.1f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ todo_wine ok(compare_color(color, green_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ ID3D11DeviceContext_ClearDepthStencilView(context, ds_view, D3D11_CLEAR_DEPTH, 1.0f, 0);
+ draw_color_quad_z(&test_context, &green, -0.1f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ todo_wine ok(compare_color(color, green_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+
+ /* depth bias */
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ ID3D11DeviceContext_ClearDepthStencilView(context, ds_view, D3D11_CLEAR_DEPTH, 1.0f, 0);
+ draw_color_quad_z(&test_context, &green, 0.5f);
+ ID3D11RasterizerState_Release(rs);
+ rs_desc.DepthClipEnable = TRUE;
+ rs_desc.DepthBias = -100000;
+ ID3D11Device_CreateRasterizerState(device, &rs_desc, &rs);
+ ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr);
+ ID3D11DeviceContext_RSSetState(context, rs);
+ draw_color_quad_z(&test_context, &blue, 0.5f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ ok(compare_color(color, blue_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+ ID3D11RasterizerState_Release(rs);
+ rs_desc.DepthBias = -100005;
+ ID3D11Device_CreateRasterizerState(device, &rs_desc, &rs);
+ ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr);
+ ID3D11DeviceContext_RSSetState(context, rs);
+ draw_color_quad_z(&test_context, &white, 0.5f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+ ID3D11RasterizerState_Release(rs);
+ rs_desc.DepthBias = -99995;
+ ID3D11Device_CreateRasterizerState(device, &rs_desc, &rs);
+ ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr);
+ ID3D11DeviceContext_RSSetState(context, rs);
+ draw_color_quad_z(&test_context, &green, 0.5f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+
+ ID3D11DepthStencilState_Release(ds_state);
+ ID3D11DepthStencilView_Release(ds_view);
+ ID3D11RasterizerState_Release(rs);
+ ID3D11Texture2D_Release(texture);
+ release_test_context(&test_context);
+}
+
static void test_uav_load(void)
{
struct shader
@@ -26490,6 +26693,7 @@ START_TEST(d3d11)
test_shader_input_registers_limits();
test_unbind_shader_resource_view();
test_stencil_separate();
+ test_depth_separate();
test_uav_load();
test_cs_uav_store();
test_uav_store_immediate_constant();
--
1.9.1

View File

@ -1,176 +0,0 @@
From 5fdb9b16c65609e00684062ccf426d19acb75b06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 7 Jul 2017 06:10:01 +0200
Subject: [PATCH 2/4] d3d11: Add support for DepthClipEnable in RSSetState.
---
dlls/d3d11/device.c | 4 ++--
dlls/d3d11/tests/d3d11.c | 4 ++--
dlls/wined3d/directx.c | 1 +
dlls/wined3d/state.c | 24 ++++++++++++++++++++++++
dlls/wined3d/stateblock.c | 2 ++
dlls/wined3d/utils.c | 1 +
dlls/wined3d/wined3d_gl.h | 1 +
include/wine/wined3d.h | 3 ++-
8 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 25308c2..555b05b 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -931,6 +931,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_CULLMODE, WINED3D_CULL_BACK);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, 0);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, 0);
+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHCLIP, TRUE);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, FALSE);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, FALSE);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ANTIALIASEDLINEENABLE, FALSE);
@@ -948,8 +949,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, scale_bias.d);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, const_bias.d);
/* GL_DEPTH_CLAMP */
- if (!desc->DepthClipEnable)
- FIXME("Ignoring DepthClipEnable %#x.\n", desc->DepthClipEnable);
+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHCLIP, (desc->DepthClipEnable != FALSE));
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, desc->ScissorEnable);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, desc->MultisampleEnable);
wined3d_device_set_render_state(device->wined3d_device,
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 9d9d74b..813660d 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -16924,7 +16924,7 @@ static void test_depth_separate(void)
draw_color_quad_z(&test_context, &green, 1.1f);
get_texture_readback(test_context.backbuffer, 0, &rb);
color = get_readback_color(&rb, 320, 240);
- todo_wine ok(compare_color(color, green_d, 1), "Got unexpected color 0x%08x.\n", color);
+ ok(compare_color(color, green_d, 1), "Got unexpected color 0x%08x.\n", color);
release_resource_readback(&rb);
ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
@@ -16932,7 +16932,7 @@ static void test_depth_separate(void)
draw_color_quad_z(&test_context, &green, -0.1f);
get_texture_readback(test_context.backbuffer, 0, &rb);
color = get_readback_color(&rb, 320, 240);
- todo_wine ok(compare_color(color, green_d, 1), "Got unexpected color 0x%08x.\n", color);
+ ok(compare_color(color, green_d, 1), "Got unexpected color 0x%08x.\n", color);
release_resource_readback(&rb);
/* depth bias */
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index f7f6452..b7a318a 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -122,6 +122,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
{"GL_ARB_cull_distance", ARB_CULL_DISTANCE },
{"GL_ARB_debug_output", ARB_DEBUG_OUTPUT },
{"GL_ARB_depth_buffer_float", ARB_DEPTH_BUFFER_FLOAT },
+ {"GL_ARB_depth_clamp", ARB_DEPTH_CLAMP },
{"GL_ARB_depth_texture", ARB_DEPTH_TEXTURE },
{"GL_ARB_derivative_control", ARB_DERIVATIVE_CONTROL },
{"GL_ARB_draw_buffers", ARB_DRAW_BUFFERS },
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 407ad62..25cc7d7 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1822,6 +1822,28 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3
checkGLcall("depth bias");
}
+static void state_depthclip(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
+{
+ const struct wined3d_gl_info *gl_info = context->gl_info;
+
+ if (state->render_states[WINED3D_RS_DEPTHCLIP])
+ {
+ gl_info->gl_ops.gl.p_glDisable(GL_DEPTH_CLAMP);
+ checkGLcall("glDisable(GL_DEPTH_CLAMP)");
+ }
+ else
+ {
+ gl_info->gl_ops.gl.p_glEnable(GL_DEPTH_CLAMP);
+ checkGLcall("glEnable(GL_DEPTH_CLAMP)");
+ }
+}
+
+static void state_depthclip_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
+{
+ if (!state->render_states[WINED3D_RS_DEPTHCLIP])
+ FIXME("Depth clamping not supported by GL.\n");
+}
+
static void state_zvisible(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
if (state->render_states[WINED3D_RS_ZVISIBLE])
@@ -5263,6 +5285,8 @@ const struct StateEntryTemplate misc_state_template[] =
{ STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor_w }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_DEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_ZVISIBLE), { STATE_RENDER(WINED3D_RS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE },
+ { STATE_RENDER(WINED3D_RS_DEPTHCLIP), { STATE_RENDER(WINED3D_RS_DEPTHCLIP), state_depthclip }, ARB_DEPTH_CLAMP },
+ { STATE_RENDER(WINED3D_RS_DEPTHCLIP), { STATE_RENDER(WINED3D_RS_DEPTHCLIP), state_depthclip_w }, WINED3D_GL_EXT_NONE },
/* Samplers */
{ STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler }, WINED3D_GL_EXT_NONE },
{ STATE_SAMPLER(1), { STATE_SAMPLER(1), sampler }, WINED3D_GL_EXT_NONE },
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 4c28eb5..3dae0d9 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -90,6 +90,7 @@ static const DWORD pixel_states_render[] =
WINED3D_RS_ZENABLE,
WINED3D_RS_ZFUNC,
WINED3D_RS_ZWRITEENABLE,
+ WINED3D_RS_DEPTHCLIP,
};
static const DWORD pixel_states_texture[] =
@@ -1243,6 +1244,7 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
state->render_states[WINED3D_RS_BLENDFACTOR] = 0xffffffff;
state->render_states[WINED3D_RS_SRGBWRITEENABLE] = 0;
state->render_states[WINED3D_RS_DEPTHBIAS] = 0;
+ state->render_states[WINED3D_RS_DEPTHCLIP] = TRUE;
state->render_states[WINED3D_RS_WRAP8] = 0;
state->render_states[WINED3D_RS_WRAP9] = 0;
state->render_states[WINED3D_RS_WRAP10] = 0;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 4e1da1c..853feda 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4446,6 +4446,7 @@ const char *debug_d3drenderstate(enum wined3d_render_state state)
D3DSTATE_TO_STR(WINED3D_RS_SRCBLENDALPHA);
D3DSTATE_TO_STR(WINED3D_RS_DESTBLENDALPHA);
D3DSTATE_TO_STR(WINED3D_RS_BLENDOPALPHA);
+ D3DSTATE_TO_STR(WINED3D_RS_DEPTHCLIP);
#undef D3DSTATE_TO_STR
default:
FIXME("Unrecognized %u render state!\n", state);
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index cc6f888..b982330 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -55,6 +55,7 @@ enum wined3d_gl_extension
ARB_CULL_DISTANCE,
ARB_DEBUG_OUTPUT,
ARB_DEPTH_BUFFER_FLOAT,
+ ARB_DEPTH_CLAMP,
ARB_DEPTH_TEXTURE,
ARB_DERIVATIVE_CONTROL,
ARB_DRAW_BUFFERS,
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index b6a2ec3..1944a65 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -386,8 +386,9 @@ enum wined3d_render_state
WINED3D_RS_SRCBLENDALPHA = 207,
WINED3D_RS_DESTBLENDALPHA = 208,
WINED3D_RS_BLENDOPALPHA = 209,
+ WINED3D_RS_DEPTHCLIP = 210,
};
-#define WINEHIGHEST_RENDER_STATE WINED3D_RS_BLENDOPALPHA
+#define WINEHIGHEST_RENDER_STATE WINED3D_RS_DEPTHCLIP
enum wined3d_blend
{
--
2.7.4

View File

@ -1,64 +0,0 @@
From 45291eca9ac098c90471c179a87f882a73ef10b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 7 Oct 2017 00:39:35 +0200
Subject: [PATCH 3/4] d3d11/tests: Add basic test for depth bias clamping.
---
dlls/d3d11/tests/d3d11.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 813660d..2a576e5 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -16971,6 +16971,47 @@ static void test_depth_separate(void)
ok(compare_color(color, white_d, 1), "Got unexpected color 0x%08x.\n", color);
release_resource_readback(&rb);
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ ID3D11DeviceContext_ClearDepthStencilView(context, ds_view, D3D11_CLEAR_DEPTH, 1.0f, 0);
+ draw_color_quad_z(&test_context, &green, 0.5f);
+ ID3D11RasterizerState_Release(rs);
+
+ rs_desc.DepthClipEnable = TRUE;
+ rs_desc.DepthBias = -100000;
+ ID3D11Device_CreateRasterizerState(device, &rs_desc, &rs);
+ ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr);
+ ID3D11DeviceContext_RSSetState(context, rs);
+ draw_color_quad_z(&test_context, &blue, 0.5f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ ok(compare_color(color, blue_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+ ID3D11RasterizerState_Release(rs);
+
+ rs_desc.DepthBias = -100005;
+ rs_desc.DepthBiasClamp = -0.00001f;
+ ID3D11Device_CreateRasterizerState(device, &rs_desc, &rs);
+ ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr);
+ ID3D11DeviceContext_RSSetState(context, rs);
+ draw_color_quad_z(&test_context, &white, 0.5f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ todo_wine ok(compare_color(color, blue_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+ ID3D11RasterizerState_Release(rs);
+
+ rs_desc.DepthBias = -100010;
+ rs_desc.DepthBiasClamp = -1.0f;
+ ID3D11Device_CreateRasterizerState(device, &rs_desc, &rs);
+ ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr);
+ ID3D11DeviceContext_RSSetState(context, rs);
+ draw_color_quad_z(&test_context, &green, 0.5f);
+ get_texture_readback(test_context.backbuffer, 0, &rb);
+ color = get_readback_color(&rb, 320, 240);
+ ok(compare_color(color, green_d, 1), "Got unexpected color 0x%08x.\n", color);
+ release_resource_readback(&rb);
+ ID3D11RasterizerState_Release(rs);
+
ID3D11DepthStencilState_Release(ds_state);
ID3D11DepthStencilView_Release(ds_view);
ID3D11RasterizerState_Release(rs);
--
2.7.4

View File

@ -1,11 +1,10 @@
From 34656e2180491f3946d1a66a02d55b8b110095fe Mon Sep 17 00:00:00 2001
From a93e855c484c622efedfe9696eac72c32007621d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 7 Oct 2017 00:52:34 +0200
Subject: [PATCH 4/4] wined3d: Add support for depth bias clamping.
Subject: wined3d: Add support for depth bias clamping.
---
dlls/d3d11/device.c | 7 +++++--
dlls/d3d11/tests/d3d11.c | 2 +-
dlls/d3d11/device.c | 5 ++++-
dlls/wined3d/cs.c | 1 +
dlls/wined3d/directx.c | 3 +++
dlls/wined3d/state.c | 17 +++++++++++++++--
@ -13,13 +12,13 @@ Subject: [PATCH 4/4] wined3d: Add support for depth bias clamping.
dlls/wined3d/utils.c | 1 +
dlls/wined3d/wined3d_gl.h | 1 +
include/wine/wined3d.h | 3 ++-
9 files changed, 31 insertions(+), 6 deletions(-)
8 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 555b05b..835ea8b 100644
index 68d6cf0..9854906 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -919,7 +919,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
@@ -920,7 +920,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
{
DWORD d;
float f;
@ -28,45 +27,30 @@ index 555b05b..835ea8b 100644
TRACE("iface %p, rasterizer_state %p.\n", iface, rasterizer_state);
@@ -932,6 +932,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
@@ -932,6 +932,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_CULLMODE, WINED3D_CULL_BACK);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, 0);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, 0);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHCLIP, TRUE);
+ bias_clamp.f = 0.0f;
+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIASCLAMP, bias_clamp.d);
+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIASCLAMP, 0);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, FALSE);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, FALSE);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ANTIALIASEDLINEENABLE, FALSE);
@@ -946,9 +948,10 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
@@ -946,8 +947,10 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_CULLMODE, desc->CullMode);
scale_bias.f = desc->SlopeScaledDepthBias;
const_bias.f = desc->DepthBias;
+ bias_clamp.f = desc->DepthBiasClamp;
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, scale_bias.d);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, const_bias.d);
- /* GL_DEPTH_CLAMP */
+ wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIASCLAMP, bias_clamp.d);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHCLIP, (desc->DepthClipEnable != FALSE));
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, desc->ScissorEnable);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, desc->MultisampleEnable);
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 2a576e5..540da93 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -16996,7 +16996,7 @@ static void test_depth_separate(void)
draw_color_quad_z(&test_context, &white, 0.5f);
get_texture_readback(test_context.backbuffer, 0, &rb);
color = get_readback_color(&rb, 320, 240);
- todo_wine ok(compare_color(color, blue_d, 1), "Got unexpected color 0x%08x.\n", color);
+ ok(compare_color(color, blue_d, 1), "Got unexpected color 0x%08x.\n", color);
release_resource_readback(&rb);
ID3D11RasterizerState_Release(rs);
wined3d_device_set_render_state(device->wined3d_device,
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 2f77c7b..68d5759 100644
index 3f1ca8c..aea2cdf 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -1038,6 +1038,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
@@ -1065,6 +1065,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
device_invalidate_state(device, STATE_RENDER(WINED3D_RS_STENCILENABLE));
device_invalidate_state(device, STATE_RENDER(WINED3D_RS_STENCILWRITEMASK));
device_invalidate_state(device, STATE_RENDER(WINED3D_RS_DEPTHBIAS));
@ -75,10 +59,10 @@ index 2f77c7b..68d5759 100644
else if (prev && prev->format->depth_bias_scale != op->view->format->depth_bias_scale)
{
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index b7a318a..e282c10 100644
index a4e4a0c..e595da5 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -231,6 +231,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
@@ -233,6 +233,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
{"GL_EXT_packed_depth_stencil", EXT_PACKED_DEPTH_STENCIL },
{"GL_EXT_packed_float", EXT_PACKED_FLOAT },
{"GL_EXT_point_parameters", EXT_POINT_PARAMETERS },
@ -86,7 +70,7 @@ index b7a318a..e282c10 100644
{"GL_EXT_provoking_vertex", EXT_PROVOKING_VERTEX },
{"GL_EXT_secondary_color", EXT_SECONDARY_COLOR },
{"GL_EXT_stencil_two_side", EXT_STENCIL_TWO_SIDE },
@@ -3114,6 +3115,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
@@ -3117,6 +3118,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
/* GL_EXT_point_parameters */
USE_GL_FUNC(glPointParameterfEXT)
USE_GL_FUNC(glPointParameterfvEXT)
@ -96,10 +80,10 @@ index b7a318a..e282c10 100644
USE_GL_FUNC(glProvokingVertexEXT)
/* GL_EXT_secondary_color */
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 25cc7d7..3460d69 100644
index 3b2f845..2dd6ac2 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1782,10 +1782,11 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3
@@ -1781,10 +1781,11 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3
{
DWORD d;
float f;
@ -112,7 +96,7 @@ index 25cc7d7..3460d69 100644
if (context->d3d_info->wined3d_creation_flags & WINED3D_LEGACY_DEPTH_BIAS)
{
@@ -1812,7 +1813,18 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3
@@ -1811,7 +1812,18 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3
}
gl_info->gl_ops.gl.p_glEnable(GL_POLYGON_OFFSET_FILL);
@ -132,32 +116,32 @@ index 25cc7d7..3460d69 100644
}
else
{
@@ -5284,6 +5296,7 @@ const struct StateEntryTemplate misc_state_template[] =
@@ -4678,6 +4690,7 @@ const struct StateEntryTemplate misc_state_template[] =
{ STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor }, EXT_BLEND_COLOR },
{ STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor_w }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_DEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE },
+ { STATE_RENDER(WINED3D_RS_DEPTHBIASCLAMP), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_ZVISIBLE), { STATE_RENDER(WINED3D_RS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_DEPTHCLIP), { STATE_RENDER(WINED3D_RS_DEPTHCLIP), state_depthclip }, ARB_DEPTH_CLAMP },
{ STATE_RENDER(WINED3D_RS_DEPTHCLIP), { STATE_RENDER(WINED3D_RS_DEPTHCLIP), state_depthclip_w }, WINED3D_GL_EXT_NONE },
/* Samplers */
{ STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler }, WINED3D_GL_EXT_NONE },
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 3dae0d9..b9efcec 100644
index b4d1751..093c740 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1244,6 +1244,8 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
@@ -1257,6 +1257,8 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
state->render_states[WINED3D_RS_BLENDFACTOR] = 0xffffffff;
state->render_states[WINED3D_RS_SRGBWRITEENABLE] = 0;
state->render_states[WINED3D_RS_DEPTHBIAS] = 0;
+ tmpfloat.f = 0.0f;
+ state->render_states[WINED3D_RS_DEPTHBIASCLAMP] = tmpfloat.d;
state->render_states[WINED3D_RS_DEPTHCLIP] = TRUE;
state->render_states[WINED3D_RS_WRAP8] = 0;
state->render_states[WINED3D_RS_WRAP9] = 0;
state->render_states[WINED3D_RS_WRAP10] = 0;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 853feda..5de53d0 100644
index 7cecd8c..0152879 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4434,6 +4434,7 @@ const char *debug_d3drenderstate(enum wined3d_render_state state)
@@ -4425,6 +4425,7 @@ const char *debug_d3drenderstate(enum wined3d_render_state state)
D3DSTATE_TO_STR(WINED3D_RS_BLENDFACTOR);
D3DSTATE_TO_STR(WINED3D_RS_SRGBWRITEENABLE);
D3DSTATE_TO_STR(WINED3D_RS_DEPTHBIAS);
@ -166,10 +150,10 @@ index 853feda..5de53d0 100644
D3DSTATE_TO_STR(WINED3D_RS_WRAP9);
D3DSTATE_TO_STR(WINED3D_RS_WRAP10);
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index b982330..12e15cc 100644
index 525c298..883faaa 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -162,6 +162,7 @@ enum wined3d_gl_extension
@@ -164,6 +164,7 @@ enum wined3d_gl_extension
EXT_PACKED_DEPTH_STENCIL,
EXT_PACKED_FLOAT,
EXT_POINT_PARAMETERS,
@ -178,16 +162,16 @@ index b982330..12e15cc 100644
EXT_SECONDARY_COLOR,
EXT_STENCIL_TWO_SIDE,
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 1944a65..8864965 100644
index bb4ad48..4a5d0dd 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -387,8 +387,9 @@ enum wined3d_render_state
@@ -386,8 +386,9 @@ enum wined3d_render_state
WINED3D_RS_SRCBLENDALPHA = 207,
WINED3D_RS_DESTBLENDALPHA = 208,
WINED3D_RS_BLENDOPALPHA = 209,
WINED3D_RS_DEPTHCLIP = 210,
+ WINED3D_RS_DEPTHBIASCLAMP = 211,
+ WINED3D_RS_DEPTHBIASCLAMP = 210,
};
-#define WINEHIGHEST_RENDER_STATE WINED3D_RS_DEPTHCLIP
-#define WINEHIGHEST_RENDER_STATE WINED3D_RS_BLENDOPALPHA
+#define WINEHIGHEST_RENDER_STATE WINED3D_RS_DEPTHBIASCLAMP
enum wined3d_blend

View File

@ -1,2 +1,3 @@
Fixes: [23999] Implement MemorySectionName class in NtQueryVirtualMemory
Fixes: [27248] Implement K32GetMappedFileName
Depends: ntdll-NtDevicePath

View File

@ -1,8 +1,8 @@
Fixes: Fix wrong defition of ntoskrnl.IoReleaseCancelSpinLock function.
Fixes: [37355] Add stub for ntoskrnl.Mm{Map,Unmap}LockedPages
Fixes: Add stub for ntoskrnl.Mm{Map,Unmap}LockedPages
Fixes: Implement ntoskrnl.KeInitializeMutex
Fixes: Add stub for ntoskrnl.IoGetDeviceAttachmentBaseRef
Fixes: Implement ntoskrnl.ExInterlockedPopEntrySList
Fixes: Implement ntoskrnl.NtBuildNumber
Fixes: Implement ntoskrnl.ExInitializeNPagedLookasideList
# ExInitializeNPagedLookasideList() is wanted by sfvfs02.sys, used by World Racing.
Depends: Compiler_Warnings

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "8e9ea7a8a163147012908bad696a539454654d8f"
echo "8b9ba16e9ad9ca85b93b05c13d6c5044a1a5ecf3"
}
# Show version information
@ -2887,22 +2887,17 @@ fi
# |
# | Modified files:
# | * dlls/d2d1/Makefile.in, dlls/d2d1/bitmap.c, dlls/d2d1/brush.c, dlls/d2d1/d2d1_private.h, dlls/d2d1/device.c,
# | dlls/d2d1/device_context.c, dlls/d2d1/factory.c, dlls/d2d1/geometry.c, dlls/d2d1/render_target.c,
# | dlls/d2d1/tests/d2d1.c, include/d2d1_1.idl, include/dcommon.idl
# | dlls/d2d1/device_context.c, dlls/d2d1/factory.c, dlls/d2d1/geometry.c, include/d2d1_1.idl, include/dcommon.idl
# |
if test "$enable_d2d1_ID2D1Factory1" -eq 1; then
patch_apply d2d1-ID2D1Factory1/0001-d2d1-Add-d2d1_1.idl-for-drawing-ID2D1Bitmap1.patch
patch_apply d2d1-ID2D1Factory1/0002-d2d1-Test-ID2D1DeviceContext-drawing-ID2D1Bitmap1.patch
patch_apply d2d1-ID2D1Factory1/0003-d2d1-Use-ID2D1Factory1-in-d2d_geometry.patch
patch_apply d2d1-ID2D1Factory1/0004-d2d1-Implement-ID2D1Device.patch
patch_apply d2d1-ID2D1Factory1/0005-d2d1-Stub-ID2D1DeviceContext.patch
patch_apply d2d1-ID2D1Factory1/0006-d2d1-Implement-ID2D1DeviceContext.patch
patch_apply d2d1-ID2D1Factory1/0007-d2d1-Implement-ID2D1Bitmap1.patch
(
printf '%s\n' '+ { "Lucian Poston", "d2d1: Add d2d1_1.idl for drawing ID2D1Bitmap1.", 1 },';
printf '%s\n' '+ { "Lucian Poston", "d2d1: Test ID2D1DeviceContext drawing ID2D1Bitmap1.", 1 },';
printf '%s\n' '+ { "Lucian Poston", "d2d1: Use ID2D1Factory1 in d2d_geometry.", 1 },';
printf '%s\n' '+ { "Lucian Poston", "d2d1: Implement ID2D1Device.", 1 },';
printf '%s\n' '+ { "Lucian Poston", "d2d1: Stub ID2D1DeviceContext.", 1 },';
printf '%s\n' '+ { "Lucian Poston", "d2d1: Implement ID2D1DeviceContext.", 1 },';
printf '%s\n' '+ { "Lucian Poston", "d2d1: Implement ID2D1Bitmap1.", 1 },';
@ -3110,18 +3105,12 @@ fi
# | * [#43848] Implement support for depth bias clamping
# |
# | Modified files:
# | * dlls/d3d11/device.c, dlls/d3d11/tests/d3d11.c, dlls/wined3d/cs.c, dlls/wined3d/directx.c, dlls/wined3d/state.c,
# | dlls/wined3d/stateblock.c, dlls/wined3d/utils.c, dlls/wined3d/wined3d_gl.h, include/wine/wined3d.h
# | * dlls/d3d11/device.c, dlls/wined3d/cs.c, dlls/wined3d/directx.c, dlls/wined3d/state.c, dlls/wined3d/stateblock.c,
# | dlls/wined3d/utils.c, dlls/wined3d/wined3d_gl.h, include/wine/wined3d.h
# |
if test "$enable_d3d11_Depth_Bias" -eq 1; then
patch_apply d3d11-Depth_Bias/0002-d3d11-tests-Add-some-basic-depth-tests.patch
patch_apply d3d11-Depth_Bias/0004-d3d11-Add-support-for-DepthClipEnable-in-RSSetState.patch
patch_apply d3d11-Depth_Bias/0005-d3d11-tests-Add-basic-test-for-depth-bias-clamping.patch
patch_apply d3d11-Depth_Bias/0006-wined3d-Add-support-for-depth-bias-clamping.patch
(
printf '%s\n' '+ { "Michael Müller", "d3d11/tests: Add some basic depth tests.", 1 },';
printf '%s\n' '+ { "Michael Müller", "d3d11: Add support for DepthClipEnable in RSSetState.", 1 },';
printf '%s\n' '+ { "Michael Müller", "d3d11/tests: Add basic test for depth bias clamping.", 1 },';
printf '%s\n' '+ { "Michael Müller", "wined3d: Add support for depth bias clamping.", 1 },';
) >> "$patchlist"
fi
@ -5231,6 +5220,7 @@ fi
# |
# | This patchset fixes the following Wine bugs:
# | * [#23999] Implement MemorySectionName class in NtQueryVirtualMemory
# | * [#27248] Implement K32GetMappedFileName
# |
# | Modified files:
# | * dlls/kernel32/virtual.c, dlls/ntdll/directory.c, dlls/ntdll/ntdll_misc.h, dlls/ntdll/tests/info.c, dlls/ntdll/virtual.c,
@ -5547,9 +5537,6 @@ fi
# | This patchset has the following (direct or indirect) dependencies:
# | * Compiler_Warnings
# |
# | This patchset fixes the following Wine bugs:
# | * [#37355] Add stub for ntoskrnl.Mm{Map,Unmap}LockedPages
# |
# | Modified files:
# | * dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec, dlls/ntoskrnl.exe/tests/driver.c, include/ddk/wdm.h,
# | include/winnt.h

View File

@ -1,4 +1,4 @@
From 75844a9945a5b9f6c5580c54346af548e29cbf02 Mon Sep 17 00:00:00 2001
From 1476a4a901c437d13b7dc7d318ae76e2177a0b59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 20 Jul 2017 13:50:07 +0200
Subject: [PATCH] wined3d: Implement all 8 d3d11 color write masks.
@ -17,10 +17,10 @@ Subject: [PATCH] wined3d: Implement all 8 d3d11 color write masks.
10 files changed, 73 insertions(+), 71 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 82901c2..8779980 100644
index 9854906..685c86e 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -2068,6 +2068,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
@@ -689,6 +689,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
static const float default_blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f};
struct d3d_blend_state *blend_state_impl;
const D3D11_BLEND_DESC *desc;
@ -28,7 +28,7 @@ index 82901c2..8779980 100644
TRACE("iface %p, blend_state %p, blend_factor %s, sample_mask 0x%08x.\n",
iface, blend_state, debug_float4(blend_factor), sample_mask);
@@ -2082,14 +2083,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
@@ -703,14 +704,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
{
wined3d_device_set_blend_state(device->wined3d_device, NULL);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ALPHABLENDENABLE, FALSE);
@ -48,7 +48,7 @@ index 82901c2..8779980 100644
wined3d_mutex_unlock();
return;
}
@@ -2117,14 +2115,13 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
@@ -738,14 +736,13 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
|| d->DestBlendAlpha == D3D11_BLEND_BLEND_FACTOR || d->DestBlendAlpha == D3D11_BLEND_INV_BLEND_FACTOR))
FIXME("Ignoring blend factor %s.\n", debug_float4(blend_factor));
}
@ -71,7 +71,7 @@ index 82901c2..8779980 100644
}
diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c
index f880a23..e5bd1de 100644
index d4c3bef..ed4ba5e 100644
--- a/dlls/d3d11/state.c
+++ b/dlls/d3d11/state.c
@@ -335,10 +335,6 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC
@ -86,7 +86,7 @@ index f880a23..e5bd1de 100644
/* glEnableIndexedEXT(GL_BLEND, ...) */
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index b1a28b8..3681cb8 100644
index 21ad11d..4d66dff 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2746,7 +2746,7 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wine
@ -111,7 +111,7 @@ index b1a28b8..3681cb8 100644
context->last_was_rhw = TRUE;
context_invalidate_state(context, STATE_VDECL); /* because of last_was_rhw = TRUE */
@@ -4836,7 +4834,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
@@ -4827,7 +4825,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
if (!(rtv = fb->render_targets[i]) || rtv->format->id == WINED3DFMT_NULL)
continue;
@ -121,7 +121,7 @@ index b1a28b8..3681cb8 100644
wined3d_rendertarget_view_load_location(rtv, context, rtv->resource->draw_binding);
wined3d_rendertarget_view_invalidate_location(rtv, ~rtv->resource->draw_binding);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 50452b5..0067199 100644
index 9906f74..9ee4b27 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -392,10 +392,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
@ -138,10 +138,10 @@ index 50452b5..0067199 100644
checkGLcall("glClearColor");
clear_mask = clear_mask | GL_COLOR_BUFFER_BIT;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index ab7e033..b5f39e5 100644
index 2dd6ac2..d37e809 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1565,9 +1565,6 @@ static void state_debug_monitor(struct wined3d_context *context, const struct wi
@@ -1555,9 +1555,6 @@ static void state_debug_monitor(struct wined3d_context *context, const struct wi
static void state_colorwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
DWORD mask0 = state->render_states[WINED3D_RS_COLORWRITEENABLE];
@ -151,7 +151,7 @@ index ab7e033..b5f39e5 100644
const struct wined3d_gl_info *gl_info = context->gl_info;
TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n",
@@ -1581,13 +1578,7 @@ static void state_colorwrite(struct wined3d_context *context, const struct wined
@@ -1571,13 +1568,7 @@ static void state_colorwrite(struct wined3d_context *context, const struct wined
mask0 & WINED3DCOLORWRITEENABLE_ALPHA ? GL_TRUE : GL_FALSE);
checkGLcall("glColorMask(...)");
@ -166,7 +166,7 @@ index ab7e033..b5f39e5 100644
}
static void set_color_mask(const struct wined3d_gl_info *gl_info, UINT index, DWORD mask)
@@ -1600,24 +1591,20 @@ static void set_color_mask(const struct wined3d_gl_info *gl_info, UINT index, DW
@@ -1590,24 +1581,20 @@ static void set_color_mask(const struct wined3d_gl_info *gl_info, UINT index, DW
checkGLcall("glColorMaski");
}
@ -201,7 +201,7 @@ index ab7e033..b5f39e5 100644
}
static void state_localviewer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
@@ -4689,18 +4676,26 @@ const struct StateEntryTemplate misc_state_template[] =
@@ -4675,18 +4662,26 @@ const struct StateEntryTemplate misc_state_template[] =
{ STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), state_msaa_w }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), { STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), state_multisampmask }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), state_debug_monitor }, WINED3D_GL_EXT_NONE },
@ -236,7 +236,7 @@ index ab7e033..b5f39e5 100644
{ STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor_w }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_DEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE },
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 2f5f24a..e5025ce 100644
index 093c740..397ddaa 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -45,6 +45,10 @@ static const DWORD pixel_states_render[] =
@ -250,7 +250,7 @@ index 2f5f24a..e5025ce 100644
WINED3D_RS_DEPTHBIAS,
WINED3D_RS_DESTBLEND,
WINED3D_RS_DESTBLENDALPHA,
@@ -1226,7 +1230,6 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
@@ -1225,7 +1229,6 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
tmpfloat.f = gl_info->limits.pointsize_max;
state->render_states[WINED3D_RS_POINTSIZE_MAX] = tmpfloat.d;
state->render_states[WINED3D_RS_INDEXEDVERTEXBLENDENABLE] = FALSE;
@ -258,7 +258,7 @@ index 2f5f24a..e5025ce 100644
tmpfloat.f = 0.0f;
state->render_states[WINED3D_RS_TWEENFACTOR] = tmpfloat.d;
state->render_states[WINED3D_RS_BLENDOP] = WINED3D_BLEND_OP_ADD;
@@ -1252,9 +1255,6 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
@@ -1251,9 +1254,6 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
state->render_states[WINED3D_RS_BACK_STENCILZFAIL] = WINED3D_STENCIL_OP_KEEP;
state->render_states[WINED3D_RS_BACK_STENCILPASS] = WINED3D_STENCIL_OP_KEEP;
state->render_states[WINED3D_RS_BACK_STENCILFUNC] = WINED3D_CMP_ALWAYS;
@ -268,7 +268,7 @@ index 2f5f24a..e5025ce 100644
state->render_states[WINED3D_RS_BLENDFACTOR] = 0xffffffff;
state->render_states[WINED3D_RS_SRGBWRITEENABLE] = 0;
state->render_states[WINED3D_RS_DEPTHBIAS] = 0;
@@ -1273,6 +1273,8 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
@@ -1271,6 +1271,8 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
state->render_states[WINED3D_RS_SRCBLENDALPHA] = WINED3D_BLEND_ONE;
state->render_states[WINED3D_RS_DESTBLENDALPHA] = WINED3D_BLEND_ZERO;
state->render_states[WINED3D_RS_BLENDOPALPHA] = WINED3D_BLEND_OP_ADD;
@ -278,7 +278,7 @@ index 2f5f24a..e5025ce 100644
/* Texture Stage States - Put directly into state block, we will call function below */
for (i = 0; i < MAX_TEXTURES; ++i)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index e649fa3..baad32e 100644
index 5217033..9de0157 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -160,6 +160,7 @@ static void texture2d_blt_fbo(const struct wined3d_device *device, struct wined3
@ -303,10 +303,10 @@ index e649fa3..baad32e 100644
gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE));
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index d475b37..ab9fc45 100644
index 0152879..7a69bbd 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4398,7 +4398,6 @@ const char *debug_d3drenderstate(enum wined3d_render_state state)
@@ -4399,7 +4399,6 @@ const char *debug_d3drenderstate(enum wined3d_render_state state)
D3DSTATE_TO_STR(WINED3D_RS_DEBUGMONITORTOKEN);
D3DSTATE_TO_STR(WINED3D_RS_POINTSIZE_MAX);
D3DSTATE_TO_STR(WINED3D_RS_INDEXEDVERTEXBLENDENABLE);
@ -314,7 +314,7 @@ index d475b37..ab9fc45 100644
D3DSTATE_TO_STR(WINED3D_RS_TWEENFACTOR);
D3DSTATE_TO_STR(WINED3D_RS_BLENDOP);
D3DSTATE_TO_STR(WINED3D_RS_POSITIONDEGREE);
@@ -4418,9 +4417,14 @@ const char *debug_d3drenderstate(enum wined3d_render_state state)
@@ -4419,9 +4418,14 @@ const char *debug_d3drenderstate(enum wined3d_render_state state)
D3DSTATE_TO_STR(WINED3D_RS_BACK_STENCILZFAIL);
D3DSTATE_TO_STR(WINED3D_RS_BACK_STENCILPASS);
D3DSTATE_TO_STR(WINED3D_RS_BACK_STENCILFUNC);
@ -330,10 +330,10 @@ index d475b37..ab9fc45 100644
D3DSTATE_TO_STR(WINED3D_RS_SRGBWRITEENABLE);
D3DSTATE_TO_STR(WINED3D_RS_DEPTHBIAS);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4c22a5c..7c813bf 100644
index f2c4cd6..d72d53a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -276,6 +276,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup
@@ -275,6 +275,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup
#define MAX_UNORDERED_ACCESS_VIEWS 8
#define MAX_TGSM_REGISTERS 8192
#define MAX_VERTEX_BLENDS 4
@ -342,17 +342,17 @@ index 4c22a5c..7c813bf 100644
struct min_lookup
{
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 6772524..a3deb60 100644
index 4a5d0dd..c629c12 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -390,8 +390,20 @@ enum wined3d_render_state
@@ -387,8 +387,20 @@ enum wined3d_render_state
WINED3D_RS_DESTBLENDALPHA = 208,
WINED3D_RS_BLENDOPALPHA = 209,
WINED3D_RS_DEPTHCLIP = 210,
WINED3D_RS_DEPTHBIASCLAMP = 211,
+ WINED3D_RS_COLORWRITEENABLE4 = 212,
+ WINED3D_RS_COLORWRITEENABLE5 = 213,
+ WINED3D_RS_COLORWRITEENABLE6 = 214,
+ WINED3D_RS_COLORWRITEENABLE7 = 215,
WINED3D_RS_DEPTHBIASCLAMP = 210,
+ WINED3D_RS_COLORWRITEENABLE4 = 211,
+ WINED3D_RS_COLORWRITEENABLE5 = 212,
+ WINED3D_RS_COLORWRITEENABLE6 = 213,
+ WINED3D_RS_COLORWRITEENABLE7 = 214,
};
-#define WINEHIGHEST_RENDER_STATE WINED3D_RS_DEPTHBIASCLAMP
+#define WINEHIGHEST_RENDER_STATE WINED3D_RS_COLORWRITEENABLE7
@ -368,5 +368,5 @@ index 6772524..a3deb60 100644
enum wined3d_blend
{
--
1.9.1
2.7.4