d3d10core: Allow ID3D10Device to be aggregated.
[wine] / dlls / d3d10core / device.c
1 /*
2  * Copyright 2008 Henri Verbeet for CodeWeavers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  *
18  */
19
20 #include "config.h"
21 #include "wine/port.h"
22
23 #include "d3d10core_private.h"
24
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
26
27 /* Inner IUnknown methods */
28
29 static inline struct d3d10_device *d3d10_device_from_inner_unknown(IUnknown *iface)
30 {
31     return (struct d3d10_device *)((char*)iface - FIELD_OFFSET(struct d3d10_device, inner_unknown_vtbl));
32 }
33
34 static HRESULT STDMETHODCALLTYPE d3d10_device_inner_QueryInterface(IUnknown *iface, REFIID riid, void **object)
35 {
36     struct d3d10_device *This = d3d10_device_from_inner_unknown(iface);
37
38     TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
39
40     if (IsEqualGUID(riid, &IID_IUnknown)
41             || IsEqualGUID(riid, &IID_ID3D10Device))
42     {
43         IUnknown_AddRef((IUnknown *)This);
44         *object = This;
45         return S_OK;
46     }
47
48     WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
49
50     *object = NULL;
51     return E_NOINTERFACE;
52 }
53
54 static ULONG STDMETHODCALLTYPE d3d10_device_inner_AddRef(IUnknown *iface)
55 {
56     struct d3d10_device *This = d3d10_device_from_inner_unknown(iface);
57     ULONG refcount = InterlockedIncrement(&This->refcount);
58
59     TRACE("%p increasing refcount to %u\n", This, refcount);
60
61     return refcount;
62 }
63
64 static ULONG STDMETHODCALLTYPE d3d10_device_inner_Release(IUnknown *iface)
65 {
66     struct d3d10_device *This = d3d10_device_from_inner_unknown(iface);
67     ULONG refcount = InterlockedDecrement(&This->refcount);
68
69     TRACE("%p decreasing refcount to %u\n", This, refcount);
70
71     return refcount;
72 }
73
74 /* IUnknown methods */
75
76 static HRESULT STDMETHODCALLTYPE d3d10_device_QueryInterface(ID3D10Device *iface, REFIID riid, void **object)
77 {
78     struct d3d10_device *This = (struct d3d10_device *)iface;
79     TRACE("Forwarding to outer IUnknown\n");
80     return IUnknown_QueryInterface(This->outer_unknown, riid, object);
81 }
82
83 static ULONG STDMETHODCALLTYPE d3d10_device_AddRef(ID3D10Device *iface)
84 {
85     struct d3d10_device *This = (struct d3d10_device *)iface;
86     TRACE("Forwarding to outer IUnknown\n");
87     return IUnknown_AddRef(This->outer_unknown);
88 }
89
90 static ULONG STDMETHODCALLTYPE d3d10_device_Release(ID3D10Device *iface)
91 {
92     struct d3d10_device *This = (struct d3d10_device *)iface;
93     TRACE("Forwarding to outer IUnknown\n");
94     return IUnknown_Release(This->outer_unknown);
95 }
96
97 /* ID3D10Device methods */
98
99 static void STDMETHODCALLTYPE d3d10_device_VSSetConstantBuffers(ID3D10Device *iface,
100         UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers)
101 {
102     FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
103             iface, start_slot, buffer_count, buffers);
104 }
105
106 static void STDMETHODCALLTYPE d3d10_device_PSSetShaderResources(ID3D10Device *iface,
107         UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views)
108 {
109     FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
110             iface, start_slot, view_count, views);
111 }
112
113 static void STDMETHODCALLTYPE d3d10_device_PSSetShader(ID3D10Device *iface, ID3D10PixelShader *shader)
114 {
115     FIXME("iface %p, shader %p stub!\n", iface, shader);
116 }
117
118 static void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device *iface,
119         UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers)
120 {
121     FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
122             iface, start_slot, sampler_count, samplers);
123 }
124
125 static void STDMETHODCALLTYPE d3d10_device_VSSetShader(ID3D10Device *iface, ID3D10VertexShader *shader)
126 {
127     FIXME("iface %p, shader %p stub!\n", iface, shader);
128 }
129
130 static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device *iface,
131         UINT index_count, UINT start_index_location, INT base_vertex_location)
132 {
133     FIXME("iface %p, index_count %u, start_index_location %u, base_vertex_location %d stub!\n",
134             iface, index_count, start_index_location, base_vertex_location);
135 }
136
137 static void STDMETHODCALLTYPE d3d10_device_Draw(ID3D10Device *iface,
138         UINT vertex_count, UINT start_vertex_location)
139 {
140     FIXME("iface %p, vertex_count %u, start_vertex_location %u stub!\n",
141             iface, vertex_count, start_vertex_location);
142 }
143
144 static void STDMETHODCALLTYPE d3d10_device_PSSetConstantBuffers(ID3D10Device *iface,
145         UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers)
146 {
147     FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
148             iface, start_slot, buffer_count, buffers);
149 }
150
151 static void STDMETHODCALLTYPE d3d10_device_IASetInputLayout(ID3D10Device *iface, ID3D10InputLayout *input_layout)
152 {
153     FIXME("iface %p, input_layout %p stub!\n", iface, input_layout);
154 }
155
156 static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device *iface,
157         UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers,
158         const UINT *strides, const UINT *offsets)
159 {
160     FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n",
161             iface, start_slot, buffer_count, buffers, strides, offsets);
162 }
163
164 static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device *iface,
165         ID3D10Buffer *buffer, DXGI_FORMAT format, UINT offset)
166 {
167     FIXME("iface %p, buffer %p, format %s, offset %u stub!\n",
168             iface, buffer, debug_dxgi_format(format), offset);
169 }
170
171 static void STDMETHODCALLTYPE d3d10_device_DrawIndexedInstanced(ID3D10Device *iface,
172         UINT instance_index_count, UINT instance_count, UINT start_index_location,
173         INT base_vertex_location, UINT start_instance_location)
174 {
175     FIXME("iface %p, instance_index_count %u, instance_count %u, start_index_location %u,\n"
176             "\tbase_vertex_location %d, start_instance_location %u stub!\n",
177             iface, instance_index_count, instance_count, start_index_location,
178             base_vertex_location, start_instance_location);
179 }
180
181 static void STDMETHODCALLTYPE d3d10_device_DrawInstanced(ID3D10Device *iface,
182         UINT instance_vertex_count, UINT instance_count,
183         UINT start_vertex_location, UINT start_instance_location)
184 {
185     FIXME("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u,\n"
186             "\tstart_instance_location %u stub!\n", iface, instance_vertex_count, instance_count,
187             start_vertex_location, start_instance_location);
188 }
189
190 static void STDMETHODCALLTYPE d3d10_device_GSSetConstantBuffers(ID3D10Device *iface,
191         UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers)
192 {
193     FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
194             iface, start_slot, buffer_count, buffers);
195 }
196
197 static void STDMETHODCALLTYPE d3d10_device_GSSetShader(ID3D10Device *iface, ID3D10GeometryShader *shader)
198 {
199     FIXME("iface %p, shader %p stub!\n", iface, shader);
200 }
201
202 static void STDMETHODCALLTYPE d3d10_device_IASetPrimitiveTopology(ID3D10Device *iface, D3D10_PRIMITIVE_TOPOLOGY topology)
203 {
204     FIXME("iface %p, topology %s stub!\n", iface, debug_d3d10_primitive_topology(topology));
205 }
206
207 static void STDMETHODCALLTYPE d3d10_device_VSSetShaderResources(ID3D10Device *iface,
208         UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views)
209 {
210     FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
211             iface, start_slot, view_count, views);
212 }
213
214 static void STDMETHODCALLTYPE d3d10_device_VSSetSamplers(ID3D10Device *iface,
215         UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers)
216 {
217     FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
218             iface, start_slot, sampler_count, samplers);
219 }
220
221 static void STDMETHODCALLTYPE d3d10_device_SetPredication(ID3D10Device *iface, ID3D10Predicate *predicate, BOOL value)
222 {
223     FIXME("iface %p, predicate %p, value %d stub!\n", iface, predicate, value);
224 }
225
226 static void STDMETHODCALLTYPE d3d10_device_GSSetShaderResources(ID3D10Device *iface,
227         UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views)
228 {
229     FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
230             iface, start_slot, view_count, views);
231 }
232
233 static void STDMETHODCALLTYPE d3d10_device_GSSetSamplers(ID3D10Device *iface,
234         UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers)
235 {
236     FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
237             iface, start_slot, sampler_count, samplers);
238 }
239
240 static void STDMETHODCALLTYPE d3d10_device_OMSetRenderTargets(ID3D10Device *iface,
241         UINT render_target_view_count, ID3D10RenderTargetView *const *render_target_views,
242         ID3D10DepthStencilView *depth_stencil_view)
243 {
244     FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p\n",
245             iface, render_target_view_count, render_target_views, depth_stencil_view);
246 }
247
248 static void STDMETHODCALLTYPE d3d10_device_OMSetBlendState(ID3D10Device *iface,
249         ID3D10BlendState *blend_state, const FLOAT blend_factor[4], UINT sample_mask)
250 {
251     FIXME("iface %p, blend_state %p, blend_factor [%f %f %f %f], sample_mask 0x%08x stub!\n",
252             iface, blend_state, blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3], sample_mask);
253 }
254
255 static void STDMETHODCALLTYPE d3d10_device_OMSetDepthStencilState(ID3D10Device *iface,
256         ID3D10DepthStencilState *depth_stencil_state, UINT stencil_ref)
257 {
258     FIXME("iface %p, depth_stencil_state %p, stencil_ref %u stub!\n",
259             iface, depth_stencil_state, stencil_ref);
260 }
261
262 static void STDMETHODCALLTYPE d3d10_device_SOSetTargets(ID3D10Device *iface,
263         UINT target_count, ID3D10Buffer *const *targets, const UINT *offsets)
264 {
265     FIXME("iface %p, target_count %u, targets %p, offsets %p stub!\n", iface, target_count, targets, offsets);
266 }
267
268 static void STDMETHODCALLTYPE d3d10_device_DrawAuto(ID3D10Device *iface)
269 {
270     FIXME("iface %p stub!\n", iface);
271 }
272
273 static void STDMETHODCALLTYPE d3d10_device_RSSetState(ID3D10Device *iface, ID3D10RasterizerState *rasterizer_state)
274 {
275     FIXME("iface %p, rasterizer_state %p stub!\n", iface, rasterizer_state);
276 }
277
278 static void STDMETHODCALLTYPE d3d10_device_RSSetViewports(ID3D10Device *iface,
279         UINT viewport_count, const D3D10_VIEWPORT *viewports)
280 {
281     FIXME("iface %p, viewport_count %u, viewports %p stub!\n", iface, viewport_count, viewports);
282 }
283
284 static void STDMETHODCALLTYPE d3d10_device_RSSetScissorRects(ID3D10Device *iface,
285         UINT rect_count, const D3D10_RECT *rects)
286 {
287     FIXME("iface %p, rect_count %u, rects %p\n", iface, rect_count, rects);
288 }
289
290 static void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device *iface,
291         ID3D10Resource *dst_resource, UINT dst_subresource_idx, UINT dst_x, UINT dst_y, UINT dst_z,
292         ID3D10Resource *src_resource, UINT src_subresource_idx, const D3D10_BOX *src_box)
293 {
294     FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, dst_x %u, dst_y %u, dst_z %u,\n"
295             "\tsrc_resource %p, src_subresource_idx %u, src_box %p stub!\n",
296             iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z,
297             src_resource, src_subresource_idx, src_box);
298 }
299
300 static void STDMETHODCALLTYPE d3d10_device_CopyResource(ID3D10Device *iface,
301         ID3D10Resource *dst_resource, ID3D10Resource *src_resource)
302 {
303     FIXME("iface %p, dst_resource %p, src_resource %p stub!\n", iface, dst_resource, src_resource);
304 }
305
306 static void STDMETHODCALLTYPE d3d10_device_UpdateSubresource(ID3D10Device *iface,
307         ID3D10Resource *resource, UINT subresource_idx, const D3D10_BOX *box,
308         const void *data, UINT row_pitch, UINT depth_pitch)
309 {
310     FIXME("iface %p, resource %p, subresource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u stub!\n",
311             iface, resource, subresource_idx, box, data, row_pitch, depth_pitch);
312 }
313
314 static void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device *iface,
315         ID3D10RenderTargetView *render_target_view, const FLOAT color_rgba[4])
316 {
317     FIXME("iface %p, render_target_view %p, color_rgba [%f %f %f %f] stub!\n",
318             iface, render_target_view, color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]);
319 }
320
321 static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device *iface,
322         ID3D10DepthStencilView *depth_stencil_view, UINT flags, FLOAT depth, UINT8 stencil)
323 {
324     FIXME("iface %p, depth_stencil_view %p, flags %#x, depth %f, stencil %u stub!\n",
325             iface, depth_stencil_view, flags, depth, stencil);
326 }
327
328 static void STDMETHODCALLTYPE d3d10_device_GenerateMips(ID3D10Device *iface, ID3D10ShaderResourceView *shader_resource_view)
329 {
330     FIXME("iface %p, shader_resource_view %p stub!\n", iface, shader_resource_view);
331 }
332
333 static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device *iface,
334         ID3D10Resource *dst_resource, UINT dst_subresource_idx,
335         ID3D10Resource *src_resource, UINT src_subresource_idx, DXGI_FORMAT format)
336 {
337     FIXME("iface %p, dst_resource %p, dst_subresource_idx %u,\n"
338             "\tsrc_resource %p, src_subresource_idx %u, format %s stub!\n",
339             iface, dst_resource, dst_subresource_idx,
340             src_resource, src_subresource_idx, debug_dxgi_format(format));
341 }
342
343 static void STDMETHODCALLTYPE d3d10_device_VSGetConstantBuffers(ID3D10Device *iface,
344         UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers)
345 {
346     FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
347             iface, start_slot, buffer_count, buffers);
348 }
349
350 static void STDMETHODCALLTYPE d3d10_device_PSGetShaderResources(ID3D10Device *iface,
351         UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views)
352 {
353     FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
354             iface, start_slot, view_count, views);
355 }
356
357 static void STDMETHODCALLTYPE d3d10_device_PSGetShader(ID3D10Device *iface, ID3D10PixelShader **shader)
358 {
359     FIXME("iface %p, shader %p stub!\n", iface, shader);
360 }
361
362 static void STDMETHODCALLTYPE d3d10_device_PSGetSamplers(ID3D10Device *iface,
363         UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers)
364 {
365     FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
366             iface, start_slot, sampler_count, samplers);
367 }
368
369 static void STDMETHODCALLTYPE d3d10_device_VSGetShader(ID3D10Device *iface, ID3D10VertexShader **shader)
370 {
371     FIXME("iface %p, shader %p stub!\n", iface, shader);
372 }
373
374 static void STDMETHODCALLTYPE d3d10_device_PSGetConstantBuffers(ID3D10Device *iface,
375         UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers)
376 {
377     FIXME("iface %p, start_slot %u, buffer_count %u, buffer %p stub!\n",
378             iface, start_slot, buffer_count, buffers);
379 }
380
381 static void STDMETHODCALLTYPE d3d10_device_IAGetInputLayout(ID3D10Device *iface, ID3D10InputLayout **input_layout)
382 {
383     FIXME("iface %p, input_layout %p stub!\n", iface, input_layout);
384 }
385
386 static void STDMETHODCALLTYPE d3d10_device_IAGetVertexBuffers(ID3D10Device *iface,
387         UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers, UINT *strides, UINT *offsets)
388 {
389     FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n",
390             iface, start_slot, buffer_count, buffers, strides, offsets);
391 }
392
393 static void STDMETHODCALLTYPE d3d10_device_IAGetIndexBuffer(ID3D10Device *iface,
394         ID3D10Buffer **buffer, DXGI_FORMAT *format, UINT *offset)
395 {
396     FIXME("iface %p, buffer %p, format %p, offset %p stub!\n", iface, buffer, format, offset);
397 }
398
399 static void STDMETHODCALLTYPE d3d10_device_GSGetConstantBuffers(ID3D10Device *iface,
400         UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers)
401 {
402     FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
403             iface, start_slot, buffer_count, buffers);
404 }
405
406 static void STDMETHODCALLTYPE d3d10_device_GSGetShader(ID3D10Device *iface, ID3D10GeometryShader **shader)
407 {
408     FIXME("iface %p, shader %p stub!\n", iface, shader);
409 }
410
411 static void STDMETHODCALLTYPE d3d10_device_IAGetPrimitiveTopology(ID3D10Device *iface, D3D10_PRIMITIVE_TOPOLOGY *topology)
412 {
413     FIXME("iface %p, topology %p stub!\n", iface, topology);
414 }
415
416 static void STDMETHODCALLTYPE d3d10_device_VSGetShaderResources(ID3D10Device *iface,
417         UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views)
418 {
419     FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
420             iface, start_slot, view_count, views);
421 }
422
423 static void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device *iface,
424         UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers)
425 {
426     FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
427             iface, start_slot, sampler_count, samplers);
428 }
429
430 static void STDMETHODCALLTYPE d3d10_device_GetPredication(ID3D10Device *iface,
431         ID3D10Predicate **predicate, BOOL *value)
432 {
433     FIXME("iface %p, predicate %p, value %p stub!\n", iface, predicate, value);
434 }
435
436 static void STDMETHODCALLTYPE d3d10_device_GSGetShaderResources(ID3D10Device *iface,
437         UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views)
438 {
439     FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
440             iface, start_slot, view_count, views);
441 }
442
443 static void STDMETHODCALLTYPE d3d10_device_GSGetSamplers(ID3D10Device *iface,
444         UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers)
445 {
446     FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
447             iface, start_slot, sampler_count, samplers);
448 }
449
450 static void STDMETHODCALLTYPE d3d10_device_OMGetRenderTargets(ID3D10Device *iface,
451         UINT view_count, ID3D10RenderTargetView **render_target_views, ID3D10DepthStencilView **depth_stencil_view)
452 {
453     FIXME("iface %p, view_count %u, render_target_views %p, depth_stencil_view %p stub!\n",
454             iface, view_count, render_target_views, depth_stencil_view);
455 }
456
457 static void STDMETHODCALLTYPE d3d10_device_OMGetBlendState(ID3D10Device *iface,
458         ID3D10BlendState **blend_state, FLOAT blend_factor[4], UINT *sample_mask)
459 {
460     FIXME("iface %p, blend_state %p, blend_factor %p, sample_mask %p stub!\n",
461             iface, blend_state, blend_factor, sample_mask);
462 }
463
464 static void STDMETHODCALLTYPE d3d10_device_OMGetDepthStencilState(ID3D10Device *iface,
465         ID3D10DepthStencilState **depth_stencil_state, UINT *stencil_ref)
466 {
467     FIXME("iface %p, depth_stencil_state %p, stencil_ref %p stub!\n",
468             iface, depth_stencil_state, stencil_ref);
469 }
470
471 static void STDMETHODCALLTYPE d3d10_device_SOGetTargets(ID3D10Device *iface,
472         UINT buffer_count, ID3D10Buffer **buffers, UINT *offsets)
473 {
474     FIXME("iface %p, buffer_count %u, buffers %p, offsets %p stub!\n",
475             iface, buffer_count, buffers, offsets);
476 }
477
478 static void STDMETHODCALLTYPE d3d10_device_RSGetState(ID3D10Device *iface, ID3D10RasterizerState **rasterizer_state)
479 {
480     FIXME("iface %p, rasterizer_state %p stub!\n", iface, rasterizer_state);
481 }
482
483 static void STDMETHODCALLTYPE d3d10_device_RSGetViewports(ID3D10Device *iface,
484         UINT *viewport_count, D3D10_VIEWPORT *viewports)
485 {
486     FIXME("iface %p, viewport_count %p, viewports %p stub!\n", iface, viewport_count, viewports);
487 }
488
489 static void STDMETHODCALLTYPE d3d10_device_RSGetScissorRects(ID3D10Device *iface, UINT *rect_count, D3D10_RECT *rects)
490 {
491     FIXME("iface %p, rect_count %p, rects %p stub!\n", iface, rect_count, rects);
492 }
493
494 static HRESULT STDMETHODCALLTYPE d3d10_device_GetDeviceRemovedReason(ID3D10Device *iface)
495 {
496     FIXME("iface %p stub!\n", iface);
497
498     return E_NOTIMPL;
499 }
500
501 static HRESULT STDMETHODCALLTYPE d3d10_device_SetExceptionMode(ID3D10Device *iface, UINT flags)
502 {
503     FIXME("iface %p, flags %#x stub!\n", iface, flags);
504
505     return E_NOTIMPL;
506 }
507
508 static UINT STDMETHODCALLTYPE d3d10_device_GetExceptionMode(ID3D10Device *iface)
509 {
510     FIXME("iface %p stub!\n", iface);
511
512     return 0;
513 }
514
515 static HRESULT STDMETHODCALLTYPE d3d10_device_GetPrivateData(ID3D10Device *iface,
516         REFGUID guid, UINT *data_size, void *data)
517 {
518     FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
519             iface, debugstr_guid(guid), data_size, data);
520
521     return E_NOTIMPL;
522 }
523
524 static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateData(ID3D10Device *iface,
525         REFGUID guid, UINT data_size, const void *data)
526 {
527     FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
528             iface, debugstr_guid(guid), data_size, data);
529
530     return E_NOTIMPL;
531 }
532
533 static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateDataInterface(ID3D10Device *iface,
534         REFGUID guid, const IUnknown *data)
535 {
536     FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
537
538     return E_NOTIMPL;
539 }
540
541 static void STDMETHODCALLTYPE d3d10_device_ClearState(ID3D10Device *iface)
542 {
543     FIXME("iface %p stub!\n", iface);
544 }
545
546 static void STDMETHODCALLTYPE d3d10_device_Flush(ID3D10Device *iface)
547 {
548     FIXME("iface %p stub!\n", iface);
549 }
550
551 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device *iface,
552         const D3D10_BUFFER_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Buffer **buffer)
553 {
554     FIXME("iface %p, desc %p, data %p, buffer %p stub!\n", iface, desc, data, buffer);
555
556     return E_NOTIMPL;
557 }
558
559 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture1D(ID3D10Device *iface,
560         const D3D10_TEXTURE1D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture1D **texture)
561 {
562     FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
563
564     return E_NOTIMPL;
565 }
566
567 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device *iface,
568         const D3D10_TEXTURE2D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture2D **texture)
569 {
570     FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
571
572     return E_NOTIMPL;
573 }
574
575 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture3D(ID3D10Device *iface,
576         const D3D10_TEXTURE3D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture3D **texture)
577 {
578     FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
579
580     return E_NOTIMPL;
581 }
582
583 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView(ID3D10Device *iface,
584         ID3D10Resource *resource, const D3D10_SHADER_RESOURCE_VIEW_DESC *desc, ID3D10ShaderResourceView **view)
585 {
586     FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
587
588     return E_NOTIMPL;
589 }
590
591 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Device *iface,
592         ID3D10Resource *resource, const D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3D10RenderTargetView **view)
593 {
594     FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
595
596     return E_NOTIMPL;
597 }
598
599 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Device *iface,
600         ID3D10Resource *resource, const D3D10_DEPTH_STENCIL_VIEW_DESC *desc, ID3D10DepthStencilView **view)
601 {
602     FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
603
604     return E_NOTIMPL;
605 }
606
607 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateInputLayout(ID3D10Device *iface,
608         const D3D10_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code,
609         SIZE_T shader_byte_code_length, ID3D10InputLayout **input_layout)
610 {
611     FIXME("iface %p, element_descs %p, element_count %u, shader_byte_code %p,"
612             "\tshader_byte_code_length %lu, input_layout %p stub!\n",
613             iface, element_descs, element_count, shader_byte_code,
614             shader_byte_code_length, input_layout);
615
616     return E_NOTIMPL;
617 }
618
619 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateVertexShader(ID3D10Device *iface,
620         const void *byte_code, SIZE_T byte_code_length, ID3D10VertexShader **shader)
621 {
622     FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
623             iface, byte_code, byte_code_length, shader);
624
625     return E_NOTIMPL;
626 }
627
628 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShader(ID3D10Device *iface,
629         const void *byte_code, SIZE_T byte_code_length, ID3D10GeometryShader **shader)
630 {
631     FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
632             iface, byte_code, byte_code_length, shader);
633
634     return E_NOTIMPL;
635 }
636
637 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutput(ID3D10Device *iface,
638         const void *byte_code, SIZE_T byte_code_length, const D3D10_SO_DECLARATION_ENTRY *output_stream_decls,
639         UINT output_stream_decl_count, UINT output_stream_stride, ID3D10GeometryShader **shader)
640 {
641     FIXME("iface %p, byte_code %p, byte_code_length %lu, output_stream_decls %p,\n"
642             "\toutput_stream_decl_count %u, output_stream_stride %u, shader %p stub!\n",
643             iface, byte_code, byte_code_length, output_stream_decls,
644             output_stream_decl_count, output_stream_stride, shader);
645
646     return E_NOTIMPL;
647 }
648
649 static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device *iface,
650         const void *byte_code, SIZE_T byte_code_length, ID3D10PixelShader **shader)
651 {
652     FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
653             iface, byte_code, byte_code_length, shader);
654
655     return E_NOTIMPL;
656 }
657
658 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBlendState(ID3D10Device *iface,
659         const D3D10_BLEND_DESC *desc, ID3D10BlendState **blend_state)
660 {
661     FIXME("iface %p, desc %p, blend_state %p stub!\n", iface, desc, blend_state);
662
663     return E_NOTIMPL;
664 }
665
666 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Device *iface,
667         const D3D10_DEPTH_STENCIL_DESC *desc, ID3D10DepthStencilState **depth_stencil_state)
668 {
669     FIXME("iface %p, desc %p, depth_stencil_state %p stub!\n", iface, desc, depth_stencil_state);
670
671     return E_NOTIMPL;
672 }
673
674 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device *iface,
675         const D3D10_RASTERIZER_DESC *desc, ID3D10RasterizerState **rasterizer_state)
676 {
677     FIXME("iface %p, desc %p, rasterizer_state %p stub!\n", iface, desc, rasterizer_state);
678
679     return E_NOTIMPL;
680 }
681
682 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device *iface,
683         const D3D10_SAMPLER_DESC *desc, ID3D10SamplerState **sampler_state)
684 {
685     FIXME("iface %p, desc %p, sampler_state %p stub!\n", iface, desc, sampler_state);
686
687     return E_NOTIMPL;
688 }
689
690 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device *iface,
691         const D3D10_QUERY_DESC *desc, ID3D10Query **query)
692 {
693     FIXME("iface %p, desc %p, query %p stub!\n", iface, desc, query);
694
695     return E_NOTIMPL;
696 }
697
698 static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePredicate(ID3D10Device *iface,
699         const D3D10_QUERY_DESC *desc, ID3D10Predicate **predicate)
700 {
701     FIXME("iface %p, desc %p, predicate %p stub!\n", iface, desc, predicate);
702
703     return E_NOTIMPL;
704 }
705
706 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device *iface,
707         const D3D10_COUNTER_DESC *desc, ID3D10Counter **counter)
708 {
709     FIXME("iface %p, desc %p, counter %p stub!\n", iface, desc, counter);
710
711     return E_NOTIMPL;
712 }
713
714 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device *iface,
715         DXGI_FORMAT format, UINT *format_support)
716 {
717     FIXME("iface %p, format %s, format_support %p stub!\n",
718             iface, debug_dxgi_format(format), format_support);
719
720     return E_NOTIMPL;
721 }
722
723 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device *iface,
724         DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count)
725 {
726     FIXME("iface %p, format %s, sample_count %u, quality_level_count %p stub!\n",
727             iface, debug_dxgi_format(format), sample_count, quality_level_count);
728
729     return E_NOTIMPL;
730 }
731
732 static void STDMETHODCALLTYPE d3d10_device_CheckCounterInfo(ID3D10Device *iface, D3D10_COUNTER_INFO *counter_info)
733 {
734     FIXME("iface %p, counter_info %p stub!\n", iface, counter_info);
735 }
736
737 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckCounter(ID3D10Device *iface,
738         const D3D10_COUNTER_DESC *desc, D3D10_COUNTER_TYPE *type, UINT *active_counters, LPSTR name,
739         UINT *name_length, LPSTR units, UINT *units_length, LPSTR description, UINT *description_length)
740 {
741     FIXME("iface %p, desc %p, type %p, active_counters %p, name %p, name_length %p,\n"
742             "\tunits %p, units_length %p, description %p, description_length %p stub!\n",
743             iface, desc, type, active_counters, name, name_length,
744             units, units_length, description, description_length);
745
746     return E_NOTIMPL;
747 }
748
749 static UINT STDMETHODCALLTYPE d3d10_device_GetCreationFlags(ID3D10Device *iface)
750 {
751     FIXME("iface %p stub!\n", iface);
752
753     return 0;
754 }
755
756 static HRESULT STDMETHODCALLTYPE d3d10_device_OpenSharedResource(ID3D10Device *iface,
757         HANDLE resource_handle, REFIID guid, void **resource)
758 {
759     FIXME("iface %p, resource_handle %p, guid %s, resource %p stub!\n",
760             iface, resource_handle, debugstr_guid(guid), resource);
761
762     return E_NOTIMPL;
763 }
764
765 static void STDMETHODCALLTYPE d3d10_device_SetTextFilterSize(ID3D10Device *iface, UINT width, UINT height)
766 {
767     FIXME("iface %p, width %u, height %u stub!\n", iface, width, height);
768 }
769
770 static void STDMETHODCALLTYPE d3d10_device_GetTextFilterSize(ID3D10Device *iface, UINT *width, UINT *height)
771 {
772     FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
773 }
774
775 const struct ID3D10DeviceVtbl d3d10_device_vtbl =
776 {
777     /* IUnknown methods */
778     d3d10_device_QueryInterface,
779     d3d10_device_AddRef,
780     d3d10_device_Release,
781     /* ID3D10Device methods */
782     d3d10_device_VSSetConstantBuffers,
783     d3d10_device_PSSetShaderResources,
784     d3d10_device_PSSetShader,
785     d3d10_device_PSSetSamplers,
786     d3d10_device_VSSetShader,
787     d3d10_device_DrawIndexed,
788     d3d10_device_Draw,
789     d3d10_device_PSSetConstantBuffers,
790     d3d10_device_IASetInputLayout,
791     d3d10_device_IASetVertexBuffers,
792     d3d10_device_IASetIndexBuffer,
793     d3d10_device_DrawIndexedInstanced,
794     d3d10_device_DrawInstanced,
795     d3d10_device_GSSetConstantBuffers,
796     d3d10_device_GSSetShader,
797     d3d10_device_IASetPrimitiveTopology,
798     d3d10_device_VSSetShaderResources,
799     d3d10_device_VSSetSamplers,
800     d3d10_device_SetPredication,
801     d3d10_device_GSSetShaderResources,
802     d3d10_device_GSSetSamplers,
803     d3d10_device_OMSetRenderTargets,
804     d3d10_device_OMSetBlendState,
805     d3d10_device_OMSetDepthStencilState,
806     d3d10_device_SOSetTargets,
807     d3d10_device_DrawAuto,
808     d3d10_device_RSSetState,
809     d3d10_device_RSSetViewports,
810     d3d10_device_RSSetScissorRects,
811     d3d10_device_CopySubresourceRegion,
812     d3d10_device_CopyResource,
813     d3d10_device_UpdateSubresource,
814     d3d10_device_ClearRenderTargetView,
815     d3d10_device_ClearDepthStencilView,
816     d3d10_device_GenerateMips,
817     d3d10_device_ResolveSubresource,
818     d3d10_device_VSGetConstantBuffers,
819     d3d10_device_PSGetShaderResources,
820     d3d10_device_PSGetShader,
821     d3d10_device_PSGetSamplers,
822     d3d10_device_VSGetShader,
823     d3d10_device_PSGetConstantBuffers,
824     d3d10_device_IAGetInputLayout,
825     d3d10_device_IAGetVertexBuffers,
826     d3d10_device_IAGetIndexBuffer,
827     d3d10_device_GSGetConstantBuffers,
828     d3d10_device_GSGetShader,
829     d3d10_device_IAGetPrimitiveTopology,
830     d3d10_device_VSGetShaderResources,
831     d3d10_device_VSGetSamplers,
832     d3d10_device_GetPredication,
833     d3d10_device_GSGetShaderResources,
834     d3d10_device_GSGetSamplers,
835     d3d10_device_OMGetRenderTargets,
836     d3d10_device_OMGetBlendState,
837     d3d10_device_OMGetDepthStencilState,
838     d3d10_device_SOGetTargets,
839     d3d10_device_RSGetState,
840     d3d10_device_RSGetViewports,
841     d3d10_device_RSGetScissorRects,
842     d3d10_device_GetDeviceRemovedReason,
843     d3d10_device_SetExceptionMode,
844     d3d10_device_GetExceptionMode,
845     d3d10_device_GetPrivateData,
846     d3d10_device_SetPrivateData,
847     d3d10_device_SetPrivateDataInterface,
848     d3d10_device_ClearState,
849     d3d10_device_Flush,
850     d3d10_device_CreateBuffer,
851     d3d10_device_CreateTexture1D,
852     d3d10_device_CreateTexture2D,
853     d3d10_device_CreateTexture3D,
854     d3d10_device_CreateShaderResourceView,
855     d3d10_device_CreateRenderTargetView,
856     d3d10_device_CreateDepthStencilView,
857     d3d10_device_CreateInputLayout,
858     d3d10_device_CreateVertexShader,
859     d3d10_device_CreateGeometryShader,
860     d3d10_device_CreateGeometryShaderWithStreamOutput,
861     d3d10_device_CreatePixelShader,
862     d3d10_device_CreateBlendState,
863     d3d10_device_CreateDepthStencilState,
864     d3d10_device_CreateRasterizerState,
865     d3d10_device_CreateSamplerState,
866     d3d10_device_CreateQuery,
867     d3d10_device_CreatePredicate,
868     d3d10_device_CreateCounter,
869     d3d10_device_CheckFormatSupport,
870     d3d10_device_CheckMultisampleQualityLevels,
871     d3d10_device_CheckCounterInfo,
872     d3d10_device_CheckCounter,
873     d3d10_device_GetCreationFlags,
874     d3d10_device_OpenSharedResource,
875     d3d10_device_SetTextFilterSize,
876     d3d10_device_GetTextFilterSize,
877 };
878
879 const struct IUnknownVtbl d3d10_device_inner_unkown_vtbl =
880 {
881     /* IUnknown methods */
882     d3d10_device_inner_QueryInterface,
883     d3d10_device_inner_AddRef,
884     d3d10_device_inner_Release,
885 };