2 * Copyright 2008 Henri Verbeet for CodeWeavers
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.
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.
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
21 #include "wine/port.h"
23 #include "d3d10core_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
27 /* Inner IUnknown methods */
29 static inline struct d3d10_device *d3d10_device_from_inner_unknown(IUnknown *iface)
31 return (struct d3d10_device *)((char*)iface - FIELD_OFFSET(struct d3d10_device, inner_unknown_vtbl));
34 static HRESULT STDMETHODCALLTYPE d3d10_device_inner_QueryInterface(IUnknown *iface, REFIID riid, void **object)
36 struct d3d10_device *This = d3d10_device_from_inner_unknown(iface);
38 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
40 if (IsEqualGUID(riid, &IID_IUnknown)
41 || IsEqualGUID(riid, &IID_ID3D10Device))
43 IUnknown_AddRef((IUnknown *)This);
48 if (IsEqualGUID(riid, &IID_IWineD3DDeviceParent))
50 IUnknown_AddRef((IUnknown *)&This->device_parent_vtbl);
51 *object = &This->device_parent_vtbl;
55 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
61 static ULONG STDMETHODCALLTYPE d3d10_device_inner_AddRef(IUnknown *iface)
63 struct d3d10_device *This = d3d10_device_from_inner_unknown(iface);
64 ULONG refcount = InterlockedIncrement(&This->refcount);
66 TRACE("%p increasing refcount to %u\n", This, refcount);
71 static ULONG STDMETHODCALLTYPE d3d10_device_inner_Release(IUnknown *iface)
73 struct d3d10_device *This = d3d10_device_from_inner_unknown(iface);
74 ULONG refcount = InterlockedDecrement(&This->refcount);
76 TRACE("%p decreasing refcount to %u\n", This, refcount);
80 if (This->wined3d_device) IWineD3DDevice_Release(This->wined3d_device);
86 /* IUnknown methods */
88 static HRESULT STDMETHODCALLTYPE d3d10_device_QueryInterface(ID3D10Device *iface, REFIID riid, void **object)
90 struct d3d10_device *This = (struct d3d10_device *)iface;
91 TRACE("Forwarding to outer IUnknown\n");
92 return IUnknown_QueryInterface(This->outer_unknown, riid, object);
95 static ULONG STDMETHODCALLTYPE d3d10_device_AddRef(ID3D10Device *iface)
97 struct d3d10_device *This = (struct d3d10_device *)iface;
98 TRACE("Forwarding to outer IUnknown\n");
99 return IUnknown_AddRef(This->outer_unknown);
102 static ULONG STDMETHODCALLTYPE d3d10_device_Release(ID3D10Device *iface)
104 struct d3d10_device *This = (struct d3d10_device *)iface;
105 TRACE("Forwarding to outer IUnknown\n");
106 return IUnknown_Release(This->outer_unknown);
109 /* ID3D10Device methods */
111 static void STDMETHODCALLTYPE d3d10_device_VSSetConstantBuffers(ID3D10Device *iface,
112 UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers)
114 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
115 iface, start_slot, buffer_count, buffers);
118 static void STDMETHODCALLTYPE d3d10_device_PSSetShaderResources(ID3D10Device *iface,
119 UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views)
121 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
122 iface, start_slot, view_count, views);
125 static void STDMETHODCALLTYPE d3d10_device_PSSetShader(ID3D10Device *iface, ID3D10PixelShader *shader)
127 FIXME("iface %p, shader %p stub!\n", iface, shader);
130 static void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device *iface,
131 UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers)
133 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
134 iface, start_slot, sampler_count, samplers);
137 static void STDMETHODCALLTYPE d3d10_device_VSSetShader(ID3D10Device *iface, ID3D10VertexShader *shader)
139 FIXME("iface %p, shader %p stub!\n", iface, shader);
142 static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device *iface,
143 UINT index_count, UINT start_index_location, INT base_vertex_location)
145 FIXME("iface %p, index_count %u, start_index_location %u, base_vertex_location %d stub!\n",
146 iface, index_count, start_index_location, base_vertex_location);
149 static void STDMETHODCALLTYPE d3d10_device_Draw(ID3D10Device *iface,
150 UINT vertex_count, UINT start_vertex_location)
152 struct d3d10_device *This = (struct d3d10_device *)iface;
154 TRACE("iface %p, vertex_count %u, start_vertex_location %u\n",
155 iface, vertex_count, start_vertex_location);
157 IWineD3DDevice_DrawPrimitive(This->wined3d_device, start_vertex_location, vertex_count);
160 static void STDMETHODCALLTYPE d3d10_device_PSSetConstantBuffers(ID3D10Device *iface,
161 UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers)
163 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
164 iface, start_slot, buffer_count, buffers);
167 static void STDMETHODCALLTYPE d3d10_device_IASetInputLayout(ID3D10Device *iface, ID3D10InputLayout *input_layout)
169 FIXME("iface %p, input_layout %p stub!\n", iface, input_layout);
172 static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device *iface,
173 UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers,
174 const UINT *strides, const UINT *offsets)
176 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n",
177 iface, start_slot, buffer_count, buffers, strides, offsets);
180 static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device *iface,
181 ID3D10Buffer *buffer, DXGI_FORMAT format, UINT offset)
183 FIXME("iface %p, buffer %p, format %s, offset %u stub!\n",
184 iface, buffer, debug_dxgi_format(format), offset);
187 static void STDMETHODCALLTYPE d3d10_device_DrawIndexedInstanced(ID3D10Device *iface,
188 UINT instance_index_count, UINT instance_count, UINT start_index_location,
189 INT base_vertex_location, UINT start_instance_location)
191 FIXME("iface %p, instance_index_count %u, instance_count %u, start_index_location %u,\n"
192 "\tbase_vertex_location %d, start_instance_location %u stub!\n",
193 iface, instance_index_count, instance_count, start_index_location,
194 base_vertex_location, start_instance_location);
197 static void STDMETHODCALLTYPE d3d10_device_DrawInstanced(ID3D10Device *iface,
198 UINT instance_vertex_count, UINT instance_count,
199 UINT start_vertex_location, UINT start_instance_location)
201 FIXME("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u,\n"
202 "\tstart_instance_location %u stub!\n", iface, instance_vertex_count, instance_count,
203 start_vertex_location, start_instance_location);
206 static void STDMETHODCALLTYPE d3d10_device_GSSetConstantBuffers(ID3D10Device *iface,
207 UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers)
209 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
210 iface, start_slot, buffer_count, buffers);
213 static void STDMETHODCALLTYPE d3d10_device_GSSetShader(ID3D10Device *iface, ID3D10GeometryShader *shader)
215 FIXME("iface %p, shader %p stub!\n", iface, shader);
218 static void STDMETHODCALLTYPE d3d10_device_IASetPrimitiveTopology(ID3D10Device *iface, D3D10_PRIMITIVE_TOPOLOGY topology)
220 struct d3d10_device *This = (struct d3d10_device *)iface;
222 TRACE("iface %p, topology %s\n", iface, debug_d3d10_primitive_topology(topology));
224 IWineD3DDevice_SetPrimitiveType(This->wined3d_device, (WINED3DPRIMITIVETYPE)topology);
227 static void STDMETHODCALLTYPE d3d10_device_VSSetShaderResources(ID3D10Device *iface,
228 UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views)
230 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
231 iface, start_slot, view_count, views);
234 static void STDMETHODCALLTYPE d3d10_device_VSSetSamplers(ID3D10Device *iface,
235 UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers)
237 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
238 iface, start_slot, sampler_count, samplers);
241 static void STDMETHODCALLTYPE d3d10_device_SetPredication(ID3D10Device *iface, ID3D10Predicate *predicate, BOOL value)
243 FIXME("iface %p, predicate %p, value %d stub!\n", iface, predicate, value);
246 static void STDMETHODCALLTYPE d3d10_device_GSSetShaderResources(ID3D10Device *iface,
247 UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views)
249 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
250 iface, start_slot, view_count, views);
253 static void STDMETHODCALLTYPE d3d10_device_GSSetSamplers(ID3D10Device *iface,
254 UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers)
256 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
257 iface, start_slot, sampler_count, samplers);
260 static void STDMETHODCALLTYPE d3d10_device_OMSetRenderTargets(ID3D10Device *iface,
261 UINT render_target_view_count, ID3D10RenderTargetView *const *render_target_views,
262 ID3D10DepthStencilView *depth_stencil_view)
264 FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p\n",
265 iface, render_target_view_count, render_target_views, depth_stencil_view);
268 static void STDMETHODCALLTYPE d3d10_device_OMSetBlendState(ID3D10Device *iface,
269 ID3D10BlendState *blend_state, const FLOAT blend_factor[4], UINT sample_mask)
271 FIXME("iface %p, blend_state %p, blend_factor [%f %f %f %f], sample_mask 0x%08x stub!\n",
272 iface, blend_state, blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3], sample_mask);
275 static void STDMETHODCALLTYPE d3d10_device_OMSetDepthStencilState(ID3D10Device *iface,
276 ID3D10DepthStencilState *depth_stencil_state, UINT stencil_ref)
278 FIXME("iface %p, depth_stencil_state %p, stencil_ref %u stub!\n",
279 iface, depth_stencil_state, stencil_ref);
282 static void STDMETHODCALLTYPE d3d10_device_SOSetTargets(ID3D10Device *iface,
283 UINT target_count, ID3D10Buffer *const *targets, const UINT *offsets)
285 FIXME("iface %p, target_count %u, targets %p, offsets %p stub!\n", iface, target_count, targets, offsets);
288 static void STDMETHODCALLTYPE d3d10_device_DrawAuto(ID3D10Device *iface)
290 FIXME("iface %p stub!\n", iface);
293 static void STDMETHODCALLTYPE d3d10_device_RSSetState(ID3D10Device *iface, ID3D10RasterizerState *rasterizer_state)
295 FIXME("iface %p, rasterizer_state %p stub!\n", iface, rasterizer_state);
298 static void STDMETHODCALLTYPE d3d10_device_RSSetViewports(ID3D10Device *iface,
299 UINT viewport_count, const D3D10_VIEWPORT *viewports)
301 FIXME("iface %p, viewport_count %u, viewports %p stub!\n", iface, viewport_count, viewports);
304 static void STDMETHODCALLTYPE d3d10_device_RSSetScissorRects(ID3D10Device *iface,
305 UINT rect_count, const D3D10_RECT *rects)
307 FIXME("iface %p, rect_count %u, rects %p\n", iface, rect_count, rects);
310 static void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device *iface,
311 ID3D10Resource *dst_resource, UINT dst_subresource_idx, UINT dst_x, UINT dst_y, UINT dst_z,
312 ID3D10Resource *src_resource, UINT src_subresource_idx, const D3D10_BOX *src_box)
314 FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, dst_x %u, dst_y %u, dst_z %u,\n"
315 "\tsrc_resource %p, src_subresource_idx %u, src_box %p stub!\n",
316 iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z,
317 src_resource, src_subresource_idx, src_box);
320 static void STDMETHODCALLTYPE d3d10_device_CopyResource(ID3D10Device *iface,
321 ID3D10Resource *dst_resource, ID3D10Resource *src_resource)
323 FIXME("iface %p, dst_resource %p, src_resource %p stub!\n", iface, dst_resource, src_resource);
326 static void STDMETHODCALLTYPE d3d10_device_UpdateSubresource(ID3D10Device *iface,
327 ID3D10Resource *resource, UINT subresource_idx, const D3D10_BOX *box,
328 const void *data, UINT row_pitch, UINT depth_pitch)
330 FIXME("iface %p, resource %p, subresource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u stub!\n",
331 iface, resource, subresource_idx, box, data, row_pitch, depth_pitch);
334 static void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device *iface,
335 ID3D10RenderTargetView *render_target_view, const FLOAT color_rgba[4])
337 struct d3d10_device *This = (struct d3d10_device *)iface;
338 IWineD3DRendertargetView *wined3d_view = ((struct d3d10_rendertarget_view *)render_target_view)->wined3d_view;
340 TRACE("iface %p, render_target_view %p, color_rgba [%f %f %f %f]\n",
341 iface, render_target_view, color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]);
343 IWineD3DDevice_ClearRendertargetView(This->wined3d_device, wined3d_view, color_rgba);
346 static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device *iface,
347 ID3D10DepthStencilView *depth_stencil_view, UINT flags, FLOAT depth, UINT8 stencil)
349 FIXME("iface %p, depth_stencil_view %p, flags %#x, depth %f, stencil %u stub!\n",
350 iface, depth_stencil_view, flags, depth, stencil);
353 static void STDMETHODCALLTYPE d3d10_device_GenerateMips(ID3D10Device *iface, ID3D10ShaderResourceView *shader_resource_view)
355 FIXME("iface %p, shader_resource_view %p stub!\n", iface, shader_resource_view);
358 static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device *iface,
359 ID3D10Resource *dst_resource, UINT dst_subresource_idx,
360 ID3D10Resource *src_resource, UINT src_subresource_idx, DXGI_FORMAT format)
362 FIXME("iface %p, dst_resource %p, dst_subresource_idx %u,\n"
363 "\tsrc_resource %p, src_subresource_idx %u, format %s stub!\n",
364 iface, dst_resource, dst_subresource_idx,
365 src_resource, src_subresource_idx, debug_dxgi_format(format));
368 static void STDMETHODCALLTYPE d3d10_device_VSGetConstantBuffers(ID3D10Device *iface,
369 UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers)
371 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
372 iface, start_slot, buffer_count, buffers);
375 static void STDMETHODCALLTYPE d3d10_device_PSGetShaderResources(ID3D10Device *iface,
376 UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views)
378 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
379 iface, start_slot, view_count, views);
382 static void STDMETHODCALLTYPE d3d10_device_PSGetShader(ID3D10Device *iface, ID3D10PixelShader **shader)
384 FIXME("iface %p, shader %p stub!\n", iface, shader);
387 static void STDMETHODCALLTYPE d3d10_device_PSGetSamplers(ID3D10Device *iface,
388 UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers)
390 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
391 iface, start_slot, sampler_count, samplers);
394 static void STDMETHODCALLTYPE d3d10_device_VSGetShader(ID3D10Device *iface, ID3D10VertexShader **shader)
396 FIXME("iface %p, shader %p stub!\n", iface, shader);
399 static void STDMETHODCALLTYPE d3d10_device_PSGetConstantBuffers(ID3D10Device *iface,
400 UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers)
402 FIXME("iface %p, start_slot %u, buffer_count %u, buffer %p stub!\n",
403 iface, start_slot, buffer_count, buffers);
406 static void STDMETHODCALLTYPE d3d10_device_IAGetInputLayout(ID3D10Device *iface, ID3D10InputLayout **input_layout)
408 FIXME("iface %p, input_layout %p stub!\n", iface, input_layout);
411 static void STDMETHODCALLTYPE d3d10_device_IAGetVertexBuffers(ID3D10Device *iface,
412 UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers, UINT *strides, UINT *offsets)
414 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n",
415 iface, start_slot, buffer_count, buffers, strides, offsets);
418 static void STDMETHODCALLTYPE d3d10_device_IAGetIndexBuffer(ID3D10Device *iface,
419 ID3D10Buffer **buffer, DXGI_FORMAT *format, UINT *offset)
421 FIXME("iface %p, buffer %p, format %p, offset %p stub!\n", iface, buffer, format, offset);
424 static void STDMETHODCALLTYPE d3d10_device_GSGetConstantBuffers(ID3D10Device *iface,
425 UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers)
427 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
428 iface, start_slot, buffer_count, buffers);
431 static void STDMETHODCALLTYPE d3d10_device_GSGetShader(ID3D10Device *iface, ID3D10GeometryShader **shader)
433 FIXME("iface %p, shader %p stub!\n", iface, shader);
436 static void STDMETHODCALLTYPE d3d10_device_IAGetPrimitiveTopology(ID3D10Device *iface, D3D10_PRIMITIVE_TOPOLOGY *topology)
438 struct d3d10_device *This = (struct d3d10_device *)iface;
440 TRACE("iface %p, topology %p\n", iface, topology);
442 IWineD3DDevice_GetPrimitiveType(This->wined3d_device, (WINED3DPRIMITIVETYPE *)topology);
445 static void STDMETHODCALLTYPE d3d10_device_VSGetShaderResources(ID3D10Device *iface,
446 UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views)
448 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
449 iface, start_slot, view_count, views);
452 static void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device *iface,
453 UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers)
455 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
456 iface, start_slot, sampler_count, samplers);
459 static void STDMETHODCALLTYPE d3d10_device_GetPredication(ID3D10Device *iface,
460 ID3D10Predicate **predicate, BOOL *value)
462 FIXME("iface %p, predicate %p, value %p stub!\n", iface, predicate, value);
465 static void STDMETHODCALLTYPE d3d10_device_GSGetShaderResources(ID3D10Device *iface,
466 UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views)
468 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
469 iface, start_slot, view_count, views);
472 static void STDMETHODCALLTYPE d3d10_device_GSGetSamplers(ID3D10Device *iface,
473 UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers)
475 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
476 iface, start_slot, sampler_count, samplers);
479 static void STDMETHODCALLTYPE d3d10_device_OMGetRenderTargets(ID3D10Device *iface,
480 UINT view_count, ID3D10RenderTargetView **render_target_views, ID3D10DepthStencilView **depth_stencil_view)
482 FIXME("iface %p, view_count %u, render_target_views %p, depth_stencil_view %p stub!\n",
483 iface, view_count, render_target_views, depth_stencil_view);
486 static void STDMETHODCALLTYPE d3d10_device_OMGetBlendState(ID3D10Device *iface,
487 ID3D10BlendState **blend_state, FLOAT blend_factor[4], UINT *sample_mask)
489 FIXME("iface %p, blend_state %p, blend_factor %p, sample_mask %p stub!\n",
490 iface, blend_state, blend_factor, sample_mask);
493 static void STDMETHODCALLTYPE d3d10_device_OMGetDepthStencilState(ID3D10Device *iface,
494 ID3D10DepthStencilState **depth_stencil_state, UINT *stencil_ref)
496 FIXME("iface %p, depth_stencil_state %p, stencil_ref %p stub!\n",
497 iface, depth_stencil_state, stencil_ref);
500 static void STDMETHODCALLTYPE d3d10_device_SOGetTargets(ID3D10Device *iface,
501 UINT buffer_count, ID3D10Buffer **buffers, UINT *offsets)
503 FIXME("iface %p, buffer_count %u, buffers %p, offsets %p stub!\n",
504 iface, buffer_count, buffers, offsets);
507 static void STDMETHODCALLTYPE d3d10_device_RSGetState(ID3D10Device *iface, ID3D10RasterizerState **rasterizer_state)
509 FIXME("iface %p, rasterizer_state %p stub!\n", iface, rasterizer_state);
512 static void STDMETHODCALLTYPE d3d10_device_RSGetViewports(ID3D10Device *iface,
513 UINT *viewport_count, D3D10_VIEWPORT *viewports)
515 FIXME("iface %p, viewport_count %p, viewports %p stub!\n", iface, viewport_count, viewports);
518 static void STDMETHODCALLTYPE d3d10_device_RSGetScissorRects(ID3D10Device *iface, UINT *rect_count, D3D10_RECT *rects)
520 FIXME("iface %p, rect_count %p, rects %p stub!\n", iface, rect_count, rects);
523 static HRESULT STDMETHODCALLTYPE d3d10_device_GetDeviceRemovedReason(ID3D10Device *iface)
525 FIXME("iface %p stub!\n", iface);
530 static HRESULT STDMETHODCALLTYPE d3d10_device_SetExceptionMode(ID3D10Device *iface, UINT flags)
532 FIXME("iface %p, flags %#x stub!\n", iface, flags);
537 static UINT STDMETHODCALLTYPE d3d10_device_GetExceptionMode(ID3D10Device *iface)
539 FIXME("iface %p stub!\n", iface);
544 static HRESULT STDMETHODCALLTYPE d3d10_device_GetPrivateData(ID3D10Device *iface,
545 REFGUID guid, UINT *data_size, void *data)
547 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
548 iface, debugstr_guid(guid), data_size, data);
553 static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateData(ID3D10Device *iface,
554 REFGUID guid, UINT data_size, const void *data)
556 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
557 iface, debugstr_guid(guid), data_size, data);
562 static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateDataInterface(ID3D10Device *iface,
563 REFGUID guid, const IUnknown *data)
565 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
570 static void STDMETHODCALLTYPE d3d10_device_ClearState(ID3D10Device *iface)
572 FIXME("iface %p stub!\n", iface);
575 static void STDMETHODCALLTYPE d3d10_device_Flush(ID3D10Device *iface)
577 FIXME("iface %p stub!\n", iface);
580 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device *iface,
581 const D3D10_BUFFER_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Buffer **buffer)
583 struct d3d10_device *This = (struct d3d10_device *)iface;
584 struct wined3d_buffer_desc wined3d_desc;
585 struct d3d10_buffer *object;
588 FIXME("iface %p, desc %p, data %p, buffer %p partial stub!\n", iface, desc, data, buffer);
590 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
593 ERR("Failed to allocate D3D10 buffer object memory\n");
594 return E_OUTOFMEMORY;
597 object->vtbl = &d3d10_buffer_vtbl;
598 object->refcount = 1;
600 FIXME("Implement DXGI<->wined3d usage conversion\n");
602 wined3d_desc.byte_width = desc->ByteWidth;
603 wined3d_desc.usage = desc->Usage;
604 wined3d_desc.bind_flags = desc->BindFlags;
605 wined3d_desc.cpu_access_flags = desc->CPUAccessFlags;
606 wined3d_desc.misc_flags = desc->MiscFlags;
608 hr = IWineD3DDevice_CreateBuffer(This->wined3d_device, &wined3d_desc,
609 (IUnknown *)object, &object->wined3d_buffer);
612 ERR("CreateBuffer failed, returning %#x\n", hr);
613 HeapFree(GetProcessHeap(), 0, object);
617 *buffer = (ID3D10Buffer *)object;
619 TRACE("Created ID3D10Buffer %p\n", object);
624 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture1D(ID3D10Device *iface,
625 const D3D10_TEXTURE1D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture1D **texture)
627 FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
632 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device *iface,
633 const D3D10_TEXTURE2D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture2D **texture)
635 struct d3d10_device *This = (struct d3d10_device *)iface;
636 struct d3d10_texture2d *object;
639 FIXME("iface %p, desc %p, data %p, texture %p partial stub!\n", iface, desc, data, texture);
641 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
644 ERR("Failed to allocate D3D10 texture2d object memory\n");
645 return E_OUTOFMEMORY;
648 object->vtbl = &d3d10_texture2d_vtbl;
649 object->refcount = 1;
650 object->desc = *desc;
652 if (desc->MipLevels == 1 && desc->ArraySize == 1)
654 IWineDXGIDevice *wine_device;
656 hr = ID3D10Device_QueryInterface(iface, &IID_IWineDXGIDevice, (void **)&wine_device);
659 ERR("Device should implement IWineDXGIDevice\n");
660 HeapFree(GetProcessHeap(), 0, object);
664 hr = IWineDXGIDevice_create_surface(wine_device, NULL, 0, NULL,
665 (IUnknown *)object, (void **)&object->dxgi_surface);
666 IWineDXGIDevice_Release(wine_device);
669 ERR("Failed to create DXGI surface, returning %#x\n", hr);
670 HeapFree(GetProcessHeap(), 0, object);
674 FIXME("Implement DXGI<->wined3d usage conversion\n");
676 hr = IWineD3DDevice_CreateSurface(This->wined3d_device, desc->Width, desc->Height,
677 wined3dformat_from_dxgi_format(desc->Format), FALSE, FALSE, 0,
678 &object->wined3d_surface, WINED3DRTYPE_SURFACE, desc->Usage, WINED3DPOOL_DEFAULT,
679 desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3DMULTISAMPLE_NONE,
680 desc->SampleDesc.Quality, NULL, SURFACE_OPENGL, (IUnknown *)object);
683 ERR("CreateSurface failed, returning %#x\n", hr);
684 IDXGISurface_Release(object->dxgi_surface);
685 HeapFree(GetProcessHeap(), 0, object);
690 *texture = (ID3D10Texture2D *)object;
692 TRACE("Created ID3D10Texture2D %p\n", object);
697 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture3D(ID3D10Device *iface,
698 const D3D10_TEXTURE3D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture3D **texture)
700 FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
705 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView(ID3D10Device *iface,
706 ID3D10Resource *resource, const D3D10_SHADER_RESOURCE_VIEW_DESC *desc, ID3D10ShaderResourceView **view)
708 FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
713 static IWineD3DResource *d3d10_device_wined3d_resource_from_resource(ID3D10Resource *resource)
715 D3D10_RESOURCE_DIMENSION dimension;
717 ID3D10Resource_GetType(resource, &dimension);
721 case D3D10_RESOURCE_DIMENSION_BUFFER:
722 return (IWineD3DResource *)((struct d3d10_buffer *)resource)->wined3d_buffer;
724 case D3D10_RESOURCE_DIMENSION_TEXTURE2D:
725 return (IWineD3DResource *)((struct d3d10_texture2d *)resource)->wined3d_surface;
728 FIXME("Unhandled resource dimension %#x\n", dimension);
733 static HRESULT d3d10_device_set_rtdesc_from_resource(D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3D10Resource *resource)
735 D3D10_RESOURCE_DIMENSION dimension;
738 ID3D10Resource_GetType(resource, &dimension);
742 case D3D10_RESOURCE_DIMENSION_TEXTURE1D:
744 ID3D10Texture1D *texture;
745 D3D10_TEXTURE1D_DESC texture_desc;
747 hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture1D, (void **)&texture);
750 ERR("Resource of type TEXTURE1D doesn't implement ID3D10Texture1D?\n");
754 ID3D10Texture1D_GetDesc(texture, &texture_desc);
755 ID3D10Texture1D_Release(texture);
757 desc->Format = texture_desc.Format;
758 if (texture_desc.ArraySize == 1)
760 desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE1D;
761 desc->Texture1D.MipSlice = 0;
765 desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE1DARRAY;
766 desc->Texture1DArray.MipSlice = 0;
767 desc->Texture1DArray.FirstArraySlice = 0;
768 desc->Texture1DArray.ArraySize = 1;
774 case D3D10_RESOURCE_DIMENSION_TEXTURE2D:
776 ID3D10Texture2D *texture;
777 D3D10_TEXTURE2D_DESC texture_desc;
779 hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&texture);
782 ERR("Resource of type TEXTURE2D doesn't implement ID3D10Texture2D?\n");
786 ID3D10Texture2D_GetDesc(texture, &texture_desc);
787 ID3D10Texture2D_Release(texture);
789 desc->Format = texture_desc.Format;
790 if (texture_desc.ArraySize == 1)
792 if (texture_desc.SampleDesc.Count == 1)
794 desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE2D;
795 desc->Texture2D.MipSlice = 0;
799 desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE2DMS;
804 if (texture_desc.SampleDesc.Count == 1)
806 desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE2DARRAY;
807 desc->Texture2DArray.MipSlice = 0;
808 desc->Texture2DArray.FirstArraySlice = 0;
809 desc->Texture2DArray.ArraySize = 1;
813 desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY;
814 desc->Texture2DMSArray.FirstArraySlice = 0;
815 desc->Texture2DMSArray.ArraySize = 1;
822 case D3D10_RESOURCE_DIMENSION_TEXTURE3D:
824 ID3D10Texture3D *texture;
825 D3D10_TEXTURE3D_DESC texture_desc;
827 hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture3D, (void **)&texture);
830 ERR("Resource of type TEXTURE3D doesn't implement ID3D10Texture3D?\n");
834 ID3D10Texture3D_GetDesc(texture, &texture_desc);
835 ID3D10Texture3D_Release(texture);
837 desc->Format = texture_desc.Format;
838 desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE3D;
839 desc->Texture3D.MipSlice = 0;
840 desc->Texture3D.FirstWSlice = 0;
841 desc->Texture3D.WSize = 1;
847 FIXME("Unhandled resource dimension %#x\n", dimension);
852 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Device *iface,
853 ID3D10Resource *resource, const D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3D10RenderTargetView **view)
855 struct d3d10_device *This = (struct d3d10_device *)iface;
856 struct d3d10_rendertarget_view *object;
857 IWineD3DResource *wined3d_resource;
859 TRACE("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
861 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
864 ERR("Failed to allocate D3D10 rendertarget view object memory\n");
865 return E_OUTOFMEMORY;
868 object->vtbl = &d3d10_rendertarget_view_vtbl;
869 object->refcount = 1;
873 HRESULT hr = d3d10_device_set_rtdesc_from_resource(&object->desc, resource);
876 HeapFree(GetProcessHeap(), 0, object);
882 object->desc = *desc;
885 wined3d_resource = d3d10_device_wined3d_resource_from_resource(resource);
886 if (!wined3d_resource)
888 FIXME("Failed to get wined3d resource for d3d10 resource %p\n", resource);
889 HeapFree(GetProcessHeap(), 0, object);
892 IWineD3DDevice_CreateRendertargetView(This->wined3d_device,
893 wined3d_resource, (IUnknown *)object, &object->wined3d_view);
895 *view = (ID3D10RenderTargetView *)object;
900 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Device *iface,
901 ID3D10Resource *resource, const D3D10_DEPTH_STENCIL_VIEW_DESC *desc, ID3D10DepthStencilView **view)
903 FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
908 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateInputLayout(ID3D10Device *iface,
909 const D3D10_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code,
910 SIZE_T shader_byte_code_length, ID3D10InputLayout **input_layout)
912 struct d3d10_input_layout *object;
914 FIXME("iface %p, element_descs %p, element_count %u, shader_byte_code %p,"
915 "\tshader_byte_code_length %lu, input_layout %p stub!\n",
916 iface, element_descs, element_count, shader_byte_code,
917 shader_byte_code_length, input_layout);
919 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
922 ERR("Failed to allocate D3D10 input layout object memory\n");
923 return E_OUTOFMEMORY;
926 object->vtbl = &d3d10_input_layout_vtbl;
927 object->refcount = 1;
929 *input_layout = (ID3D10InputLayout *)object;
934 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateVertexShader(ID3D10Device *iface,
935 const void *byte_code, SIZE_T byte_code_length, ID3D10VertexShader **shader)
937 struct d3d10_vertex_shader *object;
939 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
940 iface, byte_code, byte_code_length, shader);
942 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
945 ERR("Failed to allocate D3D10 vertex shader object memory\n");
946 return E_OUTOFMEMORY;
949 object->vtbl = &d3d10_vertex_shader_vtbl;
950 object->refcount = 1;
952 *shader = (ID3D10VertexShader *)object;
957 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShader(ID3D10Device *iface,
958 const void *byte_code, SIZE_T byte_code_length, ID3D10GeometryShader **shader)
960 struct d3d10_geometry_shader *object;
962 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
963 iface, byte_code, byte_code_length, shader);
965 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
968 ERR("Failed to allocate D3D10 geometry shader object memory\n");
969 return E_OUTOFMEMORY;
972 object->vtbl = &d3d10_geometry_shader_vtbl;
973 object->refcount = 1;
975 *shader = (ID3D10GeometryShader *)object;
980 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutput(ID3D10Device *iface,
981 const void *byte_code, SIZE_T byte_code_length, const D3D10_SO_DECLARATION_ENTRY *output_stream_decls,
982 UINT output_stream_decl_count, UINT output_stream_stride, ID3D10GeometryShader **shader)
984 FIXME("iface %p, byte_code %p, byte_code_length %lu, output_stream_decls %p,\n"
985 "\toutput_stream_decl_count %u, output_stream_stride %u, shader %p stub!\n",
986 iface, byte_code, byte_code_length, output_stream_decls,
987 output_stream_decl_count, output_stream_stride, shader);
992 static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device *iface,
993 const void *byte_code, SIZE_T byte_code_length, ID3D10PixelShader **shader)
995 struct d3d10_pixel_shader *object;
997 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
998 iface, byte_code, byte_code_length, shader);
1000 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
1003 ERR("Failed to allocate D3D10 pixel shader object memory\n");
1004 return E_OUTOFMEMORY;
1007 object->vtbl = &d3d10_pixel_shader_vtbl;
1008 object->refcount = 1;
1010 *shader = (ID3D10PixelShader *)object;
1015 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBlendState(ID3D10Device *iface,
1016 const D3D10_BLEND_DESC *desc, ID3D10BlendState **blend_state)
1018 FIXME("iface %p, desc %p, blend_state %p stub!\n", iface, desc, blend_state);
1023 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Device *iface,
1024 const D3D10_DEPTH_STENCIL_DESC *desc, ID3D10DepthStencilState **depth_stencil_state)
1026 FIXME("iface %p, desc %p, depth_stencil_state %p stub!\n", iface, desc, depth_stencil_state);
1031 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device *iface,
1032 const D3D10_RASTERIZER_DESC *desc, ID3D10RasterizerState **rasterizer_state)
1034 FIXME("iface %p, desc %p, rasterizer_state %p stub!\n", iface, desc, rasterizer_state);
1039 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device *iface,
1040 const D3D10_SAMPLER_DESC *desc, ID3D10SamplerState **sampler_state)
1042 FIXME("iface %p, desc %p, sampler_state %p stub!\n", iface, desc, sampler_state);
1047 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device *iface,
1048 const D3D10_QUERY_DESC *desc, ID3D10Query **query)
1050 FIXME("iface %p, desc %p, query %p stub!\n", iface, desc, query);
1055 static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePredicate(ID3D10Device *iface,
1056 const D3D10_QUERY_DESC *desc, ID3D10Predicate **predicate)
1058 FIXME("iface %p, desc %p, predicate %p stub!\n", iface, desc, predicate);
1063 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device *iface,
1064 const D3D10_COUNTER_DESC *desc, ID3D10Counter **counter)
1066 FIXME("iface %p, desc %p, counter %p stub!\n", iface, desc, counter);
1071 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device *iface,
1072 DXGI_FORMAT format, UINT *format_support)
1074 FIXME("iface %p, format %s, format_support %p stub!\n",
1075 iface, debug_dxgi_format(format), format_support);
1080 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device *iface,
1081 DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count)
1083 FIXME("iface %p, format %s, sample_count %u, quality_level_count %p stub!\n",
1084 iface, debug_dxgi_format(format), sample_count, quality_level_count);
1089 static void STDMETHODCALLTYPE d3d10_device_CheckCounterInfo(ID3D10Device *iface, D3D10_COUNTER_INFO *counter_info)
1091 FIXME("iface %p, counter_info %p stub!\n", iface, counter_info);
1094 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckCounter(ID3D10Device *iface,
1095 const D3D10_COUNTER_DESC *desc, D3D10_COUNTER_TYPE *type, UINT *active_counters, LPSTR name,
1096 UINT *name_length, LPSTR units, UINT *units_length, LPSTR description, UINT *description_length)
1098 FIXME("iface %p, desc %p, type %p, active_counters %p, name %p, name_length %p,\n"
1099 "\tunits %p, units_length %p, description %p, description_length %p stub!\n",
1100 iface, desc, type, active_counters, name, name_length,
1101 units, units_length, description, description_length);
1106 static UINT STDMETHODCALLTYPE d3d10_device_GetCreationFlags(ID3D10Device *iface)
1108 FIXME("iface %p stub!\n", iface);
1113 static HRESULT STDMETHODCALLTYPE d3d10_device_OpenSharedResource(ID3D10Device *iface,
1114 HANDLE resource_handle, REFIID guid, void **resource)
1116 FIXME("iface %p, resource_handle %p, guid %s, resource %p stub!\n",
1117 iface, resource_handle, debugstr_guid(guid), resource);
1122 static void STDMETHODCALLTYPE d3d10_device_SetTextFilterSize(ID3D10Device *iface, UINT width, UINT height)
1124 FIXME("iface %p, width %u, height %u stub!\n", iface, width, height);
1127 static void STDMETHODCALLTYPE d3d10_device_GetTextFilterSize(ID3D10Device *iface, UINT *width, UINT *height)
1129 FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
1132 const struct ID3D10DeviceVtbl d3d10_device_vtbl =
1134 /* IUnknown methods */
1135 d3d10_device_QueryInterface,
1136 d3d10_device_AddRef,
1137 d3d10_device_Release,
1138 /* ID3D10Device methods */
1139 d3d10_device_VSSetConstantBuffers,
1140 d3d10_device_PSSetShaderResources,
1141 d3d10_device_PSSetShader,
1142 d3d10_device_PSSetSamplers,
1143 d3d10_device_VSSetShader,
1144 d3d10_device_DrawIndexed,
1146 d3d10_device_PSSetConstantBuffers,
1147 d3d10_device_IASetInputLayout,
1148 d3d10_device_IASetVertexBuffers,
1149 d3d10_device_IASetIndexBuffer,
1150 d3d10_device_DrawIndexedInstanced,
1151 d3d10_device_DrawInstanced,
1152 d3d10_device_GSSetConstantBuffers,
1153 d3d10_device_GSSetShader,
1154 d3d10_device_IASetPrimitiveTopology,
1155 d3d10_device_VSSetShaderResources,
1156 d3d10_device_VSSetSamplers,
1157 d3d10_device_SetPredication,
1158 d3d10_device_GSSetShaderResources,
1159 d3d10_device_GSSetSamplers,
1160 d3d10_device_OMSetRenderTargets,
1161 d3d10_device_OMSetBlendState,
1162 d3d10_device_OMSetDepthStencilState,
1163 d3d10_device_SOSetTargets,
1164 d3d10_device_DrawAuto,
1165 d3d10_device_RSSetState,
1166 d3d10_device_RSSetViewports,
1167 d3d10_device_RSSetScissorRects,
1168 d3d10_device_CopySubresourceRegion,
1169 d3d10_device_CopyResource,
1170 d3d10_device_UpdateSubresource,
1171 d3d10_device_ClearRenderTargetView,
1172 d3d10_device_ClearDepthStencilView,
1173 d3d10_device_GenerateMips,
1174 d3d10_device_ResolveSubresource,
1175 d3d10_device_VSGetConstantBuffers,
1176 d3d10_device_PSGetShaderResources,
1177 d3d10_device_PSGetShader,
1178 d3d10_device_PSGetSamplers,
1179 d3d10_device_VSGetShader,
1180 d3d10_device_PSGetConstantBuffers,
1181 d3d10_device_IAGetInputLayout,
1182 d3d10_device_IAGetVertexBuffers,
1183 d3d10_device_IAGetIndexBuffer,
1184 d3d10_device_GSGetConstantBuffers,
1185 d3d10_device_GSGetShader,
1186 d3d10_device_IAGetPrimitiveTopology,
1187 d3d10_device_VSGetShaderResources,
1188 d3d10_device_VSGetSamplers,
1189 d3d10_device_GetPredication,
1190 d3d10_device_GSGetShaderResources,
1191 d3d10_device_GSGetSamplers,
1192 d3d10_device_OMGetRenderTargets,
1193 d3d10_device_OMGetBlendState,
1194 d3d10_device_OMGetDepthStencilState,
1195 d3d10_device_SOGetTargets,
1196 d3d10_device_RSGetState,
1197 d3d10_device_RSGetViewports,
1198 d3d10_device_RSGetScissorRects,
1199 d3d10_device_GetDeviceRemovedReason,
1200 d3d10_device_SetExceptionMode,
1201 d3d10_device_GetExceptionMode,
1202 d3d10_device_GetPrivateData,
1203 d3d10_device_SetPrivateData,
1204 d3d10_device_SetPrivateDataInterface,
1205 d3d10_device_ClearState,
1207 d3d10_device_CreateBuffer,
1208 d3d10_device_CreateTexture1D,
1209 d3d10_device_CreateTexture2D,
1210 d3d10_device_CreateTexture3D,
1211 d3d10_device_CreateShaderResourceView,
1212 d3d10_device_CreateRenderTargetView,
1213 d3d10_device_CreateDepthStencilView,
1214 d3d10_device_CreateInputLayout,
1215 d3d10_device_CreateVertexShader,
1216 d3d10_device_CreateGeometryShader,
1217 d3d10_device_CreateGeometryShaderWithStreamOutput,
1218 d3d10_device_CreatePixelShader,
1219 d3d10_device_CreateBlendState,
1220 d3d10_device_CreateDepthStencilState,
1221 d3d10_device_CreateRasterizerState,
1222 d3d10_device_CreateSamplerState,
1223 d3d10_device_CreateQuery,
1224 d3d10_device_CreatePredicate,
1225 d3d10_device_CreateCounter,
1226 d3d10_device_CheckFormatSupport,
1227 d3d10_device_CheckMultisampleQualityLevels,
1228 d3d10_device_CheckCounterInfo,
1229 d3d10_device_CheckCounter,
1230 d3d10_device_GetCreationFlags,
1231 d3d10_device_OpenSharedResource,
1232 d3d10_device_SetTextFilterSize,
1233 d3d10_device_GetTextFilterSize,
1236 const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl =
1238 /* IUnknown methods */
1239 d3d10_device_inner_QueryInterface,
1240 d3d10_device_inner_AddRef,
1241 d3d10_device_inner_Release,
1244 /* IWineD3DDeviceParent IUnknown methods */
1246 static inline struct d3d10_device *device_from_device_parent(IWineD3DDeviceParent *iface)
1248 return (struct d3d10_device *)((char*)iface - FIELD_OFFSET(struct d3d10_device, device_parent_vtbl));
1251 static HRESULT STDMETHODCALLTYPE device_parent_QueryInterface(IWineD3DDeviceParent *iface, REFIID riid, void **object)
1253 struct d3d10_device *This = device_from_device_parent(iface);
1254 return d3d10_device_QueryInterface((ID3D10Device *)This, riid, object);
1257 static ULONG STDMETHODCALLTYPE device_parent_AddRef(IWineD3DDeviceParent *iface)
1259 struct d3d10_device *This = device_from_device_parent(iface);
1260 return d3d10_device_AddRef((ID3D10Device *)This);
1263 static ULONG STDMETHODCALLTYPE device_parent_Release(IWineD3DDeviceParent *iface)
1265 struct d3d10_device *This = device_from_device_parent(iface);
1266 return d3d10_device_Release((ID3D10Device *)This);
1269 /* IWineD3DDeviceParent methods */
1271 static void STDMETHODCALLTYPE device_parent_WineD3DDeviceCreated(IWineD3DDeviceParent *iface, IWineD3DDevice *device)
1273 struct d3d10_device *This = device_from_device_parent(iface);
1275 TRACE("iface %p, device %p\n", iface, device);
1277 IWineD3DDevice_AddRef(device);
1278 This->wined3d_device = device;
1281 static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParent *iface,
1282 IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, DWORD usage,
1283 WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface **surface)
1285 struct d3d10_device *This = device_from_device_parent(iface);
1286 struct d3d10_texture2d *texture;
1287 D3D10_TEXTURE2D_DESC desc;
1290 FIXME("iface %p, superior %p, width %u, height %u, format %#x, usage %#x,\n"
1291 "\tpool %#x, level %u, face %u, surface %p partial stub!\n",
1292 iface, superior, width, height, format, usage, pool, level, face, surface);
1294 FIXME("Implement DXGI<->wined3d usage conversion\n");
1297 desc.Height = height;
1300 desc.Format = dxgi_format_from_wined3dformat(format);
1301 desc.SampleDesc.Count = 1;
1302 desc.SampleDesc.Quality = 0;
1305 desc.CPUAccessFlags = 0;
1308 hr = d3d10_device_CreateTexture2D((ID3D10Device *)This, &desc, NULL, (ID3D10Texture2D **)&texture);
1311 ERR("CreateTexture2D failed, returning %#x\n", hr);
1315 *surface = texture->wined3d_surface;
1320 static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDeviceParent *iface,
1321 IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type,
1322 DWORD multisample_quality, BOOL lockable, IWineD3DSurface **surface)
1324 struct d3d10_device *This = device_from_device_parent(iface);
1325 struct d3d10_texture2d *texture;
1326 D3D10_TEXTURE2D_DESC desc;
1329 FIXME("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
1330 "\tmultisample_quality %u, lockable %u, surface %p partial stub!\n",
1331 iface, superior, width, height, format, multisample_type, multisample_quality, lockable, surface);
1333 FIXME("Implement DXGI<->wined3d usage conversion\n");
1336 desc.Height = height;
1339 desc.Format = dxgi_format_from_wined3dformat(format);
1340 desc.SampleDesc.Count = multisample_type ? multisample_type : 1;
1341 desc.SampleDesc.Quality = multisample_quality;
1342 desc.Usage = D3D10_USAGE_DEFAULT;
1343 desc.BindFlags = D3D10_BIND_RENDER_TARGET;
1344 desc.CPUAccessFlags = 0;
1347 hr = d3d10_device_CreateTexture2D((ID3D10Device *)This, &desc, NULL, (ID3D10Texture2D **)&texture);
1350 ERR("CreateTexture2D failed, returning %#x\n", hr);
1354 *surface = texture->wined3d_surface;
1359 static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3DDeviceParent *iface,
1360 IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type,
1361 DWORD multisample_quality, BOOL discard, IWineD3DSurface **surface)
1363 struct d3d10_device *This = device_from_device_parent(iface);
1364 struct d3d10_texture2d *texture;
1365 D3D10_TEXTURE2D_DESC desc;
1368 FIXME("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
1369 "\tmultisample_quality %u, discard %u, surface %p partial stub!\n",
1370 iface, superior, width, height, format, multisample_type, multisample_quality, discard, surface);
1372 FIXME("Implement DXGI<->wined3d usage conversion\n");
1375 desc.Height = height;
1378 desc.Format = dxgi_format_from_wined3dformat(format);
1379 desc.SampleDesc.Count = multisample_type ? multisample_type : 1;
1380 desc.SampleDesc.Quality = multisample_quality;
1381 desc.Usage = D3D10_USAGE_DEFAULT;
1382 desc.BindFlags = D3D10_BIND_RENDER_TARGET;
1383 desc.CPUAccessFlags = 0;
1386 hr = d3d10_device_CreateTexture2D((ID3D10Device *)This, &desc, NULL, (ID3D10Texture2D **)&texture);
1389 ERR("CreateTexture2D failed, returning %#x\n", hr);
1393 *surface = texture->wined3d_surface;
1398 static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface,
1399 IUnknown *superior, UINT width, UINT height, UINT depth, WINED3DFORMAT format,
1400 WINED3DPOOL pool, DWORD usage, IWineD3DVolume **volume)
1402 FIXME("iface %p, superior %p, width %u, height %u, depth %u, format %#x, pool %#x, usage %#x, volume %p stub!\n",
1403 iface, superior, width, height, depth, format, pool, usage, volume);
1408 static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDeviceParent *iface,
1409 WINED3DPRESENT_PARAMETERS *present_parameters, IWineD3DSwapChain **swapchain)
1411 IWineDXGIDevice *wine_device;
1414 TRACE("iface %p, present_parameters %p, swapchain %p\n", iface, present_parameters, swapchain);
1416 hr = IWineD3DDeviceParent_QueryInterface(iface, &IID_IWineDXGIDevice, (void **)&wine_device);
1419 ERR("Device should implement IWineDXGIDevice\n");
1423 hr = IWineDXGIDevice_create_swapchain(wine_device, present_parameters, swapchain);
1424 IWineDXGIDevice_Release(wine_device);
1427 ERR("Failed to create DXGI swapchain, returning %#x\n", hr);
1434 const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl =
1436 /* IUnknown methods */
1437 device_parent_QueryInterface,
1438 device_parent_AddRef,
1439 device_parent_Release,
1440 /* IWineD3DDeviceParent methods */
1441 device_parent_WineD3DDeviceCreated,
1442 device_parent_CreateSurface,
1443 device_parent_CreateRenderTarget,
1444 device_parent_CreateDepthStencilSurface,
1445 device_parent_CreateVolume,
1446 device_parent_CreateSwapChain,