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 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
));
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
);
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
);
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
;
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
));
601 ERR("Failed to allocate D3D10 texture2d object memory\n");
602 return E_OUTOFMEMORY
;
605 object
->vtbl
= &d3d10_texture2d_vtbl
;
606 object
->refcount
= 1;
607 object
->desc
= *desc
;
609 if (desc
->MipLevels
== 1 && desc
->ArraySize
== 1)
611 IWineD3DDevice
*wined3d_device
;
612 IWineDXGIDevice
*wine_device
;
614 hr
= ID3D10Device_QueryInterface(iface
, &IID_IWineDXGIDevice
, (void **)&wine_device
);
617 ERR("Device should implement IWineDXGIDevice\n");
618 HeapFree(GetProcessHeap(), 0, object
);
622 hr
= IWineDXGIDevice_create_surface(wine_device
, NULL
, 0, NULL
,
623 (IUnknown
*)object
, (void **)&object
->dxgi_surface
);
626 ERR("Failed to create DXGI surface, returning %#x\n", hr
);
627 HeapFree(GetProcessHeap(), 0, object
);
628 IWineDXGIDevice_Release(wine_device
);
632 wined3d_device
= IWineDXGIDevice_get_wined3d_device(wine_device
);
633 IWineDXGIDevice_Release(wine_device
);
635 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
637 hr
= IWineD3DDevice_CreateSurface(wined3d_device
, desc
->Width
, desc
->Height
, desc
->Format
, FALSE
,
638 FALSE
, 0, &object
->wined3d_surface
, WINED3DRTYPE_SURFACE
, desc
->Usage
, WINED3DPOOL_DEFAULT
,
639 desc
->SampleDesc
.Count
, desc
->SampleDesc
.Quality
, NULL
, SURFACE_OPENGL
, (IUnknown
*)object
);
640 IWineD3DDevice_Release(wined3d_device
);
643 ERR("CreateSurface failed, returning %#x\n", hr
);
644 IDXGISurface_Release(object
->dxgi_surface
);
645 HeapFree(GetProcessHeap(), 0, object
);
650 *texture
= (ID3D10Texture2D
*)object
;
652 TRACE("Created ID3D10Texture2D %p\n", object
);
657 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateTexture3D(ID3D10Device
*iface
,
658 const D3D10_TEXTURE3D_DESC
*desc
, const D3D10_SUBRESOURCE_DATA
*data
, ID3D10Texture3D
**texture
)
660 FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface
, desc
, data
, texture
);
665 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateShaderResourceView(ID3D10Device
*iface
,
666 ID3D10Resource
*resource
, const D3D10_SHADER_RESOURCE_VIEW_DESC
*desc
, ID3D10ShaderResourceView
**view
)
668 FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface
, resource
, desc
, view
);
673 static HRESULT
d3d10_device_set_rtdesc_from_resource(D3D10_RENDER_TARGET_VIEW_DESC
*desc
, ID3D10Resource
*resource
)
675 D3D10_RESOURCE_DIMENSION dimension
;
678 ID3D10Resource_GetType(resource
, &dimension
);
682 case D3D10_RESOURCE_DIMENSION_TEXTURE1D
:
684 ID3D10Texture1D
*texture
;
685 D3D10_TEXTURE1D_DESC texture_desc
;
687 hr
= ID3D10Resource_QueryInterface(resource
, &IID_ID3D10Texture1D
, (void **)&texture
);
690 ERR("Resource of type TEXTURE1D doesn't implement ID3D10Texture1D?\n");
694 ID3D10Texture1D_GetDesc(texture
, &texture_desc
);
695 ID3D10Texture1D_Release(texture
);
697 desc
->Format
= texture_desc
.Format
;
698 if (texture_desc
.ArraySize
== 1)
700 desc
->ViewDimension
= D3D10_RTV_DIMENSION_TEXTURE1D
;
701 desc
->Texture1D
.MipSlice
= 0;
705 desc
->ViewDimension
= D3D10_RTV_DIMENSION_TEXTURE1DARRAY
;
706 desc
->Texture1DArray
.MipSlice
= 0;
707 desc
->Texture1DArray
.FirstArraySlice
= 0;
708 desc
->Texture1DArray
.ArraySize
= 1;
714 case D3D10_RESOURCE_DIMENSION_TEXTURE2D
:
716 ID3D10Texture2D
*texture
;
717 D3D10_TEXTURE2D_DESC texture_desc
;
719 hr
= ID3D10Resource_QueryInterface(resource
, &IID_ID3D10Texture2D
, (void **)&texture
);
722 ERR("Resource of type TEXTURE2D doesn't implement ID3D10Texture2D?\n");
726 ID3D10Texture2D_GetDesc(texture
, &texture_desc
);
727 ID3D10Texture2D_Release(texture
);
729 desc
->Format
= texture_desc
.Format
;
730 if (texture_desc
.ArraySize
== 1)
732 if (texture_desc
.SampleDesc
.Count
== 1)
734 desc
->ViewDimension
= D3D10_RTV_DIMENSION_TEXTURE2D
;
735 desc
->Texture2D
.MipSlice
= 0;
739 desc
->ViewDimension
= D3D10_RTV_DIMENSION_TEXTURE2DMS
;
744 if (texture_desc
.SampleDesc
.Count
== 1)
746 desc
->ViewDimension
= D3D10_RTV_DIMENSION_TEXTURE2DARRAY
;
747 desc
->Texture2DArray
.MipSlice
= 0;
748 desc
->Texture2DArray
.FirstArraySlice
= 0;
749 desc
->Texture2DArray
.ArraySize
= 1;
753 desc
->ViewDimension
= D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY
;
754 desc
->Texture2DMSArray
.FirstArraySlice
= 0;
755 desc
->Texture2DMSArray
.ArraySize
= 1;
762 case D3D10_RESOURCE_DIMENSION_TEXTURE3D
:
764 ID3D10Texture3D
*texture
;
765 D3D10_TEXTURE3D_DESC texture_desc
;
767 hr
= ID3D10Resource_QueryInterface(resource
, &IID_ID3D10Texture3D
, (void **)&texture
);
770 ERR("Resource of type TEXTURE3D doesn't implement ID3D10Texture3D?\n");
774 ID3D10Texture3D_GetDesc(texture
, &texture_desc
);
775 ID3D10Texture3D_Release(texture
);
777 desc
->Format
= texture_desc
.Format
;
778 desc
->ViewDimension
= D3D10_RTV_DIMENSION_TEXTURE3D
;
779 desc
->Texture3D
.MipSlice
= 0;
780 desc
->Texture3D
.FirstWSlice
= 0;
781 desc
->Texture3D
.WSize
= 1;
787 FIXME("Unhandled resource dimension %#x\n", dimension
);
792 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateRenderTargetView(ID3D10Device
*iface
,
793 ID3D10Resource
*resource
, const D3D10_RENDER_TARGET_VIEW_DESC
*desc
, ID3D10RenderTargetView
**view
)
795 struct d3d10_rendertarget_view
*object
;
797 TRACE("iface %p, resource %p, desc %p, view %p stub!\n", iface
, resource
, desc
, view
);
799 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
802 ERR("Failed to allocate D3D10 rendertarget view object memory\n");
803 return E_OUTOFMEMORY
;
806 object
->vtbl
= &d3d10_rendertarget_view_vtbl
;
807 object
->refcount
= 1;
811 HRESULT hr
= d3d10_device_set_rtdesc_from_resource(&object
->desc
, resource
);
814 HeapFree(GetProcessHeap(), 0, object
);
820 object
->desc
= *desc
;
823 object
->resource
= resource
;
824 ID3D10Resource_AddRef(resource
);
826 *view
= (ID3D10RenderTargetView
*)object
;
831 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateDepthStencilView(ID3D10Device
*iface
,
832 ID3D10Resource
*resource
, const D3D10_DEPTH_STENCIL_VIEW_DESC
*desc
, ID3D10DepthStencilView
**view
)
834 FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface
, resource
, desc
, view
);
839 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateInputLayout(ID3D10Device
*iface
,
840 const D3D10_INPUT_ELEMENT_DESC
*element_descs
, UINT element_count
, const void *shader_byte_code
,
841 SIZE_T shader_byte_code_length
, ID3D10InputLayout
**input_layout
)
843 FIXME("iface %p, element_descs %p, element_count %u, shader_byte_code %p,"
844 "\tshader_byte_code_length %lu, input_layout %p stub!\n",
845 iface
, element_descs
, element_count
, shader_byte_code
,
846 shader_byte_code_length
, input_layout
);
851 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateVertexShader(ID3D10Device
*iface
,
852 const void *byte_code
, SIZE_T byte_code_length
, ID3D10VertexShader
**shader
)
854 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
855 iface
, byte_code
, byte_code_length
, shader
);
860 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateGeometryShader(ID3D10Device
*iface
,
861 const void *byte_code
, SIZE_T byte_code_length
, ID3D10GeometryShader
**shader
)
863 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
864 iface
, byte_code
, byte_code_length
, shader
);
869 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateGeometryShaderWithStreamOutput(ID3D10Device
*iface
,
870 const void *byte_code
, SIZE_T byte_code_length
, const D3D10_SO_DECLARATION_ENTRY
*output_stream_decls
,
871 UINT output_stream_decl_count
, UINT output_stream_stride
, ID3D10GeometryShader
**shader
)
873 FIXME("iface %p, byte_code %p, byte_code_length %lu, output_stream_decls %p,\n"
874 "\toutput_stream_decl_count %u, output_stream_stride %u, shader %p stub!\n",
875 iface
, byte_code
, byte_code_length
, output_stream_decls
,
876 output_stream_decl_count
, output_stream_stride
, shader
);
881 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreatePixelShader(ID3D10Device
*iface
,
882 const void *byte_code
, SIZE_T byte_code_length
, ID3D10PixelShader
**shader
)
884 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
885 iface
, byte_code
, byte_code_length
, shader
);
890 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateBlendState(ID3D10Device
*iface
,
891 const D3D10_BLEND_DESC
*desc
, ID3D10BlendState
**blend_state
)
893 FIXME("iface %p, desc %p, blend_state %p stub!\n", iface
, desc
, blend_state
);
898 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateDepthStencilState(ID3D10Device
*iface
,
899 const D3D10_DEPTH_STENCIL_DESC
*desc
, ID3D10DepthStencilState
**depth_stencil_state
)
901 FIXME("iface %p, desc %p, depth_stencil_state %p stub!\n", iface
, desc
, depth_stencil_state
);
906 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateRasterizerState(ID3D10Device
*iface
,
907 const D3D10_RASTERIZER_DESC
*desc
, ID3D10RasterizerState
**rasterizer_state
)
909 FIXME("iface %p, desc %p, rasterizer_state %p stub!\n", iface
, desc
, rasterizer_state
);
914 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateSamplerState(ID3D10Device
*iface
,
915 const D3D10_SAMPLER_DESC
*desc
, ID3D10SamplerState
**sampler_state
)
917 FIXME("iface %p, desc %p, sampler_state %p stub!\n", iface
, desc
, sampler_state
);
922 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateQuery(ID3D10Device
*iface
,
923 const D3D10_QUERY_DESC
*desc
, ID3D10Query
**query
)
925 FIXME("iface %p, desc %p, query %p stub!\n", iface
, desc
, query
);
930 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreatePredicate(ID3D10Device
*iface
,
931 const D3D10_QUERY_DESC
*desc
, ID3D10Predicate
**predicate
)
933 FIXME("iface %p, desc %p, predicate %p stub!\n", iface
, desc
, predicate
);
938 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateCounter(ID3D10Device
*iface
,
939 const D3D10_COUNTER_DESC
*desc
, ID3D10Counter
**counter
)
941 FIXME("iface %p, desc %p, counter %p stub!\n", iface
, desc
, counter
);
946 static HRESULT STDMETHODCALLTYPE
d3d10_device_CheckFormatSupport(ID3D10Device
*iface
,
947 DXGI_FORMAT format
, UINT
*format_support
)
949 FIXME("iface %p, format %s, format_support %p stub!\n",
950 iface
, debug_dxgi_format(format
), format_support
);
955 static HRESULT STDMETHODCALLTYPE
d3d10_device_CheckMultisampleQualityLevels(ID3D10Device
*iface
,
956 DXGI_FORMAT format
, UINT sample_count
, UINT
*quality_level_count
)
958 FIXME("iface %p, format %s, sample_count %u, quality_level_count %p stub!\n",
959 iface
, debug_dxgi_format(format
), sample_count
, quality_level_count
);
964 static void STDMETHODCALLTYPE
d3d10_device_CheckCounterInfo(ID3D10Device
*iface
, D3D10_COUNTER_INFO
*counter_info
)
966 FIXME("iface %p, counter_info %p stub!\n", iface
, counter_info
);
969 static HRESULT STDMETHODCALLTYPE
d3d10_device_CheckCounter(ID3D10Device
*iface
,
970 const D3D10_COUNTER_DESC
*desc
, D3D10_COUNTER_TYPE
*type
, UINT
*active_counters
, LPSTR name
,
971 UINT
*name_length
, LPSTR units
, UINT
*units_length
, LPSTR description
, UINT
*description_length
)
973 FIXME("iface %p, desc %p, type %p, active_counters %p, name %p, name_length %p,\n"
974 "\tunits %p, units_length %p, description %p, description_length %p stub!\n",
975 iface
, desc
, type
, active_counters
, name
, name_length
,
976 units
, units_length
, description
, description_length
);
981 static UINT STDMETHODCALLTYPE
d3d10_device_GetCreationFlags(ID3D10Device
*iface
)
983 FIXME("iface %p stub!\n", iface
);
988 static HRESULT STDMETHODCALLTYPE
d3d10_device_OpenSharedResource(ID3D10Device
*iface
,
989 HANDLE resource_handle
, REFIID guid
, void **resource
)
991 FIXME("iface %p, resource_handle %p, guid %s, resource %p stub!\n",
992 iface
, resource_handle
, debugstr_guid(guid
), resource
);
997 static void STDMETHODCALLTYPE
d3d10_device_SetTextFilterSize(ID3D10Device
*iface
, UINT width
, UINT height
)
999 FIXME("iface %p, width %u, height %u stub!\n", iface
, width
, height
);
1002 static void STDMETHODCALLTYPE
d3d10_device_GetTextFilterSize(ID3D10Device
*iface
, UINT
*width
, UINT
*height
)
1004 FIXME("iface %p, width %p, height %p stub!\n", iface
, width
, height
);
1007 const struct ID3D10DeviceVtbl d3d10_device_vtbl
=
1009 /* IUnknown methods */
1010 d3d10_device_QueryInterface
,
1011 d3d10_device_AddRef
,
1012 d3d10_device_Release
,
1013 /* ID3D10Device methods */
1014 d3d10_device_VSSetConstantBuffers
,
1015 d3d10_device_PSSetShaderResources
,
1016 d3d10_device_PSSetShader
,
1017 d3d10_device_PSSetSamplers
,
1018 d3d10_device_VSSetShader
,
1019 d3d10_device_DrawIndexed
,
1021 d3d10_device_PSSetConstantBuffers
,
1022 d3d10_device_IASetInputLayout
,
1023 d3d10_device_IASetVertexBuffers
,
1024 d3d10_device_IASetIndexBuffer
,
1025 d3d10_device_DrawIndexedInstanced
,
1026 d3d10_device_DrawInstanced
,
1027 d3d10_device_GSSetConstantBuffers
,
1028 d3d10_device_GSSetShader
,
1029 d3d10_device_IASetPrimitiveTopology
,
1030 d3d10_device_VSSetShaderResources
,
1031 d3d10_device_VSSetSamplers
,
1032 d3d10_device_SetPredication
,
1033 d3d10_device_GSSetShaderResources
,
1034 d3d10_device_GSSetSamplers
,
1035 d3d10_device_OMSetRenderTargets
,
1036 d3d10_device_OMSetBlendState
,
1037 d3d10_device_OMSetDepthStencilState
,
1038 d3d10_device_SOSetTargets
,
1039 d3d10_device_DrawAuto
,
1040 d3d10_device_RSSetState
,
1041 d3d10_device_RSSetViewports
,
1042 d3d10_device_RSSetScissorRects
,
1043 d3d10_device_CopySubresourceRegion
,
1044 d3d10_device_CopyResource
,
1045 d3d10_device_UpdateSubresource
,
1046 d3d10_device_ClearRenderTargetView
,
1047 d3d10_device_ClearDepthStencilView
,
1048 d3d10_device_GenerateMips
,
1049 d3d10_device_ResolveSubresource
,
1050 d3d10_device_VSGetConstantBuffers
,
1051 d3d10_device_PSGetShaderResources
,
1052 d3d10_device_PSGetShader
,
1053 d3d10_device_PSGetSamplers
,
1054 d3d10_device_VSGetShader
,
1055 d3d10_device_PSGetConstantBuffers
,
1056 d3d10_device_IAGetInputLayout
,
1057 d3d10_device_IAGetVertexBuffers
,
1058 d3d10_device_IAGetIndexBuffer
,
1059 d3d10_device_GSGetConstantBuffers
,
1060 d3d10_device_GSGetShader
,
1061 d3d10_device_IAGetPrimitiveTopology
,
1062 d3d10_device_VSGetShaderResources
,
1063 d3d10_device_VSGetSamplers
,
1064 d3d10_device_GetPredication
,
1065 d3d10_device_GSGetShaderResources
,
1066 d3d10_device_GSGetSamplers
,
1067 d3d10_device_OMGetRenderTargets
,
1068 d3d10_device_OMGetBlendState
,
1069 d3d10_device_OMGetDepthStencilState
,
1070 d3d10_device_SOGetTargets
,
1071 d3d10_device_RSGetState
,
1072 d3d10_device_RSGetViewports
,
1073 d3d10_device_RSGetScissorRects
,
1074 d3d10_device_GetDeviceRemovedReason
,
1075 d3d10_device_SetExceptionMode
,
1076 d3d10_device_GetExceptionMode
,
1077 d3d10_device_GetPrivateData
,
1078 d3d10_device_SetPrivateData
,
1079 d3d10_device_SetPrivateDataInterface
,
1080 d3d10_device_ClearState
,
1082 d3d10_device_CreateBuffer
,
1083 d3d10_device_CreateTexture1D
,
1084 d3d10_device_CreateTexture2D
,
1085 d3d10_device_CreateTexture3D
,
1086 d3d10_device_CreateShaderResourceView
,
1087 d3d10_device_CreateRenderTargetView
,
1088 d3d10_device_CreateDepthStencilView
,
1089 d3d10_device_CreateInputLayout
,
1090 d3d10_device_CreateVertexShader
,
1091 d3d10_device_CreateGeometryShader
,
1092 d3d10_device_CreateGeometryShaderWithStreamOutput
,
1093 d3d10_device_CreatePixelShader
,
1094 d3d10_device_CreateBlendState
,
1095 d3d10_device_CreateDepthStencilState
,
1096 d3d10_device_CreateRasterizerState
,
1097 d3d10_device_CreateSamplerState
,
1098 d3d10_device_CreateQuery
,
1099 d3d10_device_CreatePredicate
,
1100 d3d10_device_CreateCounter
,
1101 d3d10_device_CheckFormatSupport
,
1102 d3d10_device_CheckMultisampleQualityLevels
,
1103 d3d10_device_CheckCounterInfo
,
1104 d3d10_device_CheckCounter
,
1105 d3d10_device_GetCreationFlags
,
1106 d3d10_device_OpenSharedResource
,
1107 d3d10_device_SetTextFilterSize
,
1108 d3d10_device_GetTextFilterSize
,
1111 const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl
=
1113 /* IUnknown methods */
1114 d3d10_device_inner_QueryInterface
,
1115 d3d10_device_inner_AddRef
,
1116 d3d10_device_inner_Release
,
1119 /* IWineD3DDeviceParent IUnknown methods */
1121 static inline struct d3d10_device
*device_from_device_parent(IWineD3DDeviceParent
*iface
)
1123 return (struct d3d10_device
*)((char*)iface
- FIELD_OFFSET(struct d3d10_device
, device_parent_vtbl
));
1126 static HRESULT STDMETHODCALLTYPE
device_parent_QueryInterface(IWineD3DDeviceParent
*iface
, REFIID riid
, void **object
)
1128 struct d3d10_device
*This
= device_from_device_parent(iface
);
1129 return d3d10_device_QueryInterface((ID3D10Device
*)This
, riid
, object
);
1132 static ULONG STDMETHODCALLTYPE
device_parent_AddRef(IWineD3DDeviceParent
*iface
)
1134 struct d3d10_device
*This
= device_from_device_parent(iface
);
1135 return d3d10_device_AddRef((ID3D10Device
*)This
);
1138 static ULONG STDMETHODCALLTYPE
device_parent_Release(IWineD3DDeviceParent
*iface
)
1140 struct d3d10_device
*This
= device_from_device_parent(iface
);
1141 return d3d10_device_Release((ID3D10Device
*)This
);
1144 /* IWineD3DDeviceParent methods */
1146 static HRESULT STDMETHODCALLTYPE
device_parent_CreateSurface(IWineD3DDeviceParent
*iface
,
1147 IUnknown
*superior
, UINT width
, UINT height
, WINED3DFORMAT format
, DWORD usage
,
1148 WINED3DPOOL pool
, UINT level
, WINED3DCUBEMAP_FACES face
, IWineD3DSurface
**surface
)
1150 struct d3d10_device
*This
= device_from_device_parent(iface
);
1151 struct d3d10_texture2d
*texture
;
1152 D3D10_TEXTURE2D_DESC desc
;
1155 FIXME("iface %p, superior %p, width %u, height %u, format %#x, usage %#x,\n"
1156 "\tpool %#x, level %u, face %u, surface %p partial stub!\n",
1157 iface
, superior
, width
, height
, format
, usage
, pool
, level
, face
, surface
);
1159 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
1162 desc
.Height
= height
;
1165 desc
.Format
= format
;
1166 desc
.SampleDesc
.Count
= 1;
1167 desc
.SampleDesc
.Quality
= 0;
1170 desc
.CPUAccessFlags
= 0;
1173 hr
= d3d10_device_CreateTexture2D((ID3D10Device
*)This
, &desc
, NULL
, (ID3D10Texture2D
**)&texture
);
1176 ERR("CreateTexture2D failed, returning %#x\n", hr
);
1180 *surface
= texture
->wined3d_surface
;
1185 static HRESULT STDMETHODCALLTYPE
device_parent_CreateRenderTarget(IWineD3DDeviceParent
*iface
,
1186 IUnknown
*superior
, UINT width
, UINT height
, WINED3DFORMAT format
, WINED3DMULTISAMPLE_TYPE multisample_type
,
1187 DWORD multisample_quality
, BOOL lockable
, IWineD3DSurface
**surface
)
1189 struct d3d10_device
*This
= device_from_device_parent(iface
);
1190 struct d3d10_texture2d
*texture
;
1191 D3D10_TEXTURE2D_DESC desc
;
1194 FIXME("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
1195 "\tmultisample_quality %u, lockable %u, surface %p stub!\n",
1196 iface
, superior
, width
, height
, format
, multisample_type
, multisample_quality
, lockable
, surface
);
1198 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
1201 desc
.Height
= height
;
1204 desc
.Format
= format
;
1205 desc
.SampleDesc
.Count
= multisample_type
;
1206 desc
.SampleDesc
.Quality
= multisample_quality
;
1207 desc
.Usage
= D3D10_USAGE_DEFAULT
;
1208 desc
.BindFlags
= D3D10_BIND_RENDER_TARGET
;
1209 desc
.CPUAccessFlags
= 0;
1212 hr
= d3d10_device_CreateTexture2D((ID3D10Device
*)This
, &desc
, NULL
, (ID3D10Texture2D
**)&texture
);
1215 ERR("CreateTexture2D failed, returning %#x\n", hr
);
1219 *surface
= texture
->wined3d_surface
;
1224 static HRESULT STDMETHODCALLTYPE
device_parent_CreateDepthStencilSurface(IWineD3DDeviceParent
*iface
,
1225 IUnknown
*superior
, UINT width
, UINT height
, WINED3DFORMAT format
, WINED3DMULTISAMPLE_TYPE multisample_type
,
1226 DWORD multisample_quality
, BOOL discard
, IWineD3DSurface
**surface
)
1228 struct d3d10_device
*This
= device_from_device_parent(iface
);
1229 struct d3d10_texture2d
*texture
;
1230 D3D10_TEXTURE2D_DESC desc
;
1233 FIXME("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
1234 "\tmultisample_quality %u, discard %u, surface %p stub!\n",
1235 iface
, superior
, width
, height
, format
, multisample_type
, multisample_quality
, discard
, surface
);
1237 FIXME("Implement DXGI<->wined3d format and usage conversion\n");
1240 desc
.Height
= height
;
1243 desc
.Format
= format
;
1244 desc
.SampleDesc
.Count
= multisample_type
;
1245 desc
.SampleDesc
.Quality
= multisample_quality
;
1246 desc
.Usage
= D3D10_USAGE_DEFAULT
;
1247 desc
.BindFlags
= D3D10_BIND_RENDER_TARGET
;
1248 desc
.CPUAccessFlags
= 0;
1251 hr
= d3d10_device_CreateTexture2D((ID3D10Device
*)This
, &desc
, NULL
, (ID3D10Texture2D
**)&texture
);
1254 ERR("CreateTexture2D failed, returning %#x\n", hr
);
1258 *surface
= texture
->wined3d_surface
;
1263 static HRESULT STDMETHODCALLTYPE
device_parent_CreateVolume(IWineD3DDeviceParent
*iface
,
1264 IUnknown
*superior
, UINT width
, UINT height
, UINT depth
, WINED3DFORMAT format
,
1265 WINED3DPOOL pool
, DWORD usage
, IWineD3DVolume
**volume
)
1267 FIXME("iface %p, superior %p, width %u, height %u, depth %u, format %#x, pool %#x, usage %#x, volume %p stub!\n",
1268 iface
, superior
, width
, height
, depth
, format
, pool
, usage
, volume
);
1273 static HRESULT STDMETHODCALLTYPE
device_parent_CreateSwapChain(IWineD3DDeviceParent
*iface
,
1274 WINED3DPRESENT_PARAMETERS
*present_parameters
, IWineD3DSwapChain
**swapchain
)
1276 FIXME("iface %p, present_parameters %p, swapchain %p stub!\n", iface
, present_parameters
, swapchain
);
1282 const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl
=
1284 /* IUnknown methods */
1285 device_parent_QueryInterface
,
1286 device_parent_AddRef
,
1287 device_parent_Release
,
1288 /* IWineD3DDeviceParent methods */
1289 device_parent_CreateSurface
,
1290 device_parent_CreateRenderTarget
,
1291 device_parent_CreateDepthStencilSurface
,
1292 device_parent_CreateVolume
,
1293 device_parent_CreateSwapChain
,