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);
81 /* IUnknown methods */
83 static HRESULT STDMETHODCALLTYPE d3d10_device_QueryInterface(ID3D10Device *iface, REFIID riid, void **object)
85 struct d3d10_device *This = (struct d3d10_device *)iface;
86 TRACE("Forwarding to outer IUnknown\n");
87 return IUnknown_QueryInterface(This->outer_unknown, riid, object);
90 static ULONG STDMETHODCALLTYPE d3d10_device_AddRef(ID3D10Device *iface)
92 struct d3d10_device *This = (struct d3d10_device *)iface;
93 TRACE("Forwarding to outer IUnknown\n");
94 return IUnknown_AddRef(This->outer_unknown);
97 static ULONG STDMETHODCALLTYPE d3d10_device_Release(ID3D10Device *iface)
99 struct d3d10_device *This = (struct d3d10_device *)iface;
100 TRACE("Forwarding to outer IUnknown\n");
101 return IUnknown_Release(This->outer_unknown);
104 /* ID3D10Device methods */
106 static void STDMETHODCALLTYPE d3d10_device_VSSetConstantBuffers(ID3D10Device *iface,
107 UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers)
109 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
110 iface, start_slot, buffer_count, buffers);
113 static void STDMETHODCALLTYPE d3d10_device_PSSetShaderResources(ID3D10Device *iface,
114 UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views)
116 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
117 iface, start_slot, view_count, views);
120 static void STDMETHODCALLTYPE d3d10_device_PSSetShader(ID3D10Device *iface, ID3D10PixelShader *shader)
122 FIXME("iface %p, shader %p stub!\n", iface, shader);
125 static void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device *iface,
126 UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers)
128 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
129 iface, start_slot, sampler_count, samplers);
132 static void STDMETHODCALLTYPE d3d10_device_VSSetShader(ID3D10Device *iface, ID3D10VertexShader *shader)
134 FIXME("iface %p, shader %p stub!\n", iface, shader);
137 static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device *iface,
138 UINT index_count, UINT start_index_location, INT base_vertex_location)
140 FIXME("iface %p, index_count %u, start_index_location %u, base_vertex_location %d stub!\n",
141 iface, index_count, start_index_location, base_vertex_location);
144 static void STDMETHODCALLTYPE d3d10_device_Draw(ID3D10Device *iface,
145 UINT vertex_count, UINT start_vertex_location)
147 FIXME("iface %p, vertex_count %u, start_vertex_location %u stub!\n",
148 iface, vertex_count, start_vertex_location);
151 static void STDMETHODCALLTYPE d3d10_device_PSSetConstantBuffers(ID3D10Device *iface,
152 UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers)
154 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
155 iface, start_slot, buffer_count, buffers);
158 static void STDMETHODCALLTYPE d3d10_device_IASetInputLayout(ID3D10Device *iface, ID3D10InputLayout *input_layout)
160 FIXME("iface %p, input_layout %p stub!\n", iface, input_layout);
163 static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device *iface,
164 UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers,
165 const UINT *strides, const UINT *offsets)
167 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n",
168 iface, start_slot, buffer_count, buffers, strides, offsets);
171 static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device *iface,
172 ID3D10Buffer *buffer, DXGI_FORMAT format, UINT offset)
174 FIXME("iface %p, buffer %p, format %s, offset %u stub!\n",
175 iface, buffer, debug_dxgi_format(format), offset);
178 static void STDMETHODCALLTYPE d3d10_device_DrawIndexedInstanced(ID3D10Device *iface,
179 UINT instance_index_count, UINT instance_count, UINT start_index_location,
180 INT base_vertex_location, UINT start_instance_location)
182 FIXME("iface %p, instance_index_count %u, instance_count %u, start_index_location %u,\n"
183 "\tbase_vertex_location %d, start_instance_location %u stub!\n",
184 iface, instance_index_count, instance_count, start_index_location,
185 base_vertex_location, start_instance_location);
188 static void STDMETHODCALLTYPE d3d10_device_DrawInstanced(ID3D10Device *iface,
189 UINT instance_vertex_count, UINT instance_count,
190 UINT start_vertex_location, UINT start_instance_location)
192 FIXME("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u,\n"
193 "\tstart_instance_location %u stub!\n", iface, instance_vertex_count, instance_count,
194 start_vertex_location, start_instance_location);
197 static void STDMETHODCALLTYPE d3d10_device_GSSetConstantBuffers(ID3D10Device *iface,
198 UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers)
200 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
201 iface, start_slot, buffer_count, buffers);
204 static void STDMETHODCALLTYPE d3d10_device_GSSetShader(ID3D10Device *iface, ID3D10GeometryShader *shader)
206 FIXME("iface %p, shader %p stub!\n", iface, shader);
209 static void STDMETHODCALLTYPE d3d10_device_IASetPrimitiveTopology(ID3D10Device *iface, D3D10_PRIMITIVE_TOPOLOGY topology)
211 FIXME("iface %p, topology %s stub!\n", iface, debug_d3d10_primitive_topology(topology));
214 static void STDMETHODCALLTYPE d3d10_device_VSSetShaderResources(ID3D10Device *iface,
215 UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views)
217 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
218 iface, start_slot, view_count, views);
221 static void STDMETHODCALLTYPE d3d10_device_VSSetSamplers(ID3D10Device *iface,
222 UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers)
224 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
225 iface, start_slot, sampler_count, samplers);
228 static void STDMETHODCALLTYPE d3d10_device_SetPredication(ID3D10Device *iface, ID3D10Predicate *predicate, BOOL value)
230 FIXME("iface %p, predicate %p, value %d stub!\n", iface, predicate, value);
233 static void STDMETHODCALLTYPE d3d10_device_GSSetShaderResources(ID3D10Device *iface,
234 UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views)
236 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
237 iface, start_slot, view_count, views);
240 static void STDMETHODCALLTYPE d3d10_device_GSSetSamplers(ID3D10Device *iface,
241 UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers)
243 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
244 iface, start_slot, sampler_count, samplers);
247 static void STDMETHODCALLTYPE d3d10_device_OMSetRenderTargets(ID3D10Device *iface,
248 UINT render_target_view_count, ID3D10RenderTargetView *const *render_target_views,
249 ID3D10DepthStencilView *depth_stencil_view)
251 FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p\n",
252 iface, render_target_view_count, render_target_views, depth_stencil_view);
255 static void STDMETHODCALLTYPE d3d10_device_OMSetBlendState(ID3D10Device *iface,
256 ID3D10BlendState *blend_state, const FLOAT blend_factor[4], UINT sample_mask)
258 FIXME("iface %p, blend_state %p, blend_factor [%f %f %f %f], sample_mask 0x%08x stub!\n",
259 iface, blend_state, blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3], sample_mask);
262 static void STDMETHODCALLTYPE d3d10_device_OMSetDepthStencilState(ID3D10Device *iface,
263 ID3D10DepthStencilState *depth_stencil_state, UINT stencil_ref)
265 FIXME("iface %p, depth_stencil_state %p, stencil_ref %u stub!\n",
266 iface, depth_stencil_state, stencil_ref);
269 static void STDMETHODCALLTYPE d3d10_device_SOSetTargets(ID3D10Device *iface,
270 UINT target_count, ID3D10Buffer *const *targets, const UINT *offsets)
272 FIXME("iface %p, target_count %u, targets %p, offsets %p stub!\n", iface, target_count, targets, offsets);
275 static void STDMETHODCALLTYPE d3d10_device_DrawAuto(ID3D10Device *iface)
277 FIXME("iface %p stub!\n", iface);
280 static void STDMETHODCALLTYPE d3d10_device_RSSetState(ID3D10Device *iface, ID3D10RasterizerState *rasterizer_state)
282 FIXME("iface %p, rasterizer_state %p stub!\n", iface, rasterizer_state);
285 static void STDMETHODCALLTYPE d3d10_device_RSSetViewports(ID3D10Device *iface,
286 UINT viewport_count, const D3D10_VIEWPORT *viewports)
288 FIXME("iface %p, viewport_count %u, viewports %p stub!\n", iface, viewport_count, viewports);
291 static void STDMETHODCALLTYPE d3d10_device_RSSetScissorRects(ID3D10Device *iface,
292 UINT rect_count, const D3D10_RECT *rects)
294 FIXME("iface %p, rect_count %u, rects %p\n", iface, rect_count, rects);
297 static void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device *iface,
298 ID3D10Resource *dst_resource, UINT dst_subresource_idx, UINT dst_x, UINT dst_y, UINT dst_z,
299 ID3D10Resource *src_resource, UINT src_subresource_idx, const D3D10_BOX *src_box)
301 FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, dst_x %u, dst_y %u, dst_z %u,\n"
302 "\tsrc_resource %p, src_subresource_idx %u, src_box %p stub!\n",
303 iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z,
304 src_resource, src_subresource_idx, src_box);
307 static void STDMETHODCALLTYPE d3d10_device_CopyResource(ID3D10Device *iface,
308 ID3D10Resource *dst_resource, ID3D10Resource *src_resource)
310 FIXME("iface %p, dst_resource %p, src_resource %p stub!\n", iface, dst_resource, src_resource);
313 static void STDMETHODCALLTYPE d3d10_device_UpdateSubresource(ID3D10Device *iface,
314 ID3D10Resource *resource, UINT subresource_idx, const D3D10_BOX *box,
315 const void *data, UINT row_pitch, UINT depth_pitch)
317 FIXME("iface %p, resource %p, subresource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u stub!\n",
318 iface, resource, subresource_idx, box, data, row_pitch, depth_pitch);
321 static void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device *iface,
322 ID3D10RenderTargetView *render_target_view, const FLOAT color_rgba[4])
324 FIXME("iface %p, render_target_view %p, color_rgba [%f %f %f %f] stub!\n",
325 iface, render_target_view, color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]);
328 static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device *iface,
329 ID3D10DepthStencilView *depth_stencil_view, UINT flags, FLOAT depth, UINT8 stencil)
331 FIXME("iface %p, depth_stencil_view %p, flags %#x, depth %f, stencil %u stub!\n",
332 iface, depth_stencil_view, flags, depth, stencil);
335 static void STDMETHODCALLTYPE d3d10_device_GenerateMips(ID3D10Device *iface, ID3D10ShaderResourceView *shader_resource_view)
337 FIXME("iface %p, shader_resource_view %p stub!\n", iface, shader_resource_view);
340 static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device *iface,
341 ID3D10Resource *dst_resource, UINT dst_subresource_idx,
342 ID3D10Resource *src_resource, UINT src_subresource_idx, DXGI_FORMAT format)
344 FIXME("iface %p, dst_resource %p, dst_subresource_idx %u,\n"
345 "\tsrc_resource %p, src_subresource_idx %u, format %s stub!\n",
346 iface, dst_resource, dst_subresource_idx,
347 src_resource, src_subresource_idx, debug_dxgi_format(format));
350 static void STDMETHODCALLTYPE d3d10_device_VSGetConstantBuffers(ID3D10Device *iface,
351 UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers)
353 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
354 iface, start_slot, buffer_count, buffers);
357 static void STDMETHODCALLTYPE d3d10_device_PSGetShaderResources(ID3D10Device *iface,
358 UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views)
360 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
361 iface, start_slot, view_count, views);
364 static void STDMETHODCALLTYPE d3d10_device_PSGetShader(ID3D10Device *iface, ID3D10PixelShader **shader)
366 FIXME("iface %p, shader %p stub!\n", iface, shader);
369 static void STDMETHODCALLTYPE d3d10_device_PSGetSamplers(ID3D10Device *iface,
370 UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers)
372 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
373 iface, start_slot, sampler_count, samplers);
376 static void STDMETHODCALLTYPE d3d10_device_VSGetShader(ID3D10Device *iface, ID3D10VertexShader **shader)
378 FIXME("iface %p, shader %p stub!\n", iface, shader);
381 static void STDMETHODCALLTYPE d3d10_device_PSGetConstantBuffers(ID3D10Device *iface,
382 UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers)
384 FIXME("iface %p, start_slot %u, buffer_count %u, buffer %p stub!\n",
385 iface, start_slot, buffer_count, buffers);
388 static void STDMETHODCALLTYPE d3d10_device_IAGetInputLayout(ID3D10Device *iface, ID3D10InputLayout **input_layout)
390 FIXME("iface %p, input_layout %p stub!\n", iface, input_layout);
393 static void STDMETHODCALLTYPE d3d10_device_IAGetVertexBuffers(ID3D10Device *iface,
394 UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers, UINT *strides, UINT *offsets)
396 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n",
397 iface, start_slot, buffer_count, buffers, strides, offsets);
400 static void STDMETHODCALLTYPE d3d10_device_IAGetIndexBuffer(ID3D10Device *iface,
401 ID3D10Buffer **buffer, DXGI_FORMAT *format, UINT *offset)
403 FIXME("iface %p, buffer %p, format %p, offset %p stub!\n", iface, buffer, format, offset);
406 static void STDMETHODCALLTYPE d3d10_device_GSGetConstantBuffers(ID3D10Device *iface,
407 UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers)
409 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
410 iface, start_slot, buffer_count, buffers);
413 static void STDMETHODCALLTYPE d3d10_device_GSGetShader(ID3D10Device *iface, ID3D10GeometryShader **shader)
415 FIXME("iface %p, shader %p stub!\n", iface, shader);
418 static void STDMETHODCALLTYPE d3d10_device_IAGetPrimitiveTopology(ID3D10Device *iface, D3D10_PRIMITIVE_TOPOLOGY *topology)
420 FIXME("iface %p, topology %p stub!\n", iface, topology);
423 static void STDMETHODCALLTYPE d3d10_device_VSGetShaderResources(ID3D10Device *iface,
424 UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views)
426 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
427 iface, start_slot, view_count, views);
430 static void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device *iface,
431 UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers)
433 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
434 iface, start_slot, sampler_count, samplers);
437 static void STDMETHODCALLTYPE d3d10_device_GetPredication(ID3D10Device *iface,
438 ID3D10Predicate **predicate, BOOL *value)
440 FIXME("iface %p, predicate %p, value %p stub!\n", iface, predicate, value);
443 static void STDMETHODCALLTYPE d3d10_device_GSGetShaderResources(ID3D10Device *iface,
444 UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views)
446 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
447 iface, start_slot, view_count, views);
450 static void STDMETHODCALLTYPE d3d10_device_GSGetSamplers(ID3D10Device *iface,
451 UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers)
453 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
454 iface, start_slot, sampler_count, samplers);
457 static void STDMETHODCALLTYPE d3d10_device_OMGetRenderTargets(ID3D10Device *iface,
458 UINT view_count, ID3D10RenderTargetView **render_target_views, ID3D10DepthStencilView **depth_stencil_view)
460 FIXME("iface %p, view_count %u, render_target_views %p, depth_stencil_view %p stub!\n",
461 iface, view_count, render_target_views, depth_stencil_view);
464 static void STDMETHODCALLTYPE d3d10_device_OMGetBlendState(ID3D10Device *iface,
465 ID3D10BlendState **blend_state, FLOAT blend_factor[4], UINT *sample_mask)
467 FIXME("iface %p, blend_state %p, blend_factor %p, sample_mask %p stub!\n",
468 iface, blend_state, blend_factor, sample_mask);
471 static void STDMETHODCALLTYPE d3d10_device_OMGetDepthStencilState(ID3D10Device *iface,
472 ID3D10DepthStencilState **depth_stencil_state, UINT *stencil_ref)
474 FIXME("iface %p, depth_stencil_state %p, stencil_ref %p stub!\n",
475 iface, depth_stencil_state, stencil_ref);
478 static void STDMETHODCALLTYPE d3d10_device_SOGetTargets(ID3D10Device *iface,
479 UINT buffer_count, ID3D10Buffer **buffers, UINT *offsets)
481 FIXME("iface %p, buffer_count %u, buffers %p, offsets %p stub!\n",
482 iface, buffer_count, buffers, offsets);
485 static void STDMETHODCALLTYPE d3d10_device_RSGetState(ID3D10Device *iface, ID3D10RasterizerState **rasterizer_state)
487 FIXME("iface %p, rasterizer_state %p stub!\n", iface, rasterizer_state);
490 static void STDMETHODCALLTYPE d3d10_device_RSGetViewports(ID3D10Device *iface,
491 UINT *viewport_count, D3D10_VIEWPORT *viewports)
493 FIXME("iface %p, viewport_count %p, viewports %p stub!\n", iface, viewport_count, viewports);
496 static void STDMETHODCALLTYPE d3d10_device_RSGetScissorRects(ID3D10Device *iface, UINT *rect_count, D3D10_RECT *rects)
498 FIXME("iface %p, rect_count %p, rects %p stub!\n", iface, rect_count, rects);
501 static HRESULT STDMETHODCALLTYPE d3d10_device_GetDeviceRemovedReason(ID3D10Device *iface)
503 FIXME("iface %p stub!\n", iface);
508 static HRESULT STDMETHODCALLTYPE d3d10_device_SetExceptionMode(ID3D10Device *iface, UINT flags)
510 FIXME("iface %p, flags %#x stub!\n", iface, flags);
515 static UINT STDMETHODCALLTYPE d3d10_device_GetExceptionMode(ID3D10Device *iface)
517 FIXME("iface %p stub!\n", iface);
522 static HRESULT STDMETHODCALLTYPE d3d10_device_GetPrivateData(ID3D10Device *iface,
523 REFGUID guid, UINT *data_size, void *data)
525 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
526 iface, debugstr_guid(guid), data_size, data);
531 static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateData(ID3D10Device *iface,
532 REFGUID guid, UINT data_size, const void *data)
534 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
535 iface, debugstr_guid(guid), data_size, data);
540 static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateDataInterface(ID3D10Device *iface,
541 REFGUID guid, const IUnknown *data)
543 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
548 static void STDMETHODCALLTYPE d3d10_device_ClearState(ID3D10Device *iface)
550 FIXME("iface %p stub!\n", iface);
553 static void STDMETHODCALLTYPE d3d10_device_Flush(ID3D10Device *iface)
555 FIXME("iface %p stub!\n", iface);
558 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device *iface,
559 const D3D10_BUFFER_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Buffer **buffer)
561 FIXME("iface %p, desc %p, data %p, buffer %p stub!\n", iface, desc, data, buffer);
566 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture1D(ID3D10Device *iface,
567 const D3D10_TEXTURE1D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture1D **texture)
569 FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
574 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device *iface,
575 const D3D10_TEXTURE2D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture2D **texture)
577 struct d3d10_texture2d *object;
580 FIXME("iface %p, desc %p, data %p, texture %p partial stub!\n", iface, desc, data, texture);
582 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
585 ERR("Failed to allocate D3D10 texture2d object memory\n");
586 return E_OUTOFMEMORY;
589 object->vtbl = &d3d10_texture2d_vtbl;
590 object->refcount = 1;
592 if (desc->MipLevels == 1 && desc->ArraySize == 1)
594 IWineD3DDevice *wined3d_device;
595 IWineDXGIDevice *wine_device;
597 hr = ID3D10Device_QueryInterface(iface, &IID_IWineDXGIDevice, (void **)&wine_device);
600 ERR("Device should implement IWineDXGIDevice\n");
601 HeapFree(GetProcessHeap(), 0, object);
605 hr = IWineDXGIDevice_create_surface(wine_device, NULL, 0, NULL,
606 (IUnknown *)object, (void **)&object->dxgi_surface);
609 ERR("Failed to create DXGI surface, returning %#x\n", hr);
610 HeapFree(GetProcessHeap(), 0, object);
611 IWineDXGIDevice_Release(wine_device);
615 wined3d_device = IWineDXGIDevice_get_wined3d_device(wine_device);
616 IWineDXGIDevice_Release(wine_device);
618 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
620 hr = IWineD3DDevice_CreateSurface(wined3d_device, desc->Width, desc->Height, desc->Format, FALSE,
621 FALSE, 0, &object->wined3d_surface, WINED3DRTYPE_SURFACE, desc->Usage, WINED3DPOOL_DEFAULT,
622 desc->SampleDesc.Count, desc->SampleDesc.Quality, NULL, SURFACE_OPENGL, (IUnknown *)object);
623 IWineD3DDevice_Release(wined3d_device);
626 ERR("CreateSurface failed, returning %#x\n", hr);
627 IDXGISurface_Release(object->dxgi_surface);
628 HeapFree(GetProcessHeap(), 0, object);
633 *texture = (ID3D10Texture2D *)object;
635 TRACE("Created ID3D10Texture2D %p\n", object);
640 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture3D(ID3D10Device *iface,
641 const D3D10_TEXTURE3D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture3D **texture)
643 FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
648 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView(ID3D10Device *iface,
649 ID3D10Resource *resource, const D3D10_SHADER_RESOURCE_VIEW_DESC *desc, ID3D10ShaderResourceView **view)
651 FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
656 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Device *iface,
657 ID3D10Resource *resource, const D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3D10RenderTargetView **view)
659 FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
664 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Device *iface,
665 ID3D10Resource *resource, const D3D10_DEPTH_STENCIL_VIEW_DESC *desc, ID3D10DepthStencilView **view)
667 FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
672 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateInputLayout(ID3D10Device *iface,
673 const D3D10_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code,
674 SIZE_T shader_byte_code_length, ID3D10InputLayout **input_layout)
676 FIXME("iface %p, element_descs %p, element_count %u, shader_byte_code %p,"
677 "\tshader_byte_code_length %lu, input_layout %p stub!\n",
678 iface, element_descs, element_count, shader_byte_code,
679 shader_byte_code_length, input_layout);
684 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateVertexShader(ID3D10Device *iface,
685 const void *byte_code, SIZE_T byte_code_length, ID3D10VertexShader **shader)
687 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
688 iface, byte_code, byte_code_length, shader);
693 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShader(ID3D10Device *iface,
694 const void *byte_code, SIZE_T byte_code_length, ID3D10GeometryShader **shader)
696 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
697 iface, byte_code, byte_code_length, shader);
702 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutput(ID3D10Device *iface,
703 const void *byte_code, SIZE_T byte_code_length, const D3D10_SO_DECLARATION_ENTRY *output_stream_decls,
704 UINT output_stream_decl_count, UINT output_stream_stride, ID3D10GeometryShader **shader)
706 FIXME("iface %p, byte_code %p, byte_code_length %lu, output_stream_decls %p,\n"
707 "\toutput_stream_decl_count %u, output_stream_stride %u, shader %p stub!\n",
708 iface, byte_code, byte_code_length, output_stream_decls,
709 output_stream_decl_count, output_stream_stride, shader);
714 static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device *iface,
715 const void *byte_code, SIZE_T byte_code_length, ID3D10PixelShader **shader)
717 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
718 iface, byte_code, byte_code_length, shader);
723 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBlendState(ID3D10Device *iface,
724 const D3D10_BLEND_DESC *desc, ID3D10BlendState **blend_state)
726 FIXME("iface %p, desc %p, blend_state %p stub!\n", iface, desc, blend_state);
731 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Device *iface,
732 const D3D10_DEPTH_STENCIL_DESC *desc, ID3D10DepthStencilState **depth_stencil_state)
734 FIXME("iface %p, desc %p, depth_stencil_state %p stub!\n", iface, desc, depth_stencil_state);
739 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device *iface,
740 const D3D10_RASTERIZER_DESC *desc, ID3D10RasterizerState **rasterizer_state)
742 FIXME("iface %p, desc %p, rasterizer_state %p stub!\n", iface, desc, rasterizer_state);
747 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device *iface,
748 const D3D10_SAMPLER_DESC *desc, ID3D10SamplerState **sampler_state)
750 FIXME("iface %p, desc %p, sampler_state %p stub!\n", iface, desc, sampler_state);
755 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device *iface,
756 const D3D10_QUERY_DESC *desc, ID3D10Query **query)
758 FIXME("iface %p, desc %p, query %p stub!\n", iface, desc, query);
763 static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePredicate(ID3D10Device *iface,
764 const D3D10_QUERY_DESC *desc, ID3D10Predicate **predicate)
766 FIXME("iface %p, desc %p, predicate %p stub!\n", iface, desc, predicate);
771 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device *iface,
772 const D3D10_COUNTER_DESC *desc, ID3D10Counter **counter)
774 FIXME("iface %p, desc %p, counter %p stub!\n", iface, desc, counter);
779 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device *iface,
780 DXGI_FORMAT format, UINT *format_support)
782 FIXME("iface %p, format %s, format_support %p stub!\n",
783 iface, debug_dxgi_format(format), format_support);
788 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device *iface,
789 DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count)
791 FIXME("iface %p, format %s, sample_count %u, quality_level_count %p stub!\n",
792 iface, debug_dxgi_format(format), sample_count, quality_level_count);
797 static void STDMETHODCALLTYPE d3d10_device_CheckCounterInfo(ID3D10Device *iface, D3D10_COUNTER_INFO *counter_info)
799 FIXME("iface %p, counter_info %p stub!\n", iface, counter_info);
802 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckCounter(ID3D10Device *iface,
803 const D3D10_COUNTER_DESC *desc, D3D10_COUNTER_TYPE *type, UINT *active_counters, LPSTR name,
804 UINT *name_length, LPSTR units, UINT *units_length, LPSTR description, UINT *description_length)
806 FIXME("iface %p, desc %p, type %p, active_counters %p, name %p, name_length %p,\n"
807 "\tunits %p, units_length %p, description %p, description_length %p stub!\n",
808 iface, desc, type, active_counters, name, name_length,
809 units, units_length, description, description_length);
814 static UINT STDMETHODCALLTYPE d3d10_device_GetCreationFlags(ID3D10Device *iface)
816 FIXME("iface %p stub!\n", iface);
821 static HRESULT STDMETHODCALLTYPE d3d10_device_OpenSharedResource(ID3D10Device *iface,
822 HANDLE resource_handle, REFIID guid, void **resource)
824 FIXME("iface %p, resource_handle %p, guid %s, resource %p stub!\n",
825 iface, resource_handle, debugstr_guid(guid), resource);
830 static void STDMETHODCALLTYPE d3d10_device_SetTextFilterSize(ID3D10Device *iface, UINT width, UINT height)
832 FIXME("iface %p, width %u, height %u stub!\n", iface, width, height);
835 static void STDMETHODCALLTYPE d3d10_device_GetTextFilterSize(ID3D10Device *iface, UINT *width, UINT *height)
837 FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
840 const struct ID3D10DeviceVtbl d3d10_device_vtbl =
842 /* IUnknown methods */
843 d3d10_device_QueryInterface,
845 d3d10_device_Release,
846 /* ID3D10Device methods */
847 d3d10_device_VSSetConstantBuffers,
848 d3d10_device_PSSetShaderResources,
849 d3d10_device_PSSetShader,
850 d3d10_device_PSSetSamplers,
851 d3d10_device_VSSetShader,
852 d3d10_device_DrawIndexed,
854 d3d10_device_PSSetConstantBuffers,
855 d3d10_device_IASetInputLayout,
856 d3d10_device_IASetVertexBuffers,
857 d3d10_device_IASetIndexBuffer,
858 d3d10_device_DrawIndexedInstanced,
859 d3d10_device_DrawInstanced,
860 d3d10_device_GSSetConstantBuffers,
861 d3d10_device_GSSetShader,
862 d3d10_device_IASetPrimitiveTopology,
863 d3d10_device_VSSetShaderResources,
864 d3d10_device_VSSetSamplers,
865 d3d10_device_SetPredication,
866 d3d10_device_GSSetShaderResources,
867 d3d10_device_GSSetSamplers,
868 d3d10_device_OMSetRenderTargets,
869 d3d10_device_OMSetBlendState,
870 d3d10_device_OMSetDepthStencilState,
871 d3d10_device_SOSetTargets,
872 d3d10_device_DrawAuto,
873 d3d10_device_RSSetState,
874 d3d10_device_RSSetViewports,
875 d3d10_device_RSSetScissorRects,
876 d3d10_device_CopySubresourceRegion,
877 d3d10_device_CopyResource,
878 d3d10_device_UpdateSubresource,
879 d3d10_device_ClearRenderTargetView,
880 d3d10_device_ClearDepthStencilView,
881 d3d10_device_GenerateMips,
882 d3d10_device_ResolveSubresource,
883 d3d10_device_VSGetConstantBuffers,
884 d3d10_device_PSGetShaderResources,
885 d3d10_device_PSGetShader,
886 d3d10_device_PSGetSamplers,
887 d3d10_device_VSGetShader,
888 d3d10_device_PSGetConstantBuffers,
889 d3d10_device_IAGetInputLayout,
890 d3d10_device_IAGetVertexBuffers,
891 d3d10_device_IAGetIndexBuffer,
892 d3d10_device_GSGetConstantBuffers,
893 d3d10_device_GSGetShader,
894 d3d10_device_IAGetPrimitiveTopology,
895 d3d10_device_VSGetShaderResources,
896 d3d10_device_VSGetSamplers,
897 d3d10_device_GetPredication,
898 d3d10_device_GSGetShaderResources,
899 d3d10_device_GSGetSamplers,
900 d3d10_device_OMGetRenderTargets,
901 d3d10_device_OMGetBlendState,
902 d3d10_device_OMGetDepthStencilState,
903 d3d10_device_SOGetTargets,
904 d3d10_device_RSGetState,
905 d3d10_device_RSGetViewports,
906 d3d10_device_RSGetScissorRects,
907 d3d10_device_GetDeviceRemovedReason,
908 d3d10_device_SetExceptionMode,
909 d3d10_device_GetExceptionMode,
910 d3d10_device_GetPrivateData,
911 d3d10_device_SetPrivateData,
912 d3d10_device_SetPrivateDataInterface,
913 d3d10_device_ClearState,
915 d3d10_device_CreateBuffer,
916 d3d10_device_CreateTexture1D,
917 d3d10_device_CreateTexture2D,
918 d3d10_device_CreateTexture3D,
919 d3d10_device_CreateShaderResourceView,
920 d3d10_device_CreateRenderTargetView,
921 d3d10_device_CreateDepthStencilView,
922 d3d10_device_CreateInputLayout,
923 d3d10_device_CreateVertexShader,
924 d3d10_device_CreateGeometryShader,
925 d3d10_device_CreateGeometryShaderWithStreamOutput,
926 d3d10_device_CreatePixelShader,
927 d3d10_device_CreateBlendState,
928 d3d10_device_CreateDepthStencilState,
929 d3d10_device_CreateRasterizerState,
930 d3d10_device_CreateSamplerState,
931 d3d10_device_CreateQuery,
932 d3d10_device_CreatePredicate,
933 d3d10_device_CreateCounter,
934 d3d10_device_CheckFormatSupport,
935 d3d10_device_CheckMultisampleQualityLevels,
936 d3d10_device_CheckCounterInfo,
937 d3d10_device_CheckCounter,
938 d3d10_device_GetCreationFlags,
939 d3d10_device_OpenSharedResource,
940 d3d10_device_SetTextFilterSize,
941 d3d10_device_GetTextFilterSize,
944 const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl =
946 /* IUnknown methods */
947 d3d10_device_inner_QueryInterface,
948 d3d10_device_inner_AddRef,
949 d3d10_device_inner_Release,
952 /* IWineD3DDeviceParent IUnknown methods */
954 static inline struct d3d10_device *device_from_device_parent(IWineD3DDeviceParent *iface)
956 return (struct d3d10_device *)((char*)iface - FIELD_OFFSET(struct d3d10_device, device_parent_vtbl));
959 HRESULT STDMETHODCALLTYPE device_parent_QueryInterface(IWineD3DDeviceParent *iface, REFIID riid, void **object)
961 struct d3d10_device *This = device_from_device_parent(iface);
962 return d3d10_device_QueryInterface((ID3D10Device *)This, riid, object);
965 ULONG STDMETHODCALLTYPE device_parent_AddRef(IWineD3DDeviceParent *iface)
967 struct d3d10_device *This = device_from_device_parent(iface);
968 return d3d10_device_AddRef((ID3D10Device *)This);
971 ULONG STDMETHODCALLTYPE device_parent_Release(IWineD3DDeviceParent *iface)
973 struct d3d10_device *This = device_from_device_parent(iface);
974 return d3d10_device_Release((ID3D10Device *)This);
977 /* IWineD3DDeviceParent methods */
979 static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParent *iface,
980 IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, DWORD usage,
981 WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface **surface)
983 struct d3d10_device *This = device_from_device_parent(iface);
984 struct d3d10_texture2d *texture;
985 D3D10_TEXTURE2D_DESC desc;
988 FIXME("iface %p, superior %p, width %u, height %u, format %#x, usage %#x,\n"
989 "\tpool %#x, level %u, face %u, surface %p partial stub!\n",
990 iface, superior, width, height, format, usage, pool, level, face, surface);
992 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
995 desc.Height = height;
998 desc.Format = format;
999 desc.SampleDesc.Count = 1;
1000 desc.SampleDesc.Quality = 0;
1003 desc.CPUAccessFlags = 0;
1006 hr = d3d10_device_CreateTexture2D((ID3D10Device *)This, &desc, NULL, (ID3D10Texture2D **)&texture);
1009 ERR("CreateTexture2D failed, returning %#x\n", hr);
1013 *surface = texture->wined3d_surface;
1018 static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDeviceParent *iface,
1019 IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type,
1020 DWORD multisample_quality, BOOL lockable, IWineD3DSurface **surface)
1022 struct d3d10_device *This = device_from_device_parent(iface);
1023 struct d3d10_texture2d *texture;
1024 D3D10_TEXTURE2D_DESC desc;
1027 FIXME("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
1028 "\tmultisample_quality %u, lockable %u, surface %p stub!\n",
1029 iface, superior, width, height, format, multisample_type, multisample_quality, lockable, surface);
1031 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
1034 desc.Height = height;
1037 desc.Format = format;
1038 desc.SampleDesc.Count = multisample_type;
1039 desc.SampleDesc.Quality = multisample_quality;
1040 desc.Usage = D3D10_USAGE_DEFAULT;
1041 desc.BindFlags = D3D10_BIND_RENDER_TARGET;
1042 desc.CPUAccessFlags = 0;
1045 hr = d3d10_device_CreateTexture2D((ID3D10Device *)This, &desc, NULL, (ID3D10Texture2D **)&texture);
1048 ERR("CreateTexture2D failed, returning %#x\n", hr);
1052 *surface = texture->wined3d_surface;
1057 static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3DDeviceParent *iface,
1058 IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type,
1059 DWORD multisample_quality, BOOL discard, IWineD3DSurface **surface)
1061 struct d3d10_device *This = device_from_device_parent(iface);
1062 struct d3d10_texture2d *texture;
1063 D3D10_TEXTURE2D_DESC desc;
1066 FIXME("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
1067 "\tmultisample_quality %u, discard %u, surface %p stub!\n",
1068 iface, superior, width, height, format, multisample_type, multisample_quality, discard, surface);
1070 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
1073 desc.Height = height;
1076 desc.Format = format;
1077 desc.SampleDesc.Count = multisample_type;
1078 desc.SampleDesc.Quality = multisample_quality;
1079 desc.Usage = D3D10_USAGE_DEFAULT;
1080 desc.BindFlags = D3D10_BIND_RENDER_TARGET;
1081 desc.CPUAccessFlags = 0;
1084 hr = d3d10_device_CreateTexture2D((ID3D10Device *)This, &desc, NULL, (ID3D10Texture2D **)&texture);
1087 ERR("CreateTexture2D failed, returning %#x\n", hr);
1091 *surface = texture->wined3d_surface;
1096 static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface,
1097 IUnknown *superior, UINT width, UINT height, UINT depth, WINED3DFORMAT format,
1098 WINED3DPOOL pool, DWORD usage, IWineD3DVolume **volume)
1100 FIXME("iface %p, superior %p, width %u, height %u, depth %u, format %#x, pool %#x, usage %#x, volume %p stub!\n",
1101 iface, superior, width, height, depth, format, pool, usage, volume);
1106 static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDeviceParent *iface,
1107 WINED3DPRESENT_PARAMETERS *present_parameters, IWineD3DSwapChain **swapchain)
1109 FIXME("iface %p, present_parameters %p, swapchain %p stub!\n", iface, present_parameters, swapchain);
1115 const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl =
1117 /* IUnknown methods */
1118 device_parent_QueryInterface,
1119 device_parent_AddRef,
1120 device_parent_Release,
1121 /* IWineD3DDeviceParent methods */
1122 device_parent_CreateSurface,
1123 device_parent_CreateRenderTarget,
1124 device_parent_CreateDepthStencilSurface,
1125 device_parent_CreateVolume,
1126 device_parent_CreateSwapChain,