push 2f3ca95c4974ba229fa47d638b3044f50788f3bd
[wine/hacks.git] / dlls / d3d10core / device.c
blob71291cff48d36fd196c199f5b7a14ee44ebe2815
1 /*
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
20 #include "config.h"
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);
44 *object = This;
45 return S_OK;
48 if (IsEqualGUID(riid, &IID_IWineD3DDeviceParent))
50 IUnknown_AddRef((IUnknown *)&This->device_parent_vtbl);
51 *object = &This->device_parent_vtbl;
52 return S_OK;
55 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
57 *object = NULL;
58 return E_NOINTERFACE;
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);
68 return 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);
78 return 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);
505 return E_NOTIMPL;
508 static HRESULT STDMETHODCALLTYPE d3d10_device_SetExceptionMode(ID3D10Device *iface, UINT flags)
510 FIXME("iface %p, flags %#x stub!\n", iface, flags);
512 return E_NOTIMPL;
515 static UINT STDMETHODCALLTYPE d3d10_device_GetExceptionMode(ID3D10Device *iface)
517 FIXME("iface %p stub!\n", iface);
519 return 0;
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);
528 return E_NOTIMPL;
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);
537 return E_NOTIMPL;
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);
545 return E_NOTIMPL;
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 struct d3d10_buffer *object;
563 FIXME("iface %p, desc %p, data %p, buffer %p partial stub!\n", iface, desc, data, buffer);
565 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
566 if (!object)
568 ERR("Failed to allocate D3D10 buffer object memory\n");
569 return E_OUTOFMEMORY;
572 object->vtbl = &d3d10_buffer_vtbl;
573 object->refcount = 1;
575 *buffer = (ID3D10Buffer *)object;
577 TRACE("Created ID3D10Buffer %p\n", object);
579 return S_OK;
582 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture1D(ID3D10Device *iface,
583 const D3D10_TEXTURE1D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture1D **texture)
585 FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
587 return E_NOTIMPL;
590 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device *iface,
591 const D3D10_TEXTURE2D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture2D **texture)
593 struct d3d10_texture2d *object;
594 HRESULT hr;
596 FIXME("iface %p, desc %p, data %p, texture %p partial stub!\n", iface, desc, data, texture);
598 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
599 if (!object)
601 ERR("Failed to allocate D3D10 texture2d object memory\n");
602 return E_OUTOFMEMORY;
605 object->vtbl = &d3d10_texture2d_vtbl;
606 object->refcount = 1;
608 if (desc->MipLevels == 1 && desc->ArraySize == 1)
610 IWineD3DDevice *wined3d_device;
611 IWineDXGIDevice *wine_device;
613 hr = ID3D10Device_QueryInterface(iface, &IID_IWineDXGIDevice, (void **)&wine_device);
614 if (FAILED(hr))
616 ERR("Device should implement IWineDXGIDevice\n");
617 HeapFree(GetProcessHeap(), 0, object);
618 return E_FAIL;
621 hr = IWineDXGIDevice_create_surface(wine_device, NULL, 0, NULL,
622 (IUnknown *)object, (void **)&object->dxgi_surface);
623 if (FAILED(hr))
625 ERR("Failed to create DXGI surface, returning %#x\n", hr);
626 HeapFree(GetProcessHeap(), 0, object);
627 IWineDXGIDevice_Release(wine_device);
628 return hr;
631 wined3d_device = IWineDXGIDevice_get_wined3d_device(wine_device);
632 IWineDXGIDevice_Release(wine_device);
634 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
636 hr = IWineD3DDevice_CreateSurface(wined3d_device, desc->Width, desc->Height, desc->Format, FALSE,
637 FALSE, 0, &object->wined3d_surface, WINED3DRTYPE_SURFACE, desc->Usage, WINED3DPOOL_DEFAULT,
638 desc->SampleDesc.Count, desc->SampleDesc.Quality, NULL, SURFACE_OPENGL, (IUnknown *)object);
639 IWineD3DDevice_Release(wined3d_device);
640 if (FAILED(hr))
642 ERR("CreateSurface failed, returning %#x\n", hr);
643 IDXGISurface_Release(object->dxgi_surface);
644 HeapFree(GetProcessHeap(), 0, object);
645 return hr;
649 *texture = (ID3D10Texture2D *)object;
651 TRACE("Created ID3D10Texture2D %p\n", object);
653 return S_OK;
656 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture3D(ID3D10Device *iface,
657 const D3D10_TEXTURE3D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture3D **texture)
659 FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
661 return E_NOTIMPL;
664 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView(ID3D10Device *iface,
665 ID3D10Resource *resource, const D3D10_SHADER_RESOURCE_VIEW_DESC *desc, ID3D10ShaderResourceView **view)
667 FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
669 return E_NOTIMPL;
672 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Device *iface,
673 ID3D10Resource *resource, const D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3D10RenderTargetView **view)
675 struct d3d10_rendertarget_view *object;
677 TRACE("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
679 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
680 if (!object)
682 ERR("Failed to allocate D3D10 rendertarget view object memory\n");
683 return E_OUTOFMEMORY;
686 object->vtbl = &d3d10_rendertarget_view_vtbl;
687 object->refcount = 1;
688 object->resource = resource;
689 ID3D10Resource_AddRef(resource);
691 *view = (ID3D10RenderTargetView *)object;
693 return S_OK;
696 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Device *iface,
697 ID3D10Resource *resource, const D3D10_DEPTH_STENCIL_VIEW_DESC *desc, ID3D10DepthStencilView **view)
699 FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view);
701 return E_NOTIMPL;
704 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateInputLayout(ID3D10Device *iface,
705 const D3D10_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code,
706 SIZE_T shader_byte_code_length, ID3D10InputLayout **input_layout)
708 FIXME("iface %p, element_descs %p, element_count %u, shader_byte_code %p,"
709 "\tshader_byte_code_length %lu, input_layout %p stub!\n",
710 iface, element_descs, element_count, shader_byte_code,
711 shader_byte_code_length, input_layout);
713 return E_NOTIMPL;
716 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateVertexShader(ID3D10Device *iface,
717 const void *byte_code, SIZE_T byte_code_length, ID3D10VertexShader **shader)
719 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
720 iface, byte_code, byte_code_length, shader);
722 return E_NOTIMPL;
725 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShader(ID3D10Device *iface,
726 const void *byte_code, SIZE_T byte_code_length, ID3D10GeometryShader **shader)
728 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
729 iface, byte_code, byte_code_length, shader);
731 return E_NOTIMPL;
734 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutput(ID3D10Device *iface,
735 const void *byte_code, SIZE_T byte_code_length, const D3D10_SO_DECLARATION_ENTRY *output_stream_decls,
736 UINT output_stream_decl_count, UINT output_stream_stride, ID3D10GeometryShader **shader)
738 FIXME("iface %p, byte_code %p, byte_code_length %lu, output_stream_decls %p,\n"
739 "\toutput_stream_decl_count %u, output_stream_stride %u, shader %p stub!\n",
740 iface, byte_code, byte_code_length, output_stream_decls,
741 output_stream_decl_count, output_stream_stride, shader);
743 return E_NOTIMPL;
746 static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device *iface,
747 const void *byte_code, SIZE_T byte_code_length, ID3D10PixelShader **shader)
749 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
750 iface, byte_code, byte_code_length, shader);
752 return E_NOTIMPL;
755 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBlendState(ID3D10Device *iface,
756 const D3D10_BLEND_DESC *desc, ID3D10BlendState **blend_state)
758 FIXME("iface %p, desc %p, blend_state %p stub!\n", iface, desc, blend_state);
760 return E_NOTIMPL;
763 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Device *iface,
764 const D3D10_DEPTH_STENCIL_DESC *desc, ID3D10DepthStencilState **depth_stencil_state)
766 FIXME("iface %p, desc %p, depth_stencil_state %p stub!\n", iface, desc, depth_stencil_state);
768 return E_NOTIMPL;
771 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device *iface,
772 const D3D10_RASTERIZER_DESC *desc, ID3D10RasterizerState **rasterizer_state)
774 FIXME("iface %p, desc %p, rasterizer_state %p stub!\n", iface, desc, rasterizer_state);
776 return E_NOTIMPL;
779 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device *iface,
780 const D3D10_SAMPLER_DESC *desc, ID3D10SamplerState **sampler_state)
782 FIXME("iface %p, desc %p, sampler_state %p stub!\n", iface, desc, sampler_state);
784 return E_NOTIMPL;
787 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device *iface,
788 const D3D10_QUERY_DESC *desc, ID3D10Query **query)
790 FIXME("iface %p, desc %p, query %p stub!\n", iface, desc, query);
792 return E_NOTIMPL;
795 static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePredicate(ID3D10Device *iface,
796 const D3D10_QUERY_DESC *desc, ID3D10Predicate **predicate)
798 FIXME("iface %p, desc %p, predicate %p stub!\n", iface, desc, predicate);
800 return E_NOTIMPL;
803 static HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device *iface,
804 const D3D10_COUNTER_DESC *desc, ID3D10Counter **counter)
806 FIXME("iface %p, desc %p, counter %p stub!\n", iface, desc, counter);
808 return E_NOTIMPL;
811 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device *iface,
812 DXGI_FORMAT format, UINT *format_support)
814 FIXME("iface %p, format %s, format_support %p stub!\n",
815 iface, debug_dxgi_format(format), format_support);
817 return E_NOTIMPL;
820 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device *iface,
821 DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count)
823 FIXME("iface %p, format %s, sample_count %u, quality_level_count %p stub!\n",
824 iface, debug_dxgi_format(format), sample_count, quality_level_count);
826 return E_NOTIMPL;
829 static void STDMETHODCALLTYPE d3d10_device_CheckCounterInfo(ID3D10Device *iface, D3D10_COUNTER_INFO *counter_info)
831 FIXME("iface %p, counter_info %p stub!\n", iface, counter_info);
834 static HRESULT STDMETHODCALLTYPE d3d10_device_CheckCounter(ID3D10Device *iface,
835 const D3D10_COUNTER_DESC *desc, D3D10_COUNTER_TYPE *type, UINT *active_counters, LPSTR name,
836 UINT *name_length, LPSTR units, UINT *units_length, LPSTR description, UINT *description_length)
838 FIXME("iface %p, desc %p, type %p, active_counters %p, name %p, name_length %p,\n"
839 "\tunits %p, units_length %p, description %p, description_length %p stub!\n",
840 iface, desc, type, active_counters, name, name_length,
841 units, units_length, description, description_length);
843 return E_NOTIMPL;
846 static UINT STDMETHODCALLTYPE d3d10_device_GetCreationFlags(ID3D10Device *iface)
848 FIXME("iface %p stub!\n", iface);
850 return 0;
853 static HRESULT STDMETHODCALLTYPE d3d10_device_OpenSharedResource(ID3D10Device *iface,
854 HANDLE resource_handle, REFIID guid, void **resource)
856 FIXME("iface %p, resource_handle %p, guid %s, resource %p stub!\n",
857 iface, resource_handle, debugstr_guid(guid), resource);
859 return E_NOTIMPL;
862 static void STDMETHODCALLTYPE d3d10_device_SetTextFilterSize(ID3D10Device *iface, UINT width, UINT height)
864 FIXME("iface %p, width %u, height %u stub!\n", iface, width, height);
867 static void STDMETHODCALLTYPE d3d10_device_GetTextFilterSize(ID3D10Device *iface, UINT *width, UINT *height)
869 FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
872 const struct ID3D10DeviceVtbl d3d10_device_vtbl =
874 /* IUnknown methods */
875 d3d10_device_QueryInterface,
876 d3d10_device_AddRef,
877 d3d10_device_Release,
878 /* ID3D10Device methods */
879 d3d10_device_VSSetConstantBuffers,
880 d3d10_device_PSSetShaderResources,
881 d3d10_device_PSSetShader,
882 d3d10_device_PSSetSamplers,
883 d3d10_device_VSSetShader,
884 d3d10_device_DrawIndexed,
885 d3d10_device_Draw,
886 d3d10_device_PSSetConstantBuffers,
887 d3d10_device_IASetInputLayout,
888 d3d10_device_IASetVertexBuffers,
889 d3d10_device_IASetIndexBuffer,
890 d3d10_device_DrawIndexedInstanced,
891 d3d10_device_DrawInstanced,
892 d3d10_device_GSSetConstantBuffers,
893 d3d10_device_GSSetShader,
894 d3d10_device_IASetPrimitiveTopology,
895 d3d10_device_VSSetShaderResources,
896 d3d10_device_VSSetSamplers,
897 d3d10_device_SetPredication,
898 d3d10_device_GSSetShaderResources,
899 d3d10_device_GSSetSamplers,
900 d3d10_device_OMSetRenderTargets,
901 d3d10_device_OMSetBlendState,
902 d3d10_device_OMSetDepthStencilState,
903 d3d10_device_SOSetTargets,
904 d3d10_device_DrawAuto,
905 d3d10_device_RSSetState,
906 d3d10_device_RSSetViewports,
907 d3d10_device_RSSetScissorRects,
908 d3d10_device_CopySubresourceRegion,
909 d3d10_device_CopyResource,
910 d3d10_device_UpdateSubresource,
911 d3d10_device_ClearRenderTargetView,
912 d3d10_device_ClearDepthStencilView,
913 d3d10_device_GenerateMips,
914 d3d10_device_ResolveSubresource,
915 d3d10_device_VSGetConstantBuffers,
916 d3d10_device_PSGetShaderResources,
917 d3d10_device_PSGetShader,
918 d3d10_device_PSGetSamplers,
919 d3d10_device_VSGetShader,
920 d3d10_device_PSGetConstantBuffers,
921 d3d10_device_IAGetInputLayout,
922 d3d10_device_IAGetVertexBuffers,
923 d3d10_device_IAGetIndexBuffer,
924 d3d10_device_GSGetConstantBuffers,
925 d3d10_device_GSGetShader,
926 d3d10_device_IAGetPrimitiveTopology,
927 d3d10_device_VSGetShaderResources,
928 d3d10_device_VSGetSamplers,
929 d3d10_device_GetPredication,
930 d3d10_device_GSGetShaderResources,
931 d3d10_device_GSGetSamplers,
932 d3d10_device_OMGetRenderTargets,
933 d3d10_device_OMGetBlendState,
934 d3d10_device_OMGetDepthStencilState,
935 d3d10_device_SOGetTargets,
936 d3d10_device_RSGetState,
937 d3d10_device_RSGetViewports,
938 d3d10_device_RSGetScissorRects,
939 d3d10_device_GetDeviceRemovedReason,
940 d3d10_device_SetExceptionMode,
941 d3d10_device_GetExceptionMode,
942 d3d10_device_GetPrivateData,
943 d3d10_device_SetPrivateData,
944 d3d10_device_SetPrivateDataInterface,
945 d3d10_device_ClearState,
946 d3d10_device_Flush,
947 d3d10_device_CreateBuffer,
948 d3d10_device_CreateTexture1D,
949 d3d10_device_CreateTexture2D,
950 d3d10_device_CreateTexture3D,
951 d3d10_device_CreateShaderResourceView,
952 d3d10_device_CreateRenderTargetView,
953 d3d10_device_CreateDepthStencilView,
954 d3d10_device_CreateInputLayout,
955 d3d10_device_CreateVertexShader,
956 d3d10_device_CreateGeometryShader,
957 d3d10_device_CreateGeometryShaderWithStreamOutput,
958 d3d10_device_CreatePixelShader,
959 d3d10_device_CreateBlendState,
960 d3d10_device_CreateDepthStencilState,
961 d3d10_device_CreateRasterizerState,
962 d3d10_device_CreateSamplerState,
963 d3d10_device_CreateQuery,
964 d3d10_device_CreatePredicate,
965 d3d10_device_CreateCounter,
966 d3d10_device_CheckFormatSupport,
967 d3d10_device_CheckMultisampleQualityLevels,
968 d3d10_device_CheckCounterInfo,
969 d3d10_device_CheckCounter,
970 d3d10_device_GetCreationFlags,
971 d3d10_device_OpenSharedResource,
972 d3d10_device_SetTextFilterSize,
973 d3d10_device_GetTextFilterSize,
976 const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl =
978 /* IUnknown methods */
979 d3d10_device_inner_QueryInterface,
980 d3d10_device_inner_AddRef,
981 d3d10_device_inner_Release,
984 /* IWineD3DDeviceParent IUnknown methods */
986 static inline struct d3d10_device *device_from_device_parent(IWineD3DDeviceParent *iface)
988 return (struct d3d10_device *)((char*)iface - FIELD_OFFSET(struct d3d10_device, device_parent_vtbl));
991 HRESULT STDMETHODCALLTYPE device_parent_QueryInterface(IWineD3DDeviceParent *iface, REFIID riid, void **object)
993 struct d3d10_device *This = device_from_device_parent(iface);
994 return d3d10_device_QueryInterface((ID3D10Device *)This, riid, object);
997 ULONG STDMETHODCALLTYPE device_parent_AddRef(IWineD3DDeviceParent *iface)
999 struct d3d10_device *This = device_from_device_parent(iface);
1000 return d3d10_device_AddRef((ID3D10Device *)This);
1003 ULONG STDMETHODCALLTYPE device_parent_Release(IWineD3DDeviceParent *iface)
1005 struct d3d10_device *This = device_from_device_parent(iface);
1006 return d3d10_device_Release((ID3D10Device *)This);
1009 /* IWineD3DDeviceParent methods */
1011 static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParent *iface,
1012 IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, DWORD usage,
1013 WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface **surface)
1015 struct d3d10_device *This = device_from_device_parent(iface);
1016 struct d3d10_texture2d *texture;
1017 D3D10_TEXTURE2D_DESC desc;
1018 HRESULT hr;
1020 FIXME("iface %p, superior %p, width %u, height %u, format %#x, usage %#x,\n"
1021 "\tpool %#x, level %u, face %u, surface %p partial stub!\n",
1022 iface, superior, width, height, format, usage, pool, level, face, surface);
1024 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
1026 desc.Width = width;
1027 desc.Height = height;
1028 desc.MipLevels = 1;
1029 desc.ArraySize = 1;
1030 desc.Format = format;
1031 desc.SampleDesc.Count = 1;
1032 desc.SampleDesc.Quality = 0;
1033 desc.Usage = usage;
1034 desc.BindFlags = 0;
1035 desc.CPUAccessFlags = 0;
1036 desc.MiscFlags = 0;
1038 hr = d3d10_device_CreateTexture2D((ID3D10Device *)This, &desc, NULL, (ID3D10Texture2D **)&texture);
1039 if (FAILED(hr))
1041 ERR("CreateTexture2D failed, returning %#x\n", hr);
1042 return hr;
1045 *surface = texture->wined3d_surface;
1047 return S_OK;
1050 static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDeviceParent *iface,
1051 IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type,
1052 DWORD multisample_quality, BOOL lockable, IWineD3DSurface **surface)
1054 struct d3d10_device *This = device_from_device_parent(iface);
1055 struct d3d10_texture2d *texture;
1056 D3D10_TEXTURE2D_DESC desc;
1057 HRESULT hr;
1059 FIXME("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
1060 "\tmultisample_quality %u, lockable %u, surface %p stub!\n",
1061 iface, superior, width, height, format, multisample_type, multisample_quality, lockable, surface);
1063 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
1065 desc.Width = width;
1066 desc.Height = height;
1067 desc.MipLevels = 1;
1068 desc.ArraySize = 1;
1069 desc.Format = format;
1070 desc.SampleDesc.Count = multisample_type;
1071 desc.SampleDesc.Quality = multisample_quality;
1072 desc.Usage = D3D10_USAGE_DEFAULT;
1073 desc.BindFlags = D3D10_BIND_RENDER_TARGET;
1074 desc.CPUAccessFlags = 0;
1075 desc.MiscFlags = 0;
1077 hr = d3d10_device_CreateTexture2D((ID3D10Device *)This, &desc, NULL, (ID3D10Texture2D **)&texture);
1078 if (FAILED(hr))
1080 ERR("CreateTexture2D failed, returning %#x\n", hr);
1081 return hr;
1084 *surface = texture->wined3d_surface;
1086 return S_OK;
1089 static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3DDeviceParent *iface,
1090 IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type,
1091 DWORD multisample_quality, BOOL discard, IWineD3DSurface **surface)
1093 struct d3d10_device *This = device_from_device_parent(iface);
1094 struct d3d10_texture2d *texture;
1095 D3D10_TEXTURE2D_DESC desc;
1096 HRESULT hr;
1098 FIXME("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
1099 "\tmultisample_quality %u, discard %u, surface %p stub!\n",
1100 iface, superior, width, height, format, multisample_type, multisample_quality, discard, surface);
1102 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
1104 desc.Width = width;
1105 desc.Height = height;
1106 desc.MipLevels = 1;
1107 desc.ArraySize = 1;
1108 desc.Format = format;
1109 desc.SampleDesc.Count = multisample_type;
1110 desc.SampleDesc.Quality = multisample_quality;
1111 desc.Usage = D3D10_USAGE_DEFAULT;
1112 desc.BindFlags = D3D10_BIND_RENDER_TARGET;
1113 desc.CPUAccessFlags = 0;
1114 desc.MiscFlags = 0;
1116 hr = d3d10_device_CreateTexture2D((ID3D10Device *)This, &desc, NULL, (ID3D10Texture2D **)&texture);
1117 if (FAILED(hr))
1119 ERR("CreateTexture2D failed, returning %#x\n", hr);
1120 return hr;
1123 *surface = texture->wined3d_surface;
1125 return S_OK;
1128 static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface,
1129 IUnknown *superior, UINT width, UINT height, UINT depth, WINED3DFORMAT format,
1130 WINED3DPOOL pool, DWORD usage, IWineD3DVolume **volume)
1132 FIXME("iface %p, superior %p, width %u, height %u, depth %u, format %#x, pool %#x, usage %#x, volume %p stub!\n",
1133 iface, superior, width, height, depth, format, pool, usage, volume);
1135 return E_NOTIMPL;
1138 static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDeviceParent *iface,
1139 WINED3DPRESENT_PARAMETERS *present_parameters, IWineD3DSwapChain **swapchain)
1141 FIXME("iface %p, present_parameters %p, swapchain %p stub!\n", iface, present_parameters, swapchain);
1143 return E_NOTIMPL;
1147 const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl =
1149 /* IUnknown methods */
1150 device_parent_QueryInterface,
1151 device_parent_AddRef,
1152 device_parent_Release,
1153 /* IWineD3DDeviceParent methods */
1154 device_parent_CreateSurface,
1155 device_parent_CreateRenderTarget,
1156 device_parent_CreateDepthStencilSurface,
1157 device_parent_CreateVolume,
1158 device_parent_CreateSwapChain,