2 * Copyright 2008-2009 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/port.h"
23 #include "d3d10core_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10core
);
27 /* Inner IUnknown methods */
29 static inline struct d3d10_device
*d3d10_device_from_inner_unknown(IUnknown
*iface
)
31 return (struct d3d10_device
*)((char*)iface
- FIELD_OFFSET(struct d3d10_device
, inner_unknown_vtbl
));
34 static HRESULT STDMETHODCALLTYPE
d3d10_device_inner_QueryInterface(IUnknown
*iface
, REFIID riid
, void **object
)
36 struct d3d10_device
*This
= d3d10_device_from_inner_unknown(iface
);
38 TRACE("iface %p, riid %s, object %p\n", iface
, debugstr_guid(riid
), object
);
40 if (IsEqualGUID(riid
, &IID_IUnknown
)
41 || IsEqualGUID(riid
, &IID_ID3D10Device
))
43 IUnknown_AddRef((IUnknown
*)This
);
48 if (IsEqualGUID(riid
, &IID_IWineD3DDeviceParent
))
50 IUnknown_AddRef((IUnknown
*)&This
->device_parent_vtbl
);
51 *object
= &This
->device_parent_vtbl
;
55 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid
));
61 static ULONG STDMETHODCALLTYPE
d3d10_device_inner_AddRef(IUnknown
*iface
)
63 struct d3d10_device
*This
= d3d10_device_from_inner_unknown(iface
);
64 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
66 TRACE("%p increasing refcount to %u\n", This
, refcount
);
71 static ULONG STDMETHODCALLTYPE
d3d10_device_inner_Release(IUnknown
*iface
)
73 struct d3d10_device
*This
= d3d10_device_from_inner_unknown(iface
);
74 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
76 TRACE("%p decreasing refcount to %u\n", This
, refcount
);
80 if (This
->wined3d_device
) IWineD3DDevice_Release(This
->wined3d_device
);
86 /* IUnknown methods */
88 static HRESULT STDMETHODCALLTYPE
d3d10_device_QueryInterface(ID3D10Device
*iface
, REFIID riid
, void **object
)
90 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
91 TRACE("Forwarding to outer IUnknown\n");
92 return IUnknown_QueryInterface(This
->outer_unknown
, riid
, object
);
95 static ULONG STDMETHODCALLTYPE
d3d10_device_AddRef(ID3D10Device
*iface
)
97 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
98 TRACE("Forwarding to outer IUnknown\n");
99 return IUnknown_AddRef(This
->outer_unknown
);
102 static ULONG STDMETHODCALLTYPE
d3d10_device_Release(ID3D10Device
*iface
)
104 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
105 TRACE("Forwarding to outer IUnknown\n");
106 return IUnknown_Release(This
->outer_unknown
);
109 /* ID3D10Device methods */
111 static void STDMETHODCALLTYPE
d3d10_device_VSSetConstantBuffers(ID3D10Device
*iface
,
112 UINT start_slot
, UINT buffer_count
, ID3D10Buffer
*const *buffers
)
114 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
115 iface
, start_slot
, buffer_count
, buffers
);
118 static void STDMETHODCALLTYPE
d3d10_device_PSSetShaderResources(ID3D10Device
*iface
,
119 UINT start_slot
, UINT view_count
, ID3D10ShaderResourceView
*const *views
)
121 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
122 iface
, start_slot
, view_count
, views
);
125 static void STDMETHODCALLTYPE
d3d10_device_PSSetShader(ID3D10Device
*iface
, ID3D10PixelShader
*shader
)
127 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
128 struct d3d10_pixel_shader
*ps
= (struct d3d10_pixel_shader
*)shader
;
130 TRACE("iface %p, shader %p\n", iface
, shader
);
132 IWineD3DDevice_SetPixelShader(This
->wined3d_device
, ps
? ps
->wined3d_shader
: NULL
);
135 static void STDMETHODCALLTYPE
d3d10_device_PSSetSamplers(ID3D10Device
*iface
,
136 UINT start_slot
, UINT sampler_count
, ID3D10SamplerState
*const *samplers
)
138 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
139 iface
, start_slot
, sampler_count
, samplers
);
142 static void STDMETHODCALLTYPE
d3d10_device_VSSetShader(ID3D10Device
*iface
, ID3D10VertexShader
*shader
)
144 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
145 struct d3d10_vertex_shader
*vs
= (struct d3d10_vertex_shader
*)shader
;
147 TRACE("iface %p, shader %p\n", iface
, shader
);
149 IWineD3DDevice_SetVertexShader(This
->wined3d_device
, vs
? vs
->wined3d_shader
: NULL
);
152 static void STDMETHODCALLTYPE
d3d10_device_DrawIndexed(ID3D10Device
*iface
,
153 UINT index_count
, UINT start_index_location
, INT base_vertex_location
)
155 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
157 TRACE("iface %p, index_count %u, start_index_location %u, base_vertex_location %d.\n",
158 iface
, index_count
, start_index_location
, base_vertex_location
);
160 IWineD3DDevice_SetBaseVertexIndex(This
->wined3d_device
, base_vertex_location
);
161 IWineD3DDevice_DrawIndexedPrimitive(This
->wined3d_device
, start_index_location
, index_count
);
164 static void STDMETHODCALLTYPE
d3d10_device_Draw(ID3D10Device
*iface
,
165 UINT vertex_count
, UINT start_vertex_location
)
167 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
169 TRACE("iface %p, vertex_count %u, start_vertex_location %u\n",
170 iface
, vertex_count
, start_vertex_location
);
172 IWineD3DDevice_DrawPrimitive(This
->wined3d_device
, start_vertex_location
, vertex_count
);
175 static void STDMETHODCALLTYPE
d3d10_device_PSSetConstantBuffers(ID3D10Device
*iface
,
176 UINT start_slot
, UINT buffer_count
, ID3D10Buffer
*const *buffers
)
178 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
179 iface
, start_slot
, buffer_count
, buffers
);
182 static void STDMETHODCALLTYPE
d3d10_device_IASetInputLayout(ID3D10Device
*iface
, ID3D10InputLayout
*input_layout
)
184 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
186 TRACE("iface %p, input_layout %p\n", iface
, input_layout
);
188 IWineD3DDevice_SetVertexDeclaration(This
->wined3d_device
,
189 input_layout
? ((struct d3d10_input_layout
*)input_layout
)->wined3d_decl
: NULL
);
192 static void STDMETHODCALLTYPE
d3d10_device_IASetVertexBuffers(ID3D10Device
*iface
,
193 UINT start_slot
, UINT buffer_count
, ID3D10Buffer
*const *buffers
,
194 const UINT
*strides
, const UINT
*offsets
)
196 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
199 TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p\n",
200 iface
, start_slot
, buffer_count
, buffers
, strides
, offsets
);
202 for (i
= 0; i
< buffer_count
; ++i
)
204 IWineD3DDevice_SetStreamSource(This
->wined3d_device
, start_slot
,
205 buffers
[i
] ? ((struct d3d10_buffer
*)buffers
[i
])->wined3d_buffer
: NULL
,
206 offsets
[i
], strides
[i
]);
210 static void STDMETHODCALLTYPE
d3d10_device_IASetIndexBuffer(ID3D10Device
*iface
,
211 ID3D10Buffer
*buffer
, DXGI_FORMAT format
, UINT offset
)
213 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
215 TRACE("iface %p, buffer %p, format %s, offset %u.\n",
216 iface
, buffer
, debug_dxgi_format(format
), offset
);
218 IWineD3DDevice_SetIndexBuffer(This
->wined3d_device
, buffer
? ((struct d3d10_buffer
*)buffer
)->wined3d_buffer
: NULL
,
219 wined3dformat_from_dxgi_format(format
));
220 if (offset
) FIXME("offset %u not supported.\n", offset
);
223 static void STDMETHODCALLTYPE
d3d10_device_DrawIndexedInstanced(ID3D10Device
*iface
,
224 UINT instance_index_count
, UINT instance_count
, UINT start_index_location
,
225 INT base_vertex_location
, UINT start_instance_location
)
227 FIXME("iface %p, instance_index_count %u, instance_count %u, start_index_location %u,\n"
228 "\tbase_vertex_location %d, start_instance_location %u stub!\n",
229 iface
, instance_index_count
, instance_count
, start_index_location
,
230 base_vertex_location
, start_instance_location
);
233 static void STDMETHODCALLTYPE
d3d10_device_DrawInstanced(ID3D10Device
*iface
,
234 UINT instance_vertex_count
, UINT instance_count
,
235 UINT start_vertex_location
, UINT start_instance_location
)
237 FIXME("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u,\n"
238 "\tstart_instance_location %u stub!\n", iface
, instance_vertex_count
, instance_count
,
239 start_vertex_location
, start_instance_location
);
242 static void STDMETHODCALLTYPE
d3d10_device_GSSetConstantBuffers(ID3D10Device
*iface
,
243 UINT start_slot
, UINT buffer_count
, ID3D10Buffer
*const *buffers
)
245 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
246 iface
, start_slot
, buffer_count
, buffers
);
249 static void STDMETHODCALLTYPE
d3d10_device_GSSetShader(ID3D10Device
*iface
, ID3D10GeometryShader
*shader
)
251 if (shader
) FIXME("iface %p, shader %p stub!\n", iface
, shader
);
252 else WARN("iface %p, shader %p stub!\n", iface
, shader
);
255 static void STDMETHODCALLTYPE
d3d10_device_IASetPrimitiveTopology(ID3D10Device
*iface
, D3D10_PRIMITIVE_TOPOLOGY topology
)
257 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
259 TRACE("iface %p, topology %s\n", iface
, debug_d3d10_primitive_topology(topology
));
261 IWineD3DDevice_SetPrimitiveType(This
->wined3d_device
, (WINED3DPRIMITIVETYPE
)topology
);
264 static void STDMETHODCALLTYPE
d3d10_device_VSSetShaderResources(ID3D10Device
*iface
,
265 UINT start_slot
, UINT view_count
, ID3D10ShaderResourceView
*const *views
)
267 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
268 iface
, start_slot
, view_count
, views
);
271 static void STDMETHODCALLTYPE
d3d10_device_VSSetSamplers(ID3D10Device
*iface
,
272 UINT start_slot
, UINT sampler_count
, ID3D10SamplerState
*const *samplers
)
274 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
275 iface
, start_slot
, sampler_count
, samplers
);
278 static void STDMETHODCALLTYPE
d3d10_device_SetPredication(ID3D10Device
*iface
, ID3D10Predicate
*predicate
, BOOL value
)
280 FIXME("iface %p, predicate %p, value %d stub!\n", iface
, predicate
, value
);
283 static void STDMETHODCALLTYPE
d3d10_device_GSSetShaderResources(ID3D10Device
*iface
,
284 UINT start_slot
, UINT view_count
, ID3D10ShaderResourceView
*const *views
)
286 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
287 iface
, start_slot
, view_count
, views
);
290 static void STDMETHODCALLTYPE
d3d10_device_GSSetSamplers(ID3D10Device
*iface
,
291 UINT start_slot
, UINT sampler_count
, ID3D10SamplerState
*const *samplers
)
293 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
294 iface
, start_slot
, sampler_count
, samplers
);
297 static void STDMETHODCALLTYPE
d3d10_device_OMSetRenderTargets(ID3D10Device
*iface
,
298 UINT render_target_view_count
, ID3D10RenderTargetView
*const *render_target_views
,
299 ID3D10DepthStencilView
*depth_stencil_view
)
301 FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p\n",
302 iface
, render_target_view_count
, render_target_views
, depth_stencil_view
);
305 static void STDMETHODCALLTYPE
d3d10_device_OMSetBlendState(ID3D10Device
*iface
,
306 ID3D10BlendState
*blend_state
, const FLOAT blend_factor
[4], UINT sample_mask
)
308 FIXME("iface %p, blend_state %p, blend_factor [%f %f %f %f], sample_mask 0x%08x stub!\n",
309 iface
, blend_state
, blend_factor
[0], blend_factor
[1], blend_factor
[2], blend_factor
[3], sample_mask
);
312 static void STDMETHODCALLTYPE
d3d10_device_OMSetDepthStencilState(ID3D10Device
*iface
,
313 ID3D10DepthStencilState
*depth_stencil_state
, UINT stencil_ref
)
315 FIXME("iface %p, depth_stencil_state %p, stencil_ref %u stub!\n",
316 iface
, depth_stencil_state
, stencil_ref
);
319 static void STDMETHODCALLTYPE
d3d10_device_SOSetTargets(ID3D10Device
*iface
,
320 UINT target_count
, ID3D10Buffer
*const *targets
, const UINT
*offsets
)
322 FIXME("iface %p, target_count %u, targets %p, offsets %p stub!\n", iface
, target_count
, targets
, offsets
);
325 static void STDMETHODCALLTYPE
d3d10_device_DrawAuto(ID3D10Device
*iface
)
327 FIXME("iface %p stub!\n", iface
);
330 static void STDMETHODCALLTYPE
d3d10_device_RSSetState(ID3D10Device
*iface
, ID3D10RasterizerState
*rasterizer_state
)
332 FIXME("iface %p, rasterizer_state %p stub!\n", iface
, rasterizer_state
);
335 static void STDMETHODCALLTYPE
d3d10_device_RSSetViewports(ID3D10Device
*iface
,
336 UINT viewport_count
, const D3D10_VIEWPORT
*viewports
)
338 FIXME("iface %p, viewport_count %u, viewports %p stub!\n", iface
, viewport_count
, viewports
);
341 static void STDMETHODCALLTYPE
d3d10_device_RSSetScissorRects(ID3D10Device
*iface
,
342 UINT rect_count
, const D3D10_RECT
*rects
)
344 FIXME("iface %p, rect_count %u, rects %p\n", iface
, rect_count
, rects
);
347 static void STDMETHODCALLTYPE
d3d10_device_CopySubresourceRegion(ID3D10Device
*iface
,
348 ID3D10Resource
*dst_resource
, UINT dst_subresource_idx
, UINT dst_x
, UINT dst_y
, UINT dst_z
,
349 ID3D10Resource
*src_resource
, UINT src_subresource_idx
, const D3D10_BOX
*src_box
)
351 FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, dst_x %u, dst_y %u, dst_z %u,\n"
352 "\tsrc_resource %p, src_subresource_idx %u, src_box %p stub!\n",
353 iface
, dst_resource
, dst_subresource_idx
, dst_x
, dst_y
, dst_z
,
354 src_resource
, src_subresource_idx
, src_box
);
357 static void STDMETHODCALLTYPE
d3d10_device_CopyResource(ID3D10Device
*iface
,
358 ID3D10Resource
*dst_resource
, ID3D10Resource
*src_resource
)
360 FIXME("iface %p, dst_resource %p, src_resource %p stub!\n", iface
, dst_resource
, src_resource
);
363 static void STDMETHODCALLTYPE
d3d10_device_UpdateSubresource(ID3D10Device
*iface
,
364 ID3D10Resource
*resource
, UINT subresource_idx
, const D3D10_BOX
*box
,
365 const void *data
, UINT row_pitch
, UINT depth_pitch
)
367 FIXME("iface %p, resource %p, subresource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u stub!\n",
368 iface
, resource
, subresource_idx
, box
, data
, row_pitch
, depth_pitch
);
371 static void STDMETHODCALLTYPE
d3d10_device_ClearRenderTargetView(ID3D10Device
*iface
,
372 ID3D10RenderTargetView
*render_target_view
, const FLOAT color_rgba
[4])
374 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
375 IWineD3DRendertargetView
*wined3d_view
= ((struct d3d10_rendertarget_view
*)render_target_view
)->wined3d_view
;
376 const WINED3DCOLORVALUE color
= {color_rgba
[0], color_rgba
[1], color_rgba
[2], color_rgba
[3]};
378 TRACE("iface %p, render_target_view %p, color_rgba [%f %f %f %f]\n",
379 iface
, render_target_view
, color_rgba
[0], color_rgba
[1], color_rgba
[2], color_rgba
[3]);
381 IWineD3DDevice_ClearRendertargetView(This
->wined3d_device
, wined3d_view
, &color
);
384 static void STDMETHODCALLTYPE
d3d10_device_ClearDepthStencilView(ID3D10Device
*iface
,
385 ID3D10DepthStencilView
*depth_stencil_view
, UINT flags
, FLOAT depth
, UINT8 stencil
)
387 FIXME("iface %p, depth_stencil_view %p, flags %#x, depth %f, stencil %u stub!\n",
388 iface
, depth_stencil_view
, flags
, depth
, stencil
);
391 static void STDMETHODCALLTYPE
d3d10_device_GenerateMips(ID3D10Device
*iface
, ID3D10ShaderResourceView
*shader_resource_view
)
393 FIXME("iface %p, shader_resource_view %p stub!\n", iface
, shader_resource_view
);
396 static void STDMETHODCALLTYPE
d3d10_device_ResolveSubresource(ID3D10Device
*iface
,
397 ID3D10Resource
*dst_resource
, UINT dst_subresource_idx
,
398 ID3D10Resource
*src_resource
, UINT src_subresource_idx
, DXGI_FORMAT format
)
400 FIXME("iface %p, dst_resource %p, dst_subresource_idx %u,\n"
401 "\tsrc_resource %p, src_subresource_idx %u, format %s stub!\n",
402 iface
, dst_resource
, dst_subresource_idx
,
403 src_resource
, src_subresource_idx
, debug_dxgi_format(format
));
406 static void STDMETHODCALLTYPE
d3d10_device_VSGetConstantBuffers(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_PSGetShaderResources(ID3D10Device
*iface
,
414 UINT start_slot
, UINT view_count
, ID3D10ShaderResourceView
**views
)
416 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
417 iface
, start_slot
, view_count
, views
);
420 static void STDMETHODCALLTYPE
d3d10_device_PSGetShader(ID3D10Device
*iface
, ID3D10PixelShader
**shader
)
422 FIXME("iface %p, shader %p stub!\n", iface
, shader
);
425 static void STDMETHODCALLTYPE
d3d10_device_PSGetSamplers(ID3D10Device
*iface
,
426 UINT start_slot
, UINT sampler_count
, ID3D10SamplerState
**samplers
)
428 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
429 iface
, start_slot
, sampler_count
, samplers
);
432 static void STDMETHODCALLTYPE
d3d10_device_VSGetShader(ID3D10Device
*iface
, ID3D10VertexShader
**shader
)
434 FIXME("iface %p, shader %p stub!\n", iface
, shader
);
437 static void STDMETHODCALLTYPE
d3d10_device_PSGetConstantBuffers(ID3D10Device
*iface
,
438 UINT start_slot
, UINT buffer_count
, ID3D10Buffer
**buffers
)
440 FIXME("iface %p, start_slot %u, buffer_count %u, buffer %p stub!\n",
441 iface
, start_slot
, buffer_count
, buffers
);
444 static void STDMETHODCALLTYPE
d3d10_device_IAGetInputLayout(ID3D10Device
*iface
, ID3D10InputLayout
**input_layout
)
446 FIXME("iface %p, input_layout %p stub!\n", iface
, input_layout
);
449 static void STDMETHODCALLTYPE
d3d10_device_IAGetVertexBuffers(ID3D10Device
*iface
,
450 UINT start_slot
, UINT buffer_count
, ID3D10Buffer
**buffers
, UINT
*strides
, UINT
*offsets
)
452 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n",
453 iface
, start_slot
, buffer_count
, buffers
, strides
, offsets
);
456 static void STDMETHODCALLTYPE
d3d10_device_IAGetIndexBuffer(ID3D10Device
*iface
,
457 ID3D10Buffer
**buffer
, DXGI_FORMAT
*format
, UINT
*offset
)
459 FIXME("iface %p, buffer %p, format %p, offset %p stub!\n", iface
, buffer
, format
, offset
);
462 static void STDMETHODCALLTYPE
d3d10_device_GSGetConstantBuffers(ID3D10Device
*iface
,
463 UINT start_slot
, UINT buffer_count
, ID3D10Buffer
**buffers
)
465 FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
466 iface
, start_slot
, buffer_count
, buffers
);
469 static void STDMETHODCALLTYPE
d3d10_device_GSGetShader(ID3D10Device
*iface
, ID3D10GeometryShader
**shader
)
471 FIXME("iface %p, shader %p stub!\n", iface
, shader
);
474 static void STDMETHODCALLTYPE
d3d10_device_IAGetPrimitiveTopology(ID3D10Device
*iface
, D3D10_PRIMITIVE_TOPOLOGY
*topology
)
476 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
478 TRACE("iface %p, topology %p\n", iface
, topology
);
480 IWineD3DDevice_GetPrimitiveType(This
->wined3d_device
, (WINED3DPRIMITIVETYPE
*)topology
);
483 static void STDMETHODCALLTYPE
d3d10_device_VSGetShaderResources(ID3D10Device
*iface
,
484 UINT start_slot
, UINT view_count
, ID3D10ShaderResourceView
**views
)
486 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
487 iface
, start_slot
, view_count
, views
);
490 static void STDMETHODCALLTYPE
d3d10_device_VSGetSamplers(ID3D10Device
*iface
,
491 UINT start_slot
, UINT sampler_count
, ID3D10SamplerState
**samplers
)
493 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
494 iface
, start_slot
, sampler_count
, samplers
);
497 static void STDMETHODCALLTYPE
d3d10_device_GetPredication(ID3D10Device
*iface
,
498 ID3D10Predicate
**predicate
, BOOL
*value
)
500 FIXME("iface %p, predicate %p, value %p stub!\n", iface
, predicate
, value
);
503 static void STDMETHODCALLTYPE
d3d10_device_GSGetShaderResources(ID3D10Device
*iface
,
504 UINT start_slot
, UINT view_count
, ID3D10ShaderResourceView
**views
)
506 FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
507 iface
, start_slot
, view_count
, views
);
510 static void STDMETHODCALLTYPE
d3d10_device_GSGetSamplers(ID3D10Device
*iface
,
511 UINT start_slot
, UINT sampler_count
, ID3D10SamplerState
**samplers
)
513 FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
514 iface
, start_slot
, sampler_count
, samplers
);
517 static void STDMETHODCALLTYPE
d3d10_device_OMGetRenderTargets(ID3D10Device
*iface
,
518 UINT view_count
, ID3D10RenderTargetView
**render_target_views
, ID3D10DepthStencilView
**depth_stencil_view
)
520 FIXME("iface %p, view_count %u, render_target_views %p, depth_stencil_view %p stub!\n",
521 iface
, view_count
, render_target_views
, depth_stencil_view
);
524 static void STDMETHODCALLTYPE
d3d10_device_OMGetBlendState(ID3D10Device
*iface
,
525 ID3D10BlendState
**blend_state
, FLOAT blend_factor
[4], UINT
*sample_mask
)
527 FIXME("iface %p, blend_state %p, blend_factor %p, sample_mask %p stub!\n",
528 iface
, blend_state
, blend_factor
, sample_mask
);
531 static void STDMETHODCALLTYPE
d3d10_device_OMGetDepthStencilState(ID3D10Device
*iface
,
532 ID3D10DepthStencilState
**depth_stencil_state
, UINT
*stencil_ref
)
534 FIXME("iface %p, depth_stencil_state %p, stencil_ref %p stub!\n",
535 iface
, depth_stencil_state
, stencil_ref
);
538 static void STDMETHODCALLTYPE
d3d10_device_SOGetTargets(ID3D10Device
*iface
,
539 UINT buffer_count
, ID3D10Buffer
**buffers
, UINT
*offsets
)
541 FIXME("iface %p, buffer_count %u, buffers %p, offsets %p stub!\n",
542 iface
, buffer_count
, buffers
, offsets
);
545 static void STDMETHODCALLTYPE
d3d10_device_RSGetState(ID3D10Device
*iface
, ID3D10RasterizerState
**rasterizer_state
)
547 FIXME("iface %p, rasterizer_state %p stub!\n", iface
, rasterizer_state
);
550 static void STDMETHODCALLTYPE
d3d10_device_RSGetViewports(ID3D10Device
*iface
,
551 UINT
*viewport_count
, D3D10_VIEWPORT
*viewports
)
553 FIXME("iface %p, viewport_count %p, viewports %p stub!\n", iface
, viewport_count
, viewports
);
556 static void STDMETHODCALLTYPE
d3d10_device_RSGetScissorRects(ID3D10Device
*iface
, UINT
*rect_count
, D3D10_RECT
*rects
)
558 FIXME("iface %p, rect_count %p, rects %p stub!\n", iface
, rect_count
, rects
);
561 static HRESULT STDMETHODCALLTYPE
d3d10_device_GetDeviceRemovedReason(ID3D10Device
*iface
)
563 FIXME("iface %p stub!\n", iface
);
568 static HRESULT STDMETHODCALLTYPE
d3d10_device_SetExceptionMode(ID3D10Device
*iface
, UINT flags
)
570 FIXME("iface %p, flags %#x stub!\n", iface
, flags
);
575 static UINT STDMETHODCALLTYPE
d3d10_device_GetExceptionMode(ID3D10Device
*iface
)
577 FIXME("iface %p stub!\n", iface
);
582 static HRESULT STDMETHODCALLTYPE
d3d10_device_GetPrivateData(ID3D10Device
*iface
,
583 REFGUID guid
, UINT
*data_size
, void *data
)
585 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
586 iface
, debugstr_guid(guid
), data_size
, data
);
591 static HRESULT STDMETHODCALLTYPE
d3d10_device_SetPrivateData(ID3D10Device
*iface
,
592 REFGUID guid
, UINT data_size
, const void *data
)
594 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
595 iface
, debugstr_guid(guid
), data_size
, data
);
600 static HRESULT STDMETHODCALLTYPE
d3d10_device_SetPrivateDataInterface(ID3D10Device
*iface
,
601 REFGUID guid
, const IUnknown
*data
)
603 FIXME("iface %p, guid %s, data %p stub!\n", iface
, debugstr_guid(guid
), data
);
608 static void STDMETHODCALLTYPE
d3d10_device_ClearState(ID3D10Device
*iface
)
610 FIXME("iface %p stub!\n", iface
);
613 static void STDMETHODCALLTYPE
d3d10_device_Flush(ID3D10Device
*iface
)
615 FIXME("iface %p stub!\n", iface
);
618 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateBuffer(ID3D10Device
*iface
,
619 const D3D10_BUFFER_DESC
*desc
, const D3D10_SUBRESOURCE_DATA
*data
, ID3D10Buffer
**buffer
)
621 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
622 struct d3d10_buffer
*object
;
625 FIXME("iface %p, desc %p, data %p, buffer %p partial stub!\n", iface
, desc
, data
, buffer
);
627 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
630 ERR("Failed to allocate D3D10 buffer object memory\n");
631 return E_OUTOFMEMORY
;
634 hr
= d3d10_buffer_init(object
, This
, desc
, data
);
637 WARN("Failed to initialize buffer, hr %#x.\n", hr
);
638 HeapFree(GetProcessHeap(), 0, object
);
642 *buffer
= (ID3D10Buffer
*)object
;
644 TRACE("Created ID3D10Buffer %p\n", object
);
649 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateTexture1D(ID3D10Device
*iface
,
650 const D3D10_TEXTURE1D_DESC
*desc
, const D3D10_SUBRESOURCE_DATA
*data
, ID3D10Texture1D
**texture
)
652 FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface
, desc
, data
, texture
);
657 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateTexture2D(ID3D10Device
*iface
,
658 const D3D10_TEXTURE2D_DESC
*desc
, const D3D10_SUBRESOURCE_DATA
*data
, ID3D10Texture2D
**texture
)
660 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
661 struct d3d10_texture2d
*object
;
664 FIXME("iface %p, desc %p, data %p, texture %p partial stub!\n", iface
, desc
, data
, texture
);
666 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
669 ERR("Failed to allocate D3D10 texture2d object memory\n");
670 return E_OUTOFMEMORY
;
673 hr
= d3d10_texture2d_init(object
, This
, desc
);
676 WARN("Failed to initialize texture, hr %#x.\n", hr
);
677 HeapFree(GetProcessHeap(), 0, object
);
681 *texture
= (ID3D10Texture2D
*)object
;
683 TRACE("Created ID3D10Texture2D %p\n", object
);
688 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateTexture3D(ID3D10Device
*iface
,
689 const D3D10_TEXTURE3D_DESC
*desc
, const D3D10_SUBRESOURCE_DATA
*data
, ID3D10Texture3D
**texture
)
691 FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface
, desc
, data
, texture
);
696 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateShaderResourceView(ID3D10Device
*iface
,
697 ID3D10Resource
*resource
, const D3D10_SHADER_RESOURCE_VIEW_DESC
*desc
, ID3D10ShaderResourceView
**view
)
699 struct d3d10_shader_resource_view
*object
;
702 TRACE("iface %p, resource %p, desc %p, view %p.\n", iface
, resource
, desc
, view
);
704 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
707 ERR("Failed to allocate D3D10 shader resource view object memory.\n");
708 return E_OUTOFMEMORY
;
711 hr
= d3d10_shader_resource_view_init(object
);
714 WARN("Failed to initialize shader resource view, hr %#x.\n", hr
);
715 HeapFree(GetProcessHeap(), 0, object
);
719 TRACE("Created shader resource view %p.\n", object
);
720 *view
= (ID3D10ShaderResourceView
*)object
;
725 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateRenderTargetView(ID3D10Device
*iface
,
726 ID3D10Resource
*resource
, const D3D10_RENDER_TARGET_VIEW_DESC
*desc
, ID3D10RenderTargetView
**view
)
728 struct d3d10_rendertarget_view
*object
;
731 TRACE("iface %p, resource %p, desc %p, view %p stub!\n", iface
, resource
, desc
, view
);
733 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
736 ERR("Failed to allocate D3D10 rendertarget view object memory\n");
737 return E_OUTOFMEMORY
;
740 hr
= d3d10_rendertarget_view_init(object
, (struct d3d10_device
*)iface
, resource
, desc
);
743 WARN("Failed to initialize rendertarget view, hr %#x.\n", hr
);
744 HeapFree(GetProcessHeap(), 0, object
);
748 TRACE("Created rendertarget view %p.\n", object
);
749 *view
= (ID3D10RenderTargetView
*)object
;
754 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateDepthStencilView(ID3D10Device
*iface
,
755 ID3D10Resource
*resource
, const D3D10_DEPTH_STENCIL_VIEW_DESC
*desc
, ID3D10DepthStencilView
**view
)
757 struct d3d10_depthstencil_view
*object
;
760 TRACE("iface %p, resource %p, desc %p, view %p.\n", iface
, resource
, desc
, view
);
762 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
765 ERR("Failed to allocate D3D10 depthstencil view object memory.\n");
766 return E_OUTOFMEMORY
;
769 hr
= d3d10_depthstencil_view_init(object
);
772 WARN("Failed to initialize depthstencil view, hr %#x.\n", hr
);
773 HeapFree(GetProcessHeap(), 0, object
);
777 TRACE("Created depthstencil view %p.\n", object
);
778 *view
= (ID3D10DepthStencilView
*)object
;
783 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateInputLayout(ID3D10Device
*iface
,
784 const D3D10_INPUT_ELEMENT_DESC
*element_descs
, UINT element_count
, const void *shader_byte_code
,
785 SIZE_T shader_byte_code_length
, ID3D10InputLayout
**input_layout
)
787 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
788 struct d3d10_input_layout
*object
;
791 TRACE("iface %p, element_descs %p, element_count %u, shader_byte_code %p,"
792 "\tshader_byte_code_length %lu, input_layout %p\n",
793 iface
, element_descs
, element_count
, shader_byte_code
,
794 shader_byte_code_length
, input_layout
);
796 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
799 ERR("Failed to allocate D3D10 input layout object memory\n");
800 return E_OUTOFMEMORY
;
803 hr
= d3d10_input_layout_init(object
, This
, element_descs
, element_count
,
804 shader_byte_code
, shader_byte_code_length
);
807 WARN("Failed to initialize input layout, hr %#x.\n", hr
);
808 HeapFree(GetProcessHeap(), 0, object
);
812 TRACE("Created input layout %p.\n", object
);
813 *input_layout
= (ID3D10InputLayout
*)object
;
818 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateVertexShader(ID3D10Device
*iface
,
819 const void *byte_code
, SIZE_T byte_code_length
, ID3D10VertexShader
**shader
)
821 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
822 struct d3d10_vertex_shader
*object
;
825 TRACE("iface %p, byte_code %p, byte_code_length %lu, shader %p\n",
826 iface
, byte_code
, byte_code_length
, shader
);
828 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
831 ERR("Failed to allocate D3D10 vertex shader object memory\n");
832 return E_OUTOFMEMORY
;
835 hr
= d3d10_vertex_shader_init(object
, This
, byte_code
, byte_code_length
);
838 WARN("Failed to initialize vertex shader, hr %#x.\n", hr
);
839 HeapFree(GetProcessHeap(), 0, object
);
843 TRACE("Created vertex shader %p.\n", object
);
844 *shader
= (ID3D10VertexShader
*)object
;
849 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateGeometryShader(ID3D10Device
*iface
,
850 const void *byte_code
, SIZE_T byte_code_length
, ID3D10GeometryShader
**shader
)
852 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
853 struct d3d10_geometry_shader
*object
;
856 FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
857 iface
, byte_code
, byte_code_length
, shader
);
859 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
862 ERR("Failed to allocate D3D10 geometry shader object memory\n");
863 return E_OUTOFMEMORY
;
866 hr
= d3d10_geometry_shader_init(object
, This
, byte_code
, byte_code_length
);
869 WARN("Failed to initialize geometry shader, hr %#x.\n", hr
);
870 HeapFree(GetProcessHeap(), 0, object
);
873 TRACE("Created geometry shader %p.\n", object
);
874 *shader
= (ID3D10GeometryShader
*)object
;
879 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateGeometryShaderWithStreamOutput(ID3D10Device
*iface
,
880 const void *byte_code
, SIZE_T byte_code_length
, const D3D10_SO_DECLARATION_ENTRY
*output_stream_decls
,
881 UINT output_stream_decl_count
, UINT output_stream_stride
, ID3D10GeometryShader
**shader
)
883 FIXME("iface %p, byte_code %p, byte_code_length %lu, output_stream_decls %p,\n"
884 "\toutput_stream_decl_count %u, output_stream_stride %u, shader %p stub!\n",
885 iface
, byte_code
, byte_code_length
, output_stream_decls
,
886 output_stream_decl_count
, output_stream_stride
, shader
);
891 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreatePixelShader(ID3D10Device
*iface
,
892 const void *byte_code
, SIZE_T byte_code_length
, ID3D10PixelShader
**shader
)
894 struct d3d10_device
*This
= (struct d3d10_device
*)iface
;
895 struct d3d10_pixel_shader
*object
;
898 TRACE("iface %p, byte_code %p, byte_code_length %lu, shader %p\n",
899 iface
, byte_code
, byte_code_length
, shader
);
901 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
904 ERR("Failed to allocate D3D10 pixel shader object memory\n");
905 return E_OUTOFMEMORY
;
908 hr
= d3d10_pixel_shader_init(object
, This
, byte_code
, byte_code_length
);
911 WARN("Failed to initialize pixel shader, hr %#x.\n", hr
);
912 HeapFree(GetProcessHeap(), 0, object
);
916 TRACE("Created pixel shader %p.\n", object
);
917 *shader
= (ID3D10PixelShader
*)object
;
922 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateBlendState(ID3D10Device
*iface
,
923 const D3D10_BLEND_DESC
*desc
, ID3D10BlendState
**blend_state
)
925 struct d3d10_blend_state
*object
;
928 TRACE("iface %p, desc %p, blend_state %p.\n", iface
, desc
, blend_state
);
930 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
933 ERR("Failed to allocate D3D10 blend state object memory.\n");
934 return E_OUTOFMEMORY
;
937 hr
= d3d10_blend_state_init(object
);
940 WARN("Failed to initialize blend state, hr %#x.\n", hr
);
941 HeapFree(GetProcessHeap(), 0, object
);
945 TRACE("Created blend state %p.\n", object
);
946 *blend_state
= (ID3D10BlendState
*)object
;
951 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateDepthStencilState(ID3D10Device
*iface
,
952 const D3D10_DEPTH_STENCIL_DESC
*desc
, ID3D10DepthStencilState
**depth_stencil_state
)
954 struct d3d10_depthstencil_state
*object
;
957 TRACE("iface %p, desc %p, depth_stencil_state %p.\n", iface
, desc
, depth_stencil_state
);
959 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
962 ERR("Failed to allocate D3D10 depthstencil state object memory.\n");
963 return E_OUTOFMEMORY
;
966 hr
= d3d10_depthstencil_state_init(object
);
969 WARN("Failed to initialize depthstencil state, hr %#x.\n", hr
);
970 HeapFree(GetProcessHeap(), 0, object
);
974 TRACE("Created depthstencil state %p.\n", object
);
975 *depth_stencil_state
= (ID3D10DepthStencilState
*)object
;
980 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateRasterizerState(ID3D10Device
*iface
,
981 const D3D10_RASTERIZER_DESC
*desc
, ID3D10RasterizerState
**rasterizer_state
)
983 struct d3d10_rasterizer_state
*object
;
986 TRACE("iface %p, desc %p, rasterizer_state %p.\n", iface
, desc
, rasterizer_state
);
988 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
991 ERR("Failed to allocate D3D10 rasterizer state object memory.\n");
992 return E_OUTOFMEMORY
;
995 hr
= d3d10_rasterizer_state_init(object
);
998 WARN("Failed to initialize rasterizer state, hr %#x.\n", hr
);
999 HeapFree(GetProcessHeap(), 0, object
);
1003 TRACE("Created rasterizer state %p.\n", object
);
1004 *rasterizer_state
= (ID3D10RasterizerState
*)object
;
1009 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateSamplerState(ID3D10Device
*iface
,
1010 const D3D10_SAMPLER_DESC
*desc
, ID3D10SamplerState
**sampler_state
)
1012 struct d3d10_sampler_state
*object
;
1015 FIXME("iface %p, desc %p, sampler_state %p.\n", iface
, desc
, sampler_state
);
1017 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
1020 ERR("Failed to allocate D3D10 sampler state object memory.\n");
1021 return E_OUTOFMEMORY
;
1024 hr
= d3d10_sampler_state_init(object
);
1027 WARN("Failed to initialize sampler state, hr %#x.\n", hr
);
1028 HeapFree(GetProcessHeap(), 0, object
);
1032 TRACE("Created sampler state %p.\n", object
);
1033 *sampler_state
= (ID3D10SamplerState
*)object
;
1038 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateQuery(ID3D10Device
*iface
,
1039 const D3D10_QUERY_DESC
*desc
, ID3D10Query
**query
)
1041 struct d3d10_query
*object
;
1044 TRACE("iface %p, desc %p, query %p.\n", iface
, desc
, query
);
1046 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
1049 ERR("Failed to allocate D3D10 query object memory.\n");
1050 return E_OUTOFMEMORY
;
1053 hr
= d3d10_query_init(object
);
1056 WARN("Failed to initialize query, hr %#x.\n", hr
);
1057 HeapFree(GetProcessHeap(), 0, object
);
1061 TRACE("Created query %p.\n", object
);
1062 *query
= (ID3D10Query
*)object
;
1067 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreatePredicate(ID3D10Device
*iface
,
1068 const D3D10_QUERY_DESC
*desc
, ID3D10Predicate
**predicate
)
1070 FIXME("iface %p, desc %p, predicate %p stub!\n", iface
, desc
, predicate
);
1075 static HRESULT STDMETHODCALLTYPE
d3d10_device_CreateCounter(ID3D10Device
*iface
,
1076 const D3D10_COUNTER_DESC
*desc
, ID3D10Counter
**counter
)
1078 FIXME("iface %p, desc %p, counter %p stub!\n", iface
, desc
, counter
);
1083 static HRESULT STDMETHODCALLTYPE
d3d10_device_CheckFormatSupport(ID3D10Device
*iface
,
1084 DXGI_FORMAT format
, UINT
*format_support
)
1086 FIXME("iface %p, format %s, format_support %p stub!\n",
1087 iface
, debug_dxgi_format(format
), format_support
);
1092 static HRESULT STDMETHODCALLTYPE
d3d10_device_CheckMultisampleQualityLevels(ID3D10Device
*iface
,
1093 DXGI_FORMAT format
, UINT sample_count
, UINT
*quality_level_count
)
1095 FIXME("iface %p, format %s, sample_count %u, quality_level_count %p stub!\n",
1096 iface
, debug_dxgi_format(format
), sample_count
, quality_level_count
);
1101 static void STDMETHODCALLTYPE
d3d10_device_CheckCounterInfo(ID3D10Device
*iface
, D3D10_COUNTER_INFO
*counter_info
)
1103 FIXME("iface %p, counter_info %p stub!\n", iface
, counter_info
);
1106 static HRESULT STDMETHODCALLTYPE
d3d10_device_CheckCounter(ID3D10Device
*iface
,
1107 const D3D10_COUNTER_DESC
*desc
, D3D10_COUNTER_TYPE
*type
, UINT
*active_counters
, LPSTR name
,
1108 UINT
*name_length
, LPSTR units
, UINT
*units_length
, LPSTR description
, UINT
*description_length
)
1110 FIXME("iface %p, desc %p, type %p, active_counters %p, name %p, name_length %p,\n"
1111 "\tunits %p, units_length %p, description %p, description_length %p stub!\n",
1112 iface
, desc
, type
, active_counters
, name
, name_length
,
1113 units
, units_length
, description
, description_length
);
1118 static UINT STDMETHODCALLTYPE
d3d10_device_GetCreationFlags(ID3D10Device
*iface
)
1120 FIXME("iface %p stub!\n", iface
);
1125 static HRESULT STDMETHODCALLTYPE
d3d10_device_OpenSharedResource(ID3D10Device
*iface
,
1126 HANDLE resource_handle
, REFIID guid
, void **resource
)
1128 FIXME("iface %p, resource_handle %p, guid %s, resource %p stub!\n",
1129 iface
, resource_handle
, debugstr_guid(guid
), resource
);
1134 static void STDMETHODCALLTYPE
d3d10_device_SetTextFilterSize(ID3D10Device
*iface
, UINT width
, UINT height
)
1136 FIXME("iface %p, width %u, height %u stub!\n", iface
, width
, height
);
1139 static void STDMETHODCALLTYPE
d3d10_device_GetTextFilterSize(ID3D10Device
*iface
, UINT
*width
, UINT
*height
)
1141 FIXME("iface %p, width %p, height %p stub!\n", iface
, width
, height
);
1144 static const struct ID3D10DeviceVtbl d3d10_device_vtbl
=
1146 /* IUnknown methods */
1147 d3d10_device_QueryInterface
,
1148 d3d10_device_AddRef
,
1149 d3d10_device_Release
,
1150 /* ID3D10Device methods */
1151 d3d10_device_VSSetConstantBuffers
,
1152 d3d10_device_PSSetShaderResources
,
1153 d3d10_device_PSSetShader
,
1154 d3d10_device_PSSetSamplers
,
1155 d3d10_device_VSSetShader
,
1156 d3d10_device_DrawIndexed
,
1158 d3d10_device_PSSetConstantBuffers
,
1159 d3d10_device_IASetInputLayout
,
1160 d3d10_device_IASetVertexBuffers
,
1161 d3d10_device_IASetIndexBuffer
,
1162 d3d10_device_DrawIndexedInstanced
,
1163 d3d10_device_DrawInstanced
,
1164 d3d10_device_GSSetConstantBuffers
,
1165 d3d10_device_GSSetShader
,
1166 d3d10_device_IASetPrimitiveTopology
,
1167 d3d10_device_VSSetShaderResources
,
1168 d3d10_device_VSSetSamplers
,
1169 d3d10_device_SetPredication
,
1170 d3d10_device_GSSetShaderResources
,
1171 d3d10_device_GSSetSamplers
,
1172 d3d10_device_OMSetRenderTargets
,
1173 d3d10_device_OMSetBlendState
,
1174 d3d10_device_OMSetDepthStencilState
,
1175 d3d10_device_SOSetTargets
,
1176 d3d10_device_DrawAuto
,
1177 d3d10_device_RSSetState
,
1178 d3d10_device_RSSetViewports
,
1179 d3d10_device_RSSetScissorRects
,
1180 d3d10_device_CopySubresourceRegion
,
1181 d3d10_device_CopyResource
,
1182 d3d10_device_UpdateSubresource
,
1183 d3d10_device_ClearRenderTargetView
,
1184 d3d10_device_ClearDepthStencilView
,
1185 d3d10_device_GenerateMips
,
1186 d3d10_device_ResolveSubresource
,
1187 d3d10_device_VSGetConstantBuffers
,
1188 d3d10_device_PSGetShaderResources
,
1189 d3d10_device_PSGetShader
,
1190 d3d10_device_PSGetSamplers
,
1191 d3d10_device_VSGetShader
,
1192 d3d10_device_PSGetConstantBuffers
,
1193 d3d10_device_IAGetInputLayout
,
1194 d3d10_device_IAGetVertexBuffers
,
1195 d3d10_device_IAGetIndexBuffer
,
1196 d3d10_device_GSGetConstantBuffers
,
1197 d3d10_device_GSGetShader
,
1198 d3d10_device_IAGetPrimitiveTopology
,
1199 d3d10_device_VSGetShaderResources
,
1200 d3d10_device_VSGetSamplers
,
1201 d3d10_device_GetPredication
,
1202 d3d10_device_GSGetShaderResources
,
1203 d3d10_device_GSGetSamplers
,
1204 d3d10_device_OMGetRenderTargets
,
1205 d3d10_device_OMGetBlendState
,
1206 d3d10_device_OMGetDepthStencilState
,
1207 d3d10_device_SOGetTargets
,
1208 d3d10_device_RSGetState
,
1209 d3d10_device_RSGetViewports
,
1210 d3d10_device_RSGetScissorRects
,
1211 d3d10_device_GetDeviceRemovedReason
,
1212 d3d10_device_SetExceptionMode
,
1213 d3d10_device_GetExceptionMode
,
1214 d3d10_device_GetPrivateData
,
1215 d3d10_device_SetPrivateData
,
1216 d3d10_device_SetPrivateDataInterface
,
1217 d3d10_device_ClearState
,
1219 d3d10_device_CreateBuffer
,
1220 d3d10_device_CreateTexture1D
,
1221 d3d10_device_CreateTexture2D
,
1222 d3d10_device_CreateTexture3D
,
1223 d3d10_device_CreateShaderResourceView
,
1224 d3d10_device_CreateRenderTargetView
,
1225 d3d10_device_CreateDepthStencilView
,
1226 d3d10_device_CreateInputLayout
,
1227 d3d10_device_CreateVertexShader
,
1228 d3d10_device_CreateGeometryShader
,
1229 d3d10_device_CreateGeometryShaderWithStreamOutput
,
1230 d3d10_device_CreatePixelShader
,
1231 d3d10_device_CreateBlendState
,
1232 d3d10_device_CreateDepthStencilState
,
1233 d3d10_device_CreateRasterizerState
,
1234 d3d10_device_CreateSamplerState
,
1235 d3d10_device_CreateQuery
,
1236 d3d10_device_CreatePredicate
,
1237 d3d10_device_CreateCounter
,
1238 d3d10_device_CheckFormatSupport
,
1239 d3d10_device_CheckMultisampleQualityLevels
,
1240 d3d10_device_CheckCounterInfo
,
1241 d3d10_device_CheckCounter
,
1242 d3d10_device_GetCreationFlags
,
1243 d3d10_device_OpenSharedResource
,
1244 d3d10_device_SetTextFilterSize
,
1245 d3d10_device_GetTextFilterSize
,
1248 static const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl
=
1250 /* IUnknown methods */
1251 d3d10_device_inner_QueryInterface
,
1252 d3d10_device_inner_AddRef
,
1253 d3d10_device_inner_Release
,
1256 /* IWineD3DDeviceParent IUnknown methods */
1258 static inline struct d3d10_device
*device_from_device_parent(IWineD3DDeviceParent
*iface
)
1260 return (struct d3d10_device
*)((char*)iface
- FIELD_OFFSET(struct d3d10_device
, device_parent_vtbl
));
1263 static HRESULT STDMETHODCALLTYPE
device_parent_QueryInterface(IWineD3DDeviceParent
*iface
, REFIID riid
, void **object
)
1265 struct d3d10_device
*This
= device_from_device_parent(iface
);
1266 return d3d10_device_QueryInterface((ID3D10Device
*)This
, riid
, object
);
1269 static ULONG STDMETHODCALLTYPE
device_parent_AddRef(IWineD3DDeviceParent
*iface
)
1271 struct d3d10_device
*This
= device_from_device_parent(iface
);
1272 return d3d10_device_AddRef((ID3D10Device
*)This
);
1275 static ULONG STDMETHODCALLTYPE
device_parent_Release(IWineD3DDeviceParent
*iface
)
1277 struct d3d10_device
*This
= device_from_device_parent(iface
);
1278 return d3d10_device_Release((ID3D10Device
*)This
);
1281 /* IWineD3DDeviceParent methods */
1283 static void STDMETHODCALLTYPE
device_parent_WineD3DDeviceCreated(IWineD3DDeviceParent
*iface
, IWineD3DDevice
*device
)
1285 struct d3d10_device
*This
= device_from_device_parent(iface
);
1287 TRACE("iface %p, device %p\n", iface
, device
);
1289 IWineD3DDevice_AddRef(device
);
1290 This
->wined3d_device
= device
;
1293 static HRESULT STDMETHODCALLTYPE
device_parent_CreateSurface(IWineD3DDeviceParent
*iface
,
1294 IUnknown
*superior
, UINT width
, UINT height
, enum wined3d_format_id format
, DWORD usage
,
1295 WINED3DPOOL pool
, UINT level
, WINED3DCUBEMAP_FACES face
, IWineD3DSurface
**surface
)
1297 struct d3d10_device
*This
= device_from_device_parent(iface
);
1298 struct d3d10_texture2d
*texture
;
1299 D3D10_TEXTURE2D_DESC desc
;
1302 FIXME("iface %p, superior %p, width %u, height %u, format %#x, usage %#x,\n"
1303 "\tpool %#x, level %u, face %u, surface %p partial stub!\n",
1304 iface
, superior
, width
, height
, format
, usage
, pool
, level
, face
, surface
);
1306 FIXME("Implement DXGI<->wined3d usage conversion\n");
1309 desc
.Height
= height
;
1312 desc
.Format
= dxgi_format_from_wined3dformat(format
);
1313 desc
.SampleDesc
.Count
= 1;
1314 desc
.SampleDesc
.Quality
= 0;
1317 desc
.CPUAccessFlags
= 0;
1320 hr
= d3d10_device_CreateTexture2D((ID3D10Device
*)This
, &desc
, NULL
, (ID3D10Texture2D
**)&texture
);
1323 ERR("CreateTexture2D failed, returning %#x\n", hr
);
1327 *surface
= texture
->wined3d_surface
;
1328 IWineD3DSurface_AddRef(*surface
);
1329 ID3D10Texture2D_Release((ID3D10Texture2D
*)texture
);
1334 static HRESULT STDMETHODCALLTYPE
device_parent_CreateRenderTarget(IWineD3DDeviceParent
*iface
,
1335 IUnknown
*superior
, UINT width
, UINT height
, enum wined3d_format_id format
,
1336 WINED3DMULTISAMPLE_TYPE multisample_type
, DWORD multisample_quality
, BOOL lockable
,
1337 IWineD3DSurface
**surface
)
1339 struct d3d10_device
*This
= device_from_device_parent(iface
);
1340 struct d3d10_texture2d
*texture
;
1341 D3D10_TEXTURE2D_DESC desc
;
1344 FIXME("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
1345 "\tmultisample_quality %u, lockable %u, surface %p partial stub!\n",
1346 iface
, superior
, width
, height
, format
, multisample_type
, multisample_quality
, lockable
, surface
);
1348 FIXME("Implement DXGI<->wined3d usage conversion\n");
1351 desc
.Height
= height
;
1354 desc
.Format
= dxgi_format_from_wined3dformat(format
);
1355 desc
.SampleDesc
.Count
= multisample_type
? multisample_type
: 1;
1356 desc
.SampleDesc
.Quality
= multisample_quality
;
1357 desc
.Usage
= D3D10_USAGE_DEFAULT
;
1358 desc
.BindFlags
= D3D10_BIND_RENDER_TARGET
;
1359 desc
.CPUAccessFlags
= 0;
1362 hr
= d3d10_device_CreateTexture2D((ID3D10Device
*)This
, &desc
, NULL
, (ID3D10Texture2D
**)&texture
);
1365 ERR("CreateTexture2D failed, returning %#x\n", hr
);
1369 *surface
= texture
->wined3d_surface
;
1370 IWineD3DSurface_AddRef(*surface
);
1371 ID3D10Texture2D_Release((ID3D10Texture2D
*)texture
);
1376 static HRESULT STDMETHODCALLTYPE
device_parent_CreateDepthStencilSurface(IWineD3DDeviceParent
*iface
,
1377 IUnknown
*superior
, UINT width
, UINT height
, enum wined3d_format_id format
,
1378 WINED3DMULTISAMPLE_TYPE multisample_type
, DWORD multisample_quality
, BOOL discard
,
1379 IWineD3DSurface
**surface
)
1381 struct d3d10_device
*This
= device_from_device_parent(iface
);
1382 struct d3d10_texture2d
*texture
;
1383 D3D10_TEXTURE2D_DESC desc
;
1386 FIXME("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
1387 "\tmultisample_quality %u, discard %u, surface %p partial stub!\n",
1388 iface
, superior
, width
, height
, format
, multisample_type
, multisample_quality
, discard
, surface
);
1390 FIXME("Implement DXGI<->wined3d usage conversion\n");
1393 desc
.Height
= height
;
1396 desc
.Format
= dxgi_format_from_wined3dformat(format
);
1397 desc
.SampleDesc
.Count
= multisample_type
? multisample_type
: 1;
1398 desc
.SampleDesc
.Quality
= multisample_quality
;
1399 desc
.Usage
= D3D10_USAGE_DEFAULT
;
1400 desc
.BindFlags
= D3D10_BIND_RENDER_TARGET
;
1401 desc
.CPUAccessFlags
= 0;
1404 hr
= d3d10_device_CreateTexture2D((ID3D10Device
*)This
, &desc
, NULL
, (ID3D10Texture2D
**)&texture
);
1407 ERR("CreateTexture2D failed, returning %#x\n", hr
);
1411 *surface
= texture
->wined3d_surface
;
1412 IWineD3DSurface_AddRef(*surface
);
1413 ID3D10Texture2D_Release((ID3D10Texture2D
*)texture
);
1418 static HRESULT STDMETHODCALLTYPE
device_parent_CreateVolume(IWineD3DDeviceParent
*iface
,
1419 IUnknown
*superior
, UINT width
, UINT height
, UINT depth
, enum wined3d_format_id format
,
1420 WINED3DPOOL pool
, DWORD usage
, IWineD3DVolume
**volume
)
1422 FIXME("iface %p, superior %p, width %u, height %u, depth %u, format %#x, pool %#x, usage %#x, volume %p stub!\n",
1423 iface
, superior
, width
, height
, depth
, format
, pool
, usage
, volume
);
1428 static HRESULT STDMETHODCALLTYPE
device_parent_CreateSwapChain(IWineD3DDeviceParent
*iface
,
1429 WINED3DPRESENT_PARAMETERS
*present_parameters
, IWineD3DSwapChain
**swapchain
)
1431 IWineDXGIDevice
*wine_device
;
1434 TRACE("iface %p, present_parameters %p, swapchain %p\n", iface
, present_parameters
, swapchain
);
1436 hr
= IWineD3DDeviceParent_QueryInterface(iface
, &IID_IWineDXGIDevice
, (void **)&wine_device
);
1439 ERR("Device should implement IWineDXGIDevice\n");
1443 hr
= IWineDXGIDevice_create_swapchain(wine_device
, present_parameters
, swapchain
);
1444 IWineDXGIDevice_Release(wine_device
);
1447 ERR("Failed to create DXGI swapchain, returning %#x\n", hr
);
1454 static const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl
=
1456 /* IUnknown methods */
1457 device_parent_QueryInterface
,
1458 device_parent_AddRef
,
1459 device_parent_Release
,
1460 /* IWineD3DDeviceParent methods */
1461 device_parent_WineD3DDeviceCreated
,
1462 device_parent_CreateSurface
,
1463 device_parent_CreateRenderTarget
,
1464 device_parent_CreateDepthStencilSurface
,
1465 device_parent_CreateVolume
,
1466 device_parent_CreateSwapChain
,
1469 void d3d10_device_init(struct d3d10_device
*device
, void *outer_unknown
)
1471 device
->vtbl
= &d3d10_device_vtbl
;
1472 device
->inner_unknown_vtbl
= &d3d10_device_inner_unknown_vtbl
;
1473 device
->device_parent_vtbl
= &d3d10_wined3d_device_parent_vtbl
;
1474 device
->refcount
= 1;
1475 device
->outer_unknown
= outer_unknown
;