[PATCH] d3dx10: Implement D3DX10UnsetAllDeviceObjects()

Nikolay Sivov nsivov at codeweavers.com
Sat Apr 23 01:49:09 CDT 2016


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 configure                        |   1 +
 configure.ac                     |   1 +
 dlls/d3dx10_43/d3dx10_43_main.c  |  46 +-
 dlls/d3dx10_43/tests/Makefile.in |   5 +
 dlls/d3dx10_43/tests/d3dx10.c    | 875 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 926 insertions(+), 2 deletions(-)
 create mode 100644 dlls/d3dx10_43/tests/Makefile.in
 create mode 100644 dlls/d3dx10_43/tests/d3dx10.c

diff --git a/configure b/configure
index dcec63c..4a6cd3d 100755
--- a/configure
+++ b/configure
@@ -17592,6 +17592,7 @@ wine_fn_config_dll d3dx10_40 enable_d3dx10_40
 wine_fn_config_dll d3dx10_41 enable_d3dx10_41
 wine_fn_config_dll d3dx10_42 enable_d3dx10_42
 wine_fn_config_dll d3dx10_43 enable_d3dx10_43 implib d3dx10
+wine_fn_config_test dlls/d3dx10_43/tests d3dx10_43_test
 wine_fn_config_dll d3dx11_42 enable_d3dx11_42
 wine_fn_config_dll d3dx11_43 enable_d3dx11_43
 wine_fn_config_dll d3dx9_24 enable_d3dx9_24
diff --git a/configure.ac b/configure.ac
index b0d94ce..048f9d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2840,6 +2840,7 @@ WINE_CONFIG_DLL(d3dx10_40)
 WINE_CONFIG_DLL(d3dx10_41)
 WINE_CONFIG_DLL(d3dx10_42)
 WINE_CONFIG_DLL(d3dx10_43,,[implib],[d3dx10])
+WINE_CONFIG_TEST(dlls/d3dx10_43/tests)
 WINE_CONFIG_DLL(d3dx11_42)
 WINE_CONFIG_DLL(d3dx11_43)
 WINE_CONFIG_DLL(d3dx9_24)
diff --git a/dlls/d3dx10_43/d3dx10_43_main.c b/dlls/d3dx10_43/d3dx10_43_main.c
index 68948b4..65f0f00 100644
--- a/dlls/d3dx10_43/d3dx10_43_main.c
+++ b/dlls/d3dx10_43/d3dx10_43_main.c
@@ -119,9 +119,51 @@ HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(const void *data, SIZE_T datasiz
 
 HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *device)
 {
-    FIXME("device %p stub.\n", device);
+    static ID3D10Buffer *buffers[D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+    static ID3D10SamplerState *sampler_states[D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT];
+    static ID3D10ShaderResourceView *views[D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT];
+    static ID3D10RenderTargetView *target_views[D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT];
+    static const UINT strides[D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+    static const UINT offsets[D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+    static const FLOAT blend_factors[4];
 
-    return E_NOTIMPL;
+    TRACE("device %p.\n", device);
+
+    if (!device)
+        return E_INVALIDARG;
+
+    ID3D10Device_VSSetConstantBuffers(device, 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, buffers);
+    ID3D10Device_PSSetConstantBuffers(device, 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, buffers);
+    ID3D10Device_GSSetConstantBuffers(device, 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, buffers);
+
+    ID3D10Device_VSSetSamplers(device, 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT, sampler_states);
+    ID3D10Device_PSSetSamplers(device, 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT, sampler_states);
+    ID3D10Device_GSSetSamplers(device, 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT, sampler_states);
+
+    ID3D10Device_VSSetShaderResources(device, 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, views);
+    ID3D10Device_PSSetShaderResources(device, 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, views);
+    ID3D10Device_GSSetShaderResources(device, 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, views);
+
+    ID3D10Device_VSSetShader(device, NULL);
+    ID3D10Device_PSSetShader(device, NULL);
+    ID3D10Device_GSSetShader(device, NULL);
+
+    ID3D10Device_OMSetRenderTargets(device, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT, target_views, NULL);
+
+    ID3D10Device_IASetIndexBuffer(device, NULL, DXGI_FORMAT_R32_UINT, 0);
+    ID3D10Device_IASetInputLayout(device, NULL);
+    ID3D10Device_IASetVertexBuffers(device, 0, D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT, buffers, strides, offsets);
+
+    ID3D10Device_SOSetTargets(device, D3D10_SO_BUFFER_SLOT_COUNT, buffers, offsets);
+
+    ID3D10Device_OMSetBlendState(device, NULL, blend_factors, 0);
+    ID3D10Device_OMSetDepthStencilState(device, NULL, 0);
+
+    ID3D10Device_RSSetState(device, NULL);
+
+    ID3D10Device_SetPredication(device, NULL, FALSE);
+
+    return S_OK;
 }
 
 HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
diff --git a/dlls/d3dx10_43/tests/Makefile.in b/dlls/d3dx10_43/tests/Makefile.in
new file mode 100644
index 0000000..f9f988f
--- /dev/null
+++ b/dlls/d3dx10_43/tests/Makefile.in
@@ -0,0 +1,5 @@
+TESTDLL = d3dx10_43.dll
+IMPORTS = d3dx10
+
+C_SRCS = \
+	d3dx10.c
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c
new file mode 100644
index 0000000..3eca71e
--- /dev/null
+++ b/dlls/d3dx10_43/tests/d3dx10.c
@@ -0,0 +1,875 @@
+/*
+ * Copyright 2016 Nikolay Sivov for CodeWeavers
+ *
+ * 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
+ */
+
+#define COBJMACROS
+#include "initguid.h"
+#include "d3dx10.h"
+#include "wine/test.h"
+
+static unsigned int call_seq_no;
+static HRESULT WINAPI testdevice_QI(ID3D10Device *iface, REFIID riid, void **obj)
+{
+    if (IsEqualIID(riid, &IID_ID3D10Device) || IsEqualIID(riid, &IID_IUnknown))
+    {
+        *obj = iface;
+        ID3D10Device_AddRef(iface);
+        return S_OK;
+    }
+
+    ok(0, "unexpected QI riid %s\n", wine_dbgstr_guid(riid));
+    *obj = NULL;
+    return E_NOINTERFACE;
+}
+
+static ULONG WINAPI testdevice_AddRef(ID3D10Device *iface)
+{
+    return 2;
+}
+
+static ULONG WINAPI testdevice_Release(ID3D10Device *iface)
+{
+    return 1;
+}
+
+static void WINAPI testdevice_VSSetConstantBuffers(ID3D10Device *iface, UINT start_slot, UINT num_buffers,
+        ID3D10Buffer *const *buffers)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 1, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(start_slot == 0, "got start slot %u\n", start_slot);
+    ok(num_buffers == D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, "got num buffers %u\n", num_buffers);
+    ok(buffers != NULL, "got buffers %p\n", buffers);
+
+    for (i = 0; i < num_buffers; i++)
+        ok(buffers[i] == NULL, "%u: buffer %p\n", i, buffers[i]);
+}
+
+static void WINAPI testdevice_PSSetShaderResources(ID3D10Device *iface, UINT start_slot, UINT num_views,
+        ID3D10ShaderResourceView *const *views)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 8, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(start_slot == 0, "got start slot %u\n", start_slot);
+    ok(num_views == D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, "got num views %u\n",
+        num_views);
+    ok(views != NULL, "got samplers %p\n", views);
+
+    for (i = 0; i < num_views; i++)
+        ok(views[i] == NULL, "%u: viewer %p\n", i, views[i]);
+}
+
+static void WINAPI testdevice_PSSetShader(ID3D10Device *iface, ID3D10PixelShader *ps)
+{
+    call_seq_no++;
+    ok(call_seq_no == 11, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(ps == NULL, "got %p\n", ps);
+}
+
+static void WINAPI testdevice_PSSetSamplers(ID3D10Device *iface, UINT start_slot, UINT num_samplers,
+        ID3D10SamplerState *const *samplers)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 5, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(start_slot == 0, "got start slot %u\n", start_slot);
+    ok(num_samplers == D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT , "got num samplers %u\n", num_samplers);
+    ok(samplers != NULL, "got buffers %p\n", samplers);
+
+    for (i = 0; i < num_samplers; i++)
+        ok(samplers[i] == NULL, "%u: buffer %p\n", i, samplers[i]);
+}
+
+static void WINAPI testdevice_VSSetShader(ID3D10Device *iface, ID3D10VertexShader *vs)
+{
+    call_seq_no++;
+    ok(call_seq_no == 10, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(vs == NULL, "got %p\n", vs);
+}
+
+static void WINAPI testdevice_DrawIndexed(ID3D10Device *iface, UINT index_count, UINT start_location,
+        INT base_location)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_Draw(ID3D10Device *iface, UINT vertex_count, UINT start_location)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_PSSetConstantBuffers(ID3D10Device *iface, UINT start_slot, UINT num_buffers,
+        ID3D10Buffer *const *buffers)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 2, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(start_slot == 0, "got start slot %u\n", start_slot);
+    ok(num_buffers == D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, "got num buffers %u\n", num_buffers);
+    ok(buffers != NULL, "got buffers %p\n", buffers);
+
+    for (i = 0; i < num_buffers; i++)
+        ok(buffers[i] == NULL, "%u: buffer %p\n", i, buffers[i]);
+}
+
+static void WINAPI testdevice_IASetInputLayout(ID3D10Device *iface, ID3D10InputLayout *inputlayout)
+{
+    call_seq_no++;
+    ok(call_seq_no == 15, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(inputlayout == NULL, "got %p\n", inputlayout);
+}
+
+static void WINAPI testdevice_IASetVertexBuffers(ID3D10Device *iface, UINT start_slot, UINT num_buffers,
+        ID3D10Buffer *const *buffers, const UINT *strides, const UINT *offsets)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 16, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(start_slot == 0, "got start slot %u\n", start_slot);
+    ok(num_buffers == D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT, "got num buffers %u\n", num_buffers);
+    ok(buffers != NULL, "got buffers %p\n", buffers);
+    ok(strides != NULL, "got strides %p\n", strides);
+    ok(offsets != NULL, "got offsets %p\n", offsets);
+
+    for (i = 0; i < num_buffers; i++)
+    {
+        ok(buffers[i] == NULL, "%u: buffer %p\n", i, buffers[i]);
+        ok(strides[i] == 0, "%u: stride %u\n", i, strides[i]);
+        ok(offsets[i] == 0, "%u: offset %u\n", i, offsets[i]);
+    }
+}
+
+static void WINAPI testdevice_IASetIndexBuffer(ID3D10Device *iface, ID3D10Buffer *buffer, DXGI_FORMAT format,
+        UINT offset)
+{
+    call_seq_no++;
+    ok(call_seq_no == 14, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(buffer == NULL, "got %p\n", buffer);
+    ok(format == DXGI_FORMAT_R32_UINT, "got format %u\n", format);
+    ok(offset == 0, "got offset %u\n", offset);
+}
+
+static void WINAPI testdevice_DrawIndexedInstanced(ID3D10Device *iface, UINT index_count_per_instance,
+        UINT instance_count, UINT start_index_location, INT base_vertex_location, UINT start_instance_location)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_DrawInstanced(ID3D10Device *iface, UINT vertex_count_per_instance,
+        UINT instance_count, UINT start_vertex_location, UINT start_instance_location)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_GSSetConstantBuffers(ID3D10Device *iface, UINT start_slot, UINT num_buffers,
+        ID3D10Buffer *const *buffers)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 3, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(start_slot == 0, "got start slot %u\n", start_slot);
+    ok(num_buffers == D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, "got num buffers %u\n", num_buffers);
+    ok(buffers != NULL, "got buffers %p\n", buffers);
+
+    for (i = 0; i < num_buffers; i++)
+        ok(buffers[i] == NULL, "%u: buffer %p\n", i, buffers[i]);
+}
+
+static void WINAPI testdevice_GSSetShader(ID3D10Device *iface, ID3D10GeometryShader *gs)
+{
+    call_seq_no++;
+    ok(call_seq_no == 12, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(gs == NULL, "got %p\n", gs);
+}
+
+static void WINAPI testdevice_IASetPrimitiveTopology(ID3D10Device *iface, D3D10_PRIMITIVE_TOPOLOGY topology)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_VSSetShaderResources(ID3D10Device *iface, UINT start_slot, UINT num_views,
+        ID3D10ShaderResourceView *const *views)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 7, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(start_slot == 0, "got start slot %u\n", start_slot);
+    ok(num_views == D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, "got num views %u\n", num_views);
+    ok(views != NULL, "got views %p\n", views);
+
+    for (i = 0; i < num_views; i++)
+        ok(views[i] == NULL, "%u: views %p\n", i, views[i]);
+}
+
+static void WINAPI testdevice_VSSetSamplers(ID3D10Device *iface, UINT start_slot, UINT num_samplers,
+        ID3D10SamplerState *const *samplers)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 4, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(start_slot == 0, "got start slot %u\n", start_slot);
+    ok(num_samplers == D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT, "got num samplers %u\n", num_samplers);
+    ok(samplers != NULL, "got samplers %p\n", samplers);
+
+    for (i = 0; i < num_samplers; i++)
+        ok(samplers[i] == NULL, "%u: sampler %p\n", i, samplers[i]);
+}
+
+static void WINAPI testdevice_SetPredication(ID3D10Device *iface, ID3D10Predicate *predicate, BOOL value)
+{
+    call_seq_no++;
+    ok(call_seq_no == 21, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(predicate == NULL, "got predicate %p\n", predicate);
+    ok(!value, "got value %d\n", value);
+}
+
+static void WINAPI testdevice_GSSetShaderResources(ID3D10Device *iface, UINT start_slot, UINT num_views,
+        ID3D10ShaderResourceView * const *views)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 9, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(start_slot == 0, "got start slot %u\n", start_slot);
+    ok(num_views == D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, "got num views %u\n", num_views);
+    ok(views != NULL, "got views %p\n", views);
+
+    for (i = 0; i < num_views; i++)
+        ok(views[i] == NULL, "%u: views %p\n", i, views[i]);
+}
+
+static void WINAPI testdevice_GSSetSamplers(ID3D10Device *iface, UINT start_slot, UINT num_samplers,
+        ID3D10SamplerState *const *samplers)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 6, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(start_slot == 0, "got start slot %u\n", start_slot);
+    ok(num_samplers == D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT, "got num samplers %u\n", num_samplers);
+    ok(samplers != NULL, "got samplers %p\n", samplers);
+
+    for (i = 0; i < num_samplers; i++)
+        ok(samplers[i] == NULL, "%u: sampler %p\n", i, samplers[i]);
+}
+
+static void WINAPI testdevice_OMSetRenderTargets(ID3D10Device *iface, UINT num_views,
+        ID3D10RenderTargetView *const *target_views, ID3D10DepthStencilView *stencil_view)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 13, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(num_views == D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT, "got num views %u\n", num_views);
+    ok(target_views != NULL, "got views %p\n", target_views);
+    ok(stencil_view == NULL, "got %p\n", stencil_view);
+
+    for (i = 0; i < num_views; i++)
+        ok(target_views[i] == NULL, "%u: target view %p\n", i, target_views[i]);
+}
+
+static void WINAPI testdevice_OMSetBlendState(ID3D10Device *iface, ID3D10BlendState *state, const FLOAT blend_factor[4],
+        UINT sample_mask)
+{
+    call_seq_no++;
+    ok(call_seq_no == 18, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(state == NULL, "got state %p\n", state);
+    ok(blend_factor[0] == 0.0f, "got factor[0] %f\n", blend_factor[0]);
+    ok(blend_factor[1] == 0.0f, "got factor[1] %f\n", blend_factor[1]);
+    ok(blend_factor[2] == 0.0f, "got factor[2] %f\n", blend_factor[2]);
+    ok(blend_factor[3] == 0.0f, "got factor[3] %f\n", blend_factor[3]);
+    ok(sample_mask == 0, "mask %#x\n", sample_mask);
+}
+
+static void WINAPI testdevice_OMSetDepthStencilState(ID3D10Device *iface, ID3D10DepthStencilState *state,
+        UINT stencil_ref)
+{
+    call_seq_no++;
+    ok(call_seq_no == 19, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(state == NULL, "got state %p\n", state);
+    ok(stencil_ref == 0, "stencil_ref %#x\n", stencil_ref);
+}
+
+static void WINAPI testdevice_SOSetTargets(ID3D10Device *iface, UINT num_buffers, ID3D10Buffer *const *targets,
+        const UINT *offsets)
+{
+    unsigned int i;
+
+    call_seq_no++;
+    ok(call_seq_no == 17, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(num_buffers == D3D10_SO_BUFFER_SLOT_COUNT, "got num buffers %u\n", num_buffers);
+    ok(targets != NULL, "got targets %p\n", targets);
+    ok(offsets != NULL, "got offsets %p\n", offsets);
+
+    for (i = 0; i < num_buffers; i++)
+        ok(targets[i] == NULL, "%u: target %p\n", i, targets[i]);
+}
+
+static void WINAPI testdevice_DrawAuto(ID3D10Device *iface)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_RSSetState(ID3D10Device *iface, ID3D10RasterizerState *state)
+{
+    call_seq_no++;
+    ok(call_seq_no == 20, "got unexpected call, seq no %u\n", call_seq_no);
+    ok(state == NULL, "got state %p\n", state);
+}
+
+static void WINAPI testdevice_RSSetViewports(ID3D10Device *iface, UINT num_viewports, const D3D10_VIEWPORT *viewports)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_RSSetScissorRects(ID3D10Device *iface, UINT num_rects, const D3D10_RECT *rects)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_CopySubresourceRegion(ID3D10Device *iface, ID3D10Resource *dst, UINT dst_subresource,
+        UINT dst_x, UINT dst_y, UINT dst_z, ID3D10Resource *src, UINT src_subresource, const D3D10_BOX *src_box)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_CopyResource(ID3D10Device *iface, ID3D10Resource *dst, ID3D10Resource *src)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_UpdateSubresource(ID3D10Device *iface, ID3D10Resource *dst, UINT dst_subresource,
+        const D3D10_BOX *dst_box, const void *src_data, UINT src_row_pitch, UINT src_depth_pitch)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_ClearRenderTargetView(ID3D10Device *iface, ID3D10RenderTargetView *view, const FLOAT color[4])
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_ClearDepthStencilView(ID3D10Device *iface, ID3D10DepthStencilView *view, UINT clear_flags,
+        FLOAT depth, UINT8 stencil)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_GenerateMips(ID3D10Device *iface, ID3D10ShaderResourceView *view)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_ResolveSubresource(ID3D10Device *iface, ID3D10Resource *dst, UINT dst_subresource,
+        ID3D10Resource *src, UINT src_subresource, DXGI_FORMAT Format)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_VSGetConstantBuffers(ID3D10Device *iface, UINT start_slot, UINT num_buffers,
+        ID3D10Buffer **buffers)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_PSGetShaderResources(ID3D10Device *iface, UINT start_slot, UINT num_views,
+        ID3D10ShaderResourceView **views)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_PSGetShader(ID3D10Device *iface, ID3D10PixelShader **ps)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_PSGetSamplers(ID3D10Device *face, UINT start_slot, UINT num_samplers,
+        ID3D10SamplerState **salami)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_VSGetShader(ID3D10Device *iface, ID3D10VertexShader **vs)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_PSGetConstantBuffers(ID3D10Device *iface, UINT start_slot, UINT num_buffers,
+        ID3D10Buffer **buffers)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_IAGetInputLayout(ID3D10Device *iface, ID3D10InputLayout **inputlayout)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_IAGetVertexBuffers(ID3D10Device *iface, UINT start_slot,
+        UINT num_buffers, ID3D10Buffer **buffers, UINT *strides, UINT *offsets)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_IAGetIndexBuffer(ID3D10Device *iface, ID3D10Buffer **buffer,
+        DXGI_FORMAT *format, UINT *offset)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_GSGetConstantBuffers(ID3D10Device *iface, UINT start_slot, UINT num_buffers,
+        ID3D10Buffer **buffers)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_GSGetShader(ID3D10Device *iface, ID3D10GeometryShader **gs)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_IAGetPrimitiveTopology(ID3D10Device *iface, D3D10_PRIMITIVE_TOPOLOGY *topology)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_VSGetShaderResources(ID3D10Device *iface, UINT start_slot, UINT num_views,
+        ID3D10ShaderResourceView **views)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_VSGetSamplers(ID3D10Device *iface, UINT start_slot, UINT num_samplers,
+        ID3D10SamplerState **samplers)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_GetPredication(ID3D10Device *iface, ID3D10Predicate **predicate, BOOL *value)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_GSGetShaderResources(ID3D10Device *iface, UINT start_slot, UINT num_views,
+        ID3D10ShaderResourceView **views)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_GSGetSamplers(ID3D10Device *iface, UINT start_slot, UINT num_samplers,
+        ID3D10SamplerState **samplers)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_OMGetRenderTargets(ID3D10Device *iface, UINT num_views,
+        ID3D10RenderTargetView **views, ID3D10DepthStencilView **view)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_OMGetBlendState(ID3D10Device *iface, ID3D10BlendState **state, FLOAT blend_factor[4],
+        UINT *sample_mask)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_OMGetDepthStencilState(ID3D10Device *iface, ID3D10DepthStencilState **state,
+        UINT *stencial_ref)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_SOGetTargets(ID3D10Device *iface, UINT num_buffers, ID3D10Buffer **targets,
+        UINT *offsets)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_RSGetState(ID3D10Device *iface, ID3D10RasterizerState **state)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_RSGetViewports(ID3D10Device *iface, UINT *num_viewports, D3D10_VIEWPORT *viewports)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_RSGetScissorRects(ID3D10Device *iface, UINT *num_rects, D3D10_RECT *rects)
+{
+    ok(0, "unexpected call\n");
+}
+
+static HRESULT WINAPI testdevice_GetDeviceRemovedReason(ID3D10Device *iface)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_SetExceptionMode(ID3D10Device *iface, UINT raise_flags)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static UINT WINAPI testdevice_GetExceptionMode(ID3D10Device *iface)
+{
+    ok(0, "unexpected call\n");
+    return 0;
+}
+
+static HRESULT WINAPI testdevice_GetPrivateData(ID3D10Device *iface, REFGUID guid, UINT *size, void *data)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_SetPrivateData(ID3D10Device *iface, REFGUID guid, UINT DataSize, const void *data)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevic_SetPrivateDataInterface(ID3D10Device *iface, REFGUID guid, const IUnknown *data)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static void WINAPI testdevice_ClearState(ID3D10Device *iface)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_Flush(ID3D10Device *iface)
+{
+    ok(0, "unexpected call\n");
+}
+
+static HRESULT WINAPI testdevice_CreateBuffer(ID3D10Device *iface, const D3D10_BUFFER_DESC *desc,
+        const D3D10_SUBRESOURCE_DATA *initial_data, ID3D10Buffer **buffer)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateTexture1D(ID3D10Device *iface, const D3D10_TEXTURE1D_DESC *desc,
+        const D3D10_SUBRESOURCE_DATA *initial_data, ID3D10Texture1D **texture)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateTexture2D(ID3D10Device *iface, const D3D10_TEXTURE2D_DESC *desc,
+        const D3D10_SUBRESOURCE_DATA *initial_data, ID3D10Texture2D **texture)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateTexture3D(ID3D10Device *iface, const D3D10_TEXTURE3D_DESC *desc,
+        const D3D10_SUBRESOURCE_DATA *initial_data, ID3D10Texture3D **texture)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateShaderResourceView(ID3D10Device *iface, ID3D10Resource *resource,
+        const D3D10_SHADER_RESOURCE_VIEW_DESC *desc, ID3D10ShaderResourceView **view)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateRenderTargetView(ID3D10Device *iface, ID3D10Resource *resource,
+        const D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3D10RenderTargetView **view)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateDepthStencilView(ID3D10Device *iface, ID3D10Resource *resource,
+        const D3D10_DEPTH_STENCIL_VIEW_DESC *desc, ID3D10DepthStencilView **view)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateInputLayout(ID3D10Device *iface, const D3D10_INPUT_ELEMENT_DESC *desc,
+        UINT num_elements, const void *bytecode, SIZE_T bytecode_length, ID3D10InputLayout **layout)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateVertexShader(ID3D10Device *iface, const void *bytecode, SIZE_T bytecode_length,
+        ID3D10VertexShader **vs)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateGeometryShader(ID3D10Device *iface, const void *bytecode, SIZE_T bytecode_length,
+        ID3D10GeometryShader **gs)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateGeometryShaderWithStreamOutput(ID3D10Device *iface, const void *bytecode,
+        SIZE_T bytecode_length, const D3D10_SO_DECLARATION_ENTRY *decl, UINT num_entries, UINT stride,
+        ID3D10GeometryShader **gs)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreatePixelShader(ID3D10Device *iface, const void *bytecode, SIZE_T bytecode_length,
+        ID3D10PixelShader **ps)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateBlendState(ID3D10Device *iface, const D3D10_BLEND_DESC *desc,
+        ID3D10BlendState **state)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateDepthStencilState(ID3D10Device *iface, const D3D10_DEPTH_STENCIL_DESC *desc,
+        ID3D10DepthStencilState **state)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateRasterizerState(ID3D10Device *iface, const D3D10_RASTERIZER_DESC *desc,
+        ID3D10RasterizerState **state)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateSamplerState(ID3D10Device *iface, const D3D10_SAMPLER_DESC *desc,
+        ID3D10SamplerState **state)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateQuery(ID3D10Device *iface, const D3D10_QUERY_DESC *desc, ID3D10Query **query)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreatePredicate(ID3D10Device *iface, const D3D10_QUERY_DESC *desc,
+        ID3D10Predicate **predicate)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CreateCounter(ID3D10Device *iface, const D3D10_COUNTER_DESC *desc,
+        ID3D10Counter **counter)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CheckFormatSupport(ID3D10Device *iface, DXGI_FORMAT format, UINT *support)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI testdevice_CheckMultisampleQualityLevels(ID3D10Device *iface, DXGI_FORMAT format,
+        UINT sample_count, UINT *levels)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static void WINAPI testdevice_CheckCounterInfo(ID3D10Device *iface, D3D10_COUNTER_INFO *info)
+{
+    ok(0, "unexpected call\n");
+}
+
+static HRESULT WINAPI testdevice_CheckCounter(ID3D10Device *iface, const D3D10_COUNTER_DESC *desc,
+        D3D10_COUNTER_TYPE *type, UINT *active_counters, char *name, UINT *name_length,
+        char *units, UINT *units_length, char *description, UINT *desc_length)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static UINT WINAPI testdevice_GetCreationFlags(ID3D10Device *iface)
+{
+    ok(0, "unexpected call\n");
+    return 0;
+}
+
+static HRESULT WINAPI testdevice_OpenSharedResource(ID3D10Device *iface, HANDLE hresource,
+        REFIID riid, void **resource)
+{
+    ok(0, "unexpected call\n");
+    return E_NOTIMPL;
+}
+
+static void WINAPI testdevice_SetTextFilterSize(ID3D10Device *iface, UINT width, UINT height)
+{
+    ok(0, "unexpected call\n");
+}
+
+static void WINAPI testdevice_GetTextFilterSize(ID3D10Device *iface, UINT *width, UINT *height)
+{
+    ok(0, "unexpected call\n");
+}
+
+static const ID3D10DeviceVtbl testdevicevtbl =
+{
+    testdevice_QI,
+    testdevice_AddRef,
+    testdevice_Release,
+    testdevice_VSSetConstantBuffers,
+    testdevice_PSSetShaderResources,
+    testdevice_PSSetShader,
+    testdevice_PSSetSamplers,
+    testdevice_VSSetShader,
+    testdevice_DrawIndexed,
+    testdevice_Draw,
+    testdevice_PSSetConstantBuffers,
+    testdevice_IASetInputLayout,
+    testdevice_IASetVertexBuffers,
+    testdevice_IASetIndexBuffer,
+    testdevice_DrawIndexedInstanced,
+    testdevice_DrawInstanced,
+    testdevice_GSSetConstantBuffers,
+    testdevice_GSSetShader,
+    testdevice_IASetPrimitiveTopology,
+    testdevice_VSSetShaderResources,
+    testdevice_VSSetSamplers,
+    testdevice_SetPredication,
+    testdevice_GSSetShaderResources,
+    testdevice_GSSetSamplers,
+    testdevice_OMSetRenderTargets,
+    testdevice_OMSetBlendState,
+    testdevice_OMSetDepthStencilState,
+    testdevice_SOSetTargets,
+    testdevice_DrawAuto,
+    testdevice_RSSetState,
+    testdevice_RSSetViewports,
+    testdevice_RSSetScissorRects,
+    testdevice_CopySubresourceRegion,
+    testdevice_CopyResource,
+    testdevice_UpdateSubresource,
+    testdevice_ClearRenderTargetView,
+    testdevice_ClearDepthStencilView,
+    testdevice_GenerateMips,
+    testdevice_ResolveSubresource,
+    testdevice_VSGetConstantBuffers,
+    testdevice_PSGetShaderResources,
+    testdevice_PSGetShader,
+    testdevice_PSGetSamplers,
+    testdevice_VSGetShader,
+    testdevice_PSGetConstantBuffers,
+    testdevice_IAGetInputLayout,
+    testdevice_IAGetVertexBuffers,
+    testdevice_IAGetIndexBuffer,
+    testdevice_GSGetConstantBuffers,
+    testdevice_GSGetShader,
+    testdevice_IAGetPrimitiveTopology,
+    testdevice_VSGetShaderResources,
+    testdevice_VSGetSamplers,
+    testdevice_GetPredication,
+    testdevice_GSGetShaderResources,
+    testdevice_GSGetSamplers,
+    testdevice_OMGetRenderTargets,
+    testdevice_OMGetBlendState,
+    testdevice_OMGetDepthStencilState,
+    testdevice_SOGetTargets,
+    testdevice_RSGetState,
+    testdevice_RSGetViewports,
+    testdevice_RSGetScissorRects,
+    testdevice_GetDeviceRemovedReason,
+    testdevice_SetExceptionMode,
+    testdevice_GetExceptionMode,
+    testdevice_GetPrivateData,
+    testdevice_SetPrivateData,
+    testdevic_SetPrivateDataInterface,
+    testdevice_ClearState,
+    testdevice_Flush,
+    testdevice_CreateBuffer,
+    testdevice_CreateTexture1D,
+    testdevice_CreateTexture2D,
+    testdevice_CreateTexture3D,
+    testdevice_CreateShaderResourceView,
+    testdevice_CreateRenderTargetView,
+    testdevice_CreateDepthStencilView,
+    testdevice_CreateInputLayout,
+    testdevice_CreateVertexShader,
+    testdevice_CreateGeometryShader,
+    testdevice_CreateGeometryShaderWithStreamOutput,
+    testdevice_CreatePixelShader,
+    testdevice_CreateBlendState,
+    testdevice_CreateDepthStencilState,
+    testdevice_CreateRasterizerState,
+    testdevice_CreateSamplerState,
+    testdevice_CreateQuery,
+    testdevice_CreatePredicate,
+    testdevice_CreateCounter,
+    testdevice_CheckFormatSupport,
+    testdevice_CheckMultisampleQualityLevels,
+    testdevice_CheckCounterInfo,
+    testdevice_CheckCounter,
+    testdevice_GetCreationFlags,
+    testdevice_OpenSharedResource,
+    testdevice_SetTextFilterSize,
+    testdevice_GetTextFilterSize,
+};
+
+static ID3D10Device testdevice = { &testdevicevtbl };
+
+static void test_D3DX10UnsetAllDeviceObjects(void)
+{
+    HRESULT hr;
+
+    hr = D3DX10UnsetAllDeviceObjects(NULL);
+    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+
+    call_seq_no = 0;
+    hr = D3DX10UnsetAllDeviceObjects(&testdevice);
+    ok(hr == S_OK, "got %#x\n", hr);
+}
+
+START_TEST(d3dx10)
+{
+    test_D3DX10UnsetAllDeviceObjects();
+}
-- 
2.8.0.rc3




More information about the wine-patches mailing list