ReactOS 0.4.17-dev-934-g091855f
state.c
Go to the documentation of this file.
1/*
2 * Copyright 2009 Henri Verbeet for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 *
18 */
19
20#include "d3d11_private.h"
21
23
24/* ID3D11BlendState1 methods */
25
27 REFIID riid, void **object)
28{
30
31 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
32
33 if (IsEqualGUID(riid, &IID_ID3D11BlendState)
34 || IsEqualGUID(riid, &IID_ID3D11BlendState1)
35 || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
37 {
38 ID3D11BlendState1_AddRef(iface);
39 *object = iface;
40 return S_OK;
41 }
42
43 if (IsEqualGUID(riid, &IID_ID3D10BlendState1)
44 || IsEqualGUID(riid, &IID_ID3D10BlendState)
45 || IsEqualGUID(riid, &IID_ID3D10DeviceChild))
46 {
47 ID3D10BlendState1_AddRef(&state->ID3D10BlendState1_iface);
48 *object = &state->ID3D10BlendState1_iface;
49 return S_OK;
50 }
51
52 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
53
54 *object = NULL;
55 return E_NOINTERFACE;
56}
57
59{
62
63 TRACE("%p increasing refcount to %lu.\n", state, refcount);
64
65 if (refcount == 1)
66 {
67 ID3D11Device2_AddRef(state->device);
68 wined3d_blend_state_incref(state->wined3d_state);
69 }
70
71 return refcount;
72}
73
75{
78
79 TRACE("%p decreasing refcount to %lu.\n", state, refcount);
80
81 if (!refcount)
82 {
83 ID3D11Device2 *device = state->device;
84 wined3d_blend_state_decref(state->wined3d_state);
85 ID3D11Device2_Release(device);
86 }
87
88 return refcount;
89}
90
92 ID3D11Device **device)
93{
95
96 TRACE("iface %p, device %p.\n", iface, device);
97
98 *device = (ID3D11Device *)state->device;
99 ID3D11Device_AddRef(*device);
100}
101
103 REFGUID guid, UINT *data_size, void *data)
104{
106
107 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
108
109 return d3d_get_private_data(&state->private_store, guid, data_size, data);
110}
111
113 REFGUID guid, UINT data_size, const void *data)
114{
116
117 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
118
119 return d3d_set_private_data(&state->private_store, guid, data_size, data);
120}
121
123 REFGUID guid, const IUnknown *data)
124{
126
127 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
128
129 return d3d_set_private_data_interface(&state->private_store, guid, data);
130}
131
133{
135 const D3D11_BLEND_DESC1 *d3d11_desc = &state->desc;
136 unsigned int i;
137
138 TRACE("iface %p, desc %p.\n", iface, desc);
139
140 desc->AlphaToCoverageEnable = d3d11_desc->AlphaToCoverageEnable;
141 desc->IndependentBlendEnable = d3d11_desc->IndependentBlendEnable;
143 {
144 desc->RenderTarget[i].BlendEnable = d3d11_desc->RenderTarget[i].BlendEnable;
145 desc->RenderTarget[i].SrcBlend = d3d11_desc->RenderTarget[i].SrcBlend;
146 desc->RenderTarget[i].DestBlend = d3d11_desc->RenderTarget[i].DestBlend;
147 desc->RenderTarget[i].BlendOp = d3d11_desc->RenderTarget[i].BlendOp;
148 desc->RenderTarget[i].SrcBlendAlpha = d3d11_desc->RenderTarget[i].SrcBlendAlpha;
149 desc->RenderTarget[i].DestBlendAlpha = d3d11_desc->RenderTarget[i].DestBlendAlpha;
150 desc->RenderTarget[i].BlendOpAlpha = d3d11_desc->RenderTarget[i].BlendOpAlpha;
151 desc->RenderTarget[i].RenderTargetWriteMask = d3d11_desc->RenderTarget[i].RenderTargetWriteMask;
152 }
153}
154
156{
158
159 TRACE("iface %p, desc %p.\n", iface, desc);
160
161 *desc = state->desc;
162}
163
164static const struct ID3D11BlendState1Vtbl d3d11_blend_state_vtbl =
165{
166 /* IUnknown methods */
170 /* ID3D11DeviceChild methods */
175 /* ID3D11BlendState methods */
177 /* ID3D11BlendState1 methods */
179};
180
181/* ID3D10BlendState methods */
182
183static inline struct d3d_blend_state *impl_from_ID3D10BlendState(ID3D10BlendState1 *iface)
184{
186}
187
188/* IUnknown methods */
189
191 REFIID riid, void **object)
192{
194
195 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
196
197 return d3d11_blend_state_QueryInterface(&state->ID3D11BlendState1_iface, riid, object);
198}
199
200static ULONG STDMETHODCALLTYPE d3d10_blend_state_AddRef(ID3D10BlendState1 *iface)
201{
203
204 TRACE("iface %p.\n", iface);
205
206 return d3d11_blend_state_AddRef(&state->ID3D11BlendState1_iface);
207}
208
209static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState1 *iface)
210{
212
213 TRACE("iface %p.\n", iface);
214
215 return d3d11_blend_state_Release(&state->ID3D11BlendState1_iface);
216}
217
218/* ID3D10DeviceChild methods */
219
220static void STDMETHODCALLTYPE d3d10_blend_state_GetDevice(ID3D10BlendState1 *iface, ID3D10Device **device)
221{
223
224 TRACE("iface %p, device %p.\n", iface, device);
225
226 ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
227}
228
230 REFGUID guid, UINT *data_size, void *data)
231{
233
234 TRACE("iface %p, guid %s, data_size %p, data %p.\n",
235 iface, debugstr_guid(guid), data_size, data);
236
237 return d3d_get_private_data(&state->private_store, guid, data_size, data);
238}
239
241 REFGUID guid, UINT data_size, const void *data)
242{
244
245 TRACE("iface %p, guid %s, data_size %u, data %p.\n",
246 iface, debugstr_guid(guid), data_size, data);
247
248 return d3d_set_private_data(&state->private_store, guid, data_size, data);
249}
250
252 REFGUID guid, const IUnknown *data)
253{
255
256 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
257
258 return d3d_set_private_data_interface(&state->private_store, guid, data);
259}
260
261/* ID3D10BlendState methods */
262
264{
265 return (D3D10_BLEND)factor;
266}
267
269{
270 return (D3D10_BLEND_OP)op;
271}
272
274{
276 const D3D11_BLEND_DESC1 *d3d11_desc = &state->desc;
277 unsigned int i;
278
279 TRACE("iface %p, desc %p.\n", iface, desc);
280
281 desc->AlphaToCoverageEnable = d3d11_desc->AlphaToCoverageEnable;
282 desc->SrcBlend = d3d10_blend_from_d3d11(d3d11_desc->RenderTarget[0].SrcBlend);
283 desc->DestBlend = d3d10_blend_from_d3d11(d3d11_desc->RenderTarget[0].DestBlend);
284 desc->BlendOp = d3d10_blend_op_from_d3d11(d3d11_desc->RenderTarget[0].BlendOp);
285 desc->SrcBlendAlpha = d3d10_blend_from_d3d11(d3d11_desc->RenderTarget[0].SrcBlendAlpha);
286 desc->DestBlendAlpha = d3d10_blend_from_d3d11(d3d11_desc->RenderTarget[0].DestBlendAlpha);
287 desc->BlendOpAlpha = d3d10_blend_op_from_d3d11(d3d11_desc->RenderTarget[0].BlendOpAlpha);
289 {
290 desc->BlendEnable[i] = d3d11_desc->RenderTarget[i].BlendEnable;
291 desc->RenderTargetWriteMask[i] = d3d11_desc->RenderTarget[i].RenderTargetWriteMask;
292 }
293}
294
296{
298
299 TRACE("iface %p, desc %p.\n", iface, desc);
300
301 d3d11_blend_state_GetDesc(&state->ID3D11BlendState1_iface, (D3D11_BLEND_DESC *)desc);
302}
303
304static const struct ID3D10BlendState1Vtbl d3d10_blend_state_vtbl =
305{
306 /* IUnknown methods */
310 /* ID3D10DeviceChild methods */
315 /* ID3D10BlendState methods */
317 /* ID3D10BlendState1 methods */
319};
320
322{
323 struct d3d_blend_state *state = parent;
325
326 wine_rb_remove(&device->blend_states, &state->entry);
327 wined3d_private_store_cleanup(&state->private_store);
328 free(parent);
329}
330
332{
334};
335
337{
338 return (enum wined3d_blend)factor;
339}
340
342{
343 return (enum wined3d_blend_op)op;
344}
345
347 struct d3d_blend_state **state)
348{
349 struct wined3d_blend_state_desc wined3d_desc;
350 struct d3d_blend_state *object;
351 struct wine_rb_entry *entry;
352 D3D11_BLEND_DESC1 tmp_desc;
353 unsigned int i, j;
354 HRESULT hr;
355
356 if (!desc)
357 return E_INVALIDARG;
358
359 /* D3D11_RENDER_TARGET_BLEND_DESC1 has a hole, which is a problem because we use
360 * D3D11_BLEND_DESC1 as a key in the rbtree. */
361 memset(&tmp_desc, 0, sizeof(tmp_desc));
362 tmp_desc.AlphaToCoverageEnable = desc->AlphaToCoverageEnable;
363 tmp_desc.IndependentBlendEnable = desc->IndependentBlendEnable;
365 {
366 j = desc->IndependentBlendEnable ? i : 0;
367 tmp_desc.RenderTarget[i].BlendEnable = desc->RenderTarget[j].BlendEnable;
368 if (tmp_desc.RenderTarget[i].BlendEnable)
369 {
370 tmp_desc.RenderTarget[i].SrcBlend = desc->RenderTarget[j].SrcBlend;
371 tmp_desc.RenderTarget[i].DestBlend = desc->RenderTarget[j].DestBlend;
372 tmp_desc.RenderTarget[i].BlendOp = desc->RenderTarget[j].BlendOp;
373 tmp_desc.RenderTarget[i].SrcBlendAlpha = desc->RenderTarget[j].SrcBlendAlpha;
374 tmp_desc.RenderTarget[i].DestBlendAlpha = desc->RenderTarget[j].DestBlendAlpha;
375 tmp_desc.RenderTarget[i].BlendOpAlpha = desc->RenderTarget[j].BlendOpAlpha;
376 }
377 else
378 {
385 }
386
387 tmp_desc.RenderTarget[i].LogicOpEnable = desc->RenderTarget[j].LogicOpEnable;
388 if (tmp_desc.RenderTarget[i].LogicOpEnable)
389 tmp_desc.RenderTarget[i].LogicOp = desc->RenderTarget[j].LogicOp;
390 else
392
393 tmp_desc.RenderTarget[i].RenderTargetWriteMask = desc->RenderTarget[j].RenderTargetWriteMask;
394 }
395
397 if ((entry = wine_rb_get(&device->blend_states, &tmp_desc)))
398 {
400
401 TRACE("Returning existing blend state %p.\n", object);
402 ID3D11BlendState1_AddRef(&object->ID3D11BlendState1_iface);
403 *state = object;
405
406 return S_OK;
407 }
408
409 if (!(object = calloc(1, sizeof(*object))))
410 {
412 return E_OUTOFMEMORY;
413 }
414
415 object->ID3D11BlendState1_iface.lpVtbl = &d3d11_blend_state_vtbl;
416 object->ID3D10BlendState1_iface.lpVtbl = &d3d10_blend_state_vtbl;
417 object->refcount = 1;
418 wined3d_private_store_init(&object->private_store);
419 object->desc = tmp_desc;
420
421 if (wine_rb_put(&device->blend_states, &tmp_desc, &object->entry) == -1)
422 {
423 ERR("Failed to insert blend state entry.\n");
424 wined3d_private_store_cleanup(&object->private_store);
425 free(object);
427 return E_FAIL;
428 }
429
430 wined3d_desc.alpha_to_coverage = desc->AlphaToCoverageEnable;
431 wined3d_desc.independent = desc->IndependentBlendEnable;
433 {
434 wined3d_desc.rt[i].enable = desc->RenderTarget[i].BlendEnable;
435 wined3d_desc.rt[i].src = wined3d_blend_from_d3d11(desc->RenderTarget[i].SrcBlend);
436 wined3d_desc.rt[i].dst = wined3d_blend_from_d3d11(desc->RenderTarget[i].DestBlend);
437 wined3d_desc.rt[i].op = wined3d_blend_op_from_d3d11(desc->RenderTarget[i].BlendOp);
438 wined3d_desc.rt[i].src_alpha = wined3d_blend_from_d3d11(desc->RenderTarget[i].SrcBlendAlpha);
439 wined3d_desc.rt[i].dst_alpha = wined3d_blend_from_d3d11(desc->RenderTarget[i].DestBlendAlpha);
440 wined3d_desc.rt[i].op_alpha = wined3d_blend_op_from_d3d11(desc->RenderTarget[i].BlendOpAlpha);
441 wined3d_desc.rt[i].writemask = desc->RenderTarget[i].RenderTargetWriteMask;
442 }
443
444 if (desc->RenderTarget[0].LogicOpEnable && desc->RenderTarget[0].LogicOp != D3D11_LOGIC_OP_NOOP)
445 FIXME("Ignoring logic op %#x.\n", desc->RenderTarget[0].LogicOp);
446
447 /* We cannot fail after creating a wined3d_blend_state object. It
448 * would lead to double free. */
449 if (FAILED(hr = wined3d_blend_state_create(device->wined3d_device, &wined3d_desc,
450 object, &d3d_blend_state_wined3d_parent_ops, &object->wined3d_state)))
451 {
452 WARN("Failed to create wined3d blend state, hr %#lx.\n", hr);
453 wined3d_private_store_cleanup(&object->private_store);
454 wine_rb_remove(&device->blend_states, &object->entry);
455 free(object);
457 return hr;
458 }
460
461 ID3D11Device2_AddRef(object->device = &device->ID3D11Device2_iface);
462
463 TRACE("Created blend state %p.\n", object);
464 *state = object;
465
466 return S_OK;
467}
468
470{
471 if (!iface)
472 return NULL;
473 assert(iface->lpVtbl == (ID3D11BlendStateVtbl *)&d3d11_blend_state_vtbl);
474
476}
477
479{
480 if (!iface)
481 return NULL;
482 assert(iface->lpVtbl == (ID3D10BlendStateVtbl *)&d3d10_blend_state_vtbl);
483
484 return impl_from_ID3D10BlendState((ID3D10BlendState1 *)iface);
485}
486
487/* ID3D11DepthStencilState methods */
488
490 REFIID riid, void **object)
491{
493
494 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
495
496 if (IsEqualGUID(riid, &IID_ID3D11DepthStencilState)
497 || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
499 {
500 ID3D11DepthStencilState_AddRef(iface);
501 *object = iface;
502 return S_OK;
503 }
504
505 if (IsEqualGUID(riid, &IID_ID3D10DepthStencilState)
506 || IsEqualGUID(riid, &IID_ID3D10DeviceChild))
507 {
508 ID3D10DepthStencilState_AddRef(&state->ID3D10DepthStencilState_iface);
509 *object = &state->ID3D10DepthStencilState_iface;
510 return S_OK;
511 }
512
513 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
514
515 *object = NULL;
516 return E_NOINTERFACE;
517}
518
519static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_AddRef(ID3D11DepthStencilState *iface)
520{
523
524 TRACE("%p increasing refcount to %lu.\n", state, refcount);
525
526 if (refcount == 1)
527 {
528 ID3D11Device2_AddRef(state->device);
530 }
531
532 return refcount;
533}
534
535static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_Release(ID3D11DepthStencilState *iface)
536{
539
540 TRACE("%p decreasing refcount to %lu.\n", state, refcount);
541
542 if (!refcount)
543 {
544 ID3D11Device2 *device = state->device;
545
547 ID3D11Device2_Release(device);
548 }
549
550 return refcount;
551}
552
553static void STDMETHODCALLTYPE d3d11_depthstencil_state_GetDevice(ID3D11DepthStencilState *iface,
554 ID3D11Device **device)
555{
557
558 TRACE("iface %p, device %p.\n", iface, device);
559
560 *device = (ID3D11Device *)state->device;
561 ID3D11Device_AddRef(*device);
562}
563
565 REFGUID guid, UINT *data_size, void *data)
566{
568
569 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
570
571 return d3d_get_private_data(&state->private_store, guid, data_size, data);
572}
573
575 REFGUID guid, UINT data_size, const void *data)
576{
578
579 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
580
581 return d3d_set_private_data(&state->private_store, guid, data_size, data);
582}
583
585 REFGUID guid, const IUnknown *data)
586{
588
589 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
590
591 return d3d_set_private_data_interface(&state->private_store, guid, data);
592}
593
594static void STDMETHODCALLTYPE d3d11_depthstencil_state_GetDesc(ID3D11DepthStencilState *iface,
595 D3D11_DEPTH_STENCIL_DESC *desc)
596{
598
599 TRACE("iface %p, desc %p.\n", iface, desc);
600
601 *desc = state->desc;
602}
603
604static const struct ID3D11DepthStencilStateVtbl d3d11_depthstencil_state_vtbl =
605{
606 /* IUnknown methods */
610 /* ID3D11DeviceChild methods */
615 /* ID3D11DepthStencilState methods */
617};
618
619/* ID3D10DepthStencilState methods */
620
622{
624}
625
626/* IUnknown methods */
627
629 REFIID riid, void **object)
630{
632
633 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
634
635 return d3d11_depthstencil_state_QueryInterface(&state->ID3D11DepthStencilState_iface, riid, object);
636}
637
639{
641
642 TRACE("iface %p.\n", iface);
643
644 return d3d11_depthstencil_state_AddRef(&state->ID3D11DepthStencilState_iface);
645}
646
648{
650
651 TRACE("iface %p.\n", iface);
652
653 return d3d11_depthstencil_state_Release(&state->ID3D11DepthStencilState_iface);
654}
655
656/* ID3D10DeviceChild methods */
657
659{
661
662 TRACE("iface %p, device %p.\n", iface, device);
663
664 ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
665}
666
668 REFGUID guid, UINT *data_size, void *data)
669{
671
672 TRACE("iface %p, guid %s, data_size %p, data %p.\n",
673 iface, debugstr_guid(guid), data_size, data);
674
675 return d3d_get_private_data(&state->private_store, guid, data_size, data);
676}
677
679 REFGUID guid, UINT data_size, const void *data)
680{
682
683 TRACE("iface %p, guid %s, data_size %u, data %p.\n",
684 iface, debugstr_guid(guid), data_size, data);
685
686 return d3d_set_private_data(&state->private_store, guid, data_size, data);
687}
688
690 REFGUID guid, const IUnknown *data)
691{
693
694 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
695
696 return d3d_set_private_data_interface(&state->private_store, guid, data);
697}
698
699/* ID3D10DepthStencilState methods */
700
703{
705
706 TRACE("iface %p, desc %p.\n", iface, desc);
707
708 memcpy(desc, &state->desc, sizeof(*desc));
709}
710
711static const struct ID3D10DepthStencilStateVtbl d3d10_depthstencil_state_vtbl =
712{
713 /* IUnknown methods */
717 /* ID3D10DeviceChild methods */
722 /* ID3D10DepthStencilState methods */
724};
725
727{
730
731 wine_rb_remove(&device->depthstencil_states, &state->entry);
732 wined3d_private_store_cleanup(&state->private_store);
733 free(parent);
734}
735
737{
739};
740
742{
743 return (enum wined3d_cmp_func)func;
744}
745
746static enum wined3d_stencil_op wined3d_stencil_op_from_d3d11(D3D11_STENCIL_OP stencil_op)
747{
748 return (enum wined3d_stencil_op)stencil_op;
749}
750
751HRESULT d3d_depthstencil_state_create(struct d3d_device *device, const D3D11_DEPTH_STENCIL_DESC *desc,
753{
754 struct wined3d_depth_stencil_state_desc wined3d_desc;
756 D3D11_DEPTH_STENCIL_DESC tmp_desc;
757 struct wine_rb_entry *entry;
758 HRESULT hr;
759
760 if (!desc)
761 return E_INVALIDARG;
762
763 /* D3D11_DEPTH_STENCIL_DESC has a hole, which is a problem because we use
764 * it as a key in the rbtree. */
765 memset(&tmp_desc, 0, sizeof(tmp_desc));
766 tmp_desc.DepthEnable = desc->DepthEnable;
767 if (desc->DepthEnable)
768 {
769 tmp_desc.DepthWriteMask = desc->DepthWriteMask;
770 tmp_desc.DepthFunc = desc->DepthFunc;
771 }
772 else
773 {
774 tmp_desc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
775 tmp_desc.DepthFunc = D3D11_COMPARISON_LESS;
776 }
777 tmp_desc.StencilEnable = desc->StencilEnable;
778 if (desc->StencilEnable)
779 {
780 tmp_desc.StencilReadMask = desc->StencilReadMask;
781 tmp_desc.StencilWriteMask = desc->StencilWriteMask;
782 tmp_desc.FrontFace = desc->FrontFace;
783 tmp_desc.BackFace = desc->BackFace;
784 }
785 else
786 {
787 tmp_desc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK;
788 tmp_desc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
789 tmp_desc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
790 tmp_desc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP;
791 tmp_desc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
792 tmp_desc.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
793 tmp_desc.BackFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
794 tmp_desc.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP;
795 tmp_desc.BackFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
796 tmp_desc.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
797 }
798
800 if ((entry = wine_rb_get(&device->depthstencil_states, &tmp_desc)))
801 {
803
804 TRACE("Returning existing depthstencil state %p.\n", object);
805 ID3D11DepthStencilState_AddRef(&object->ID3D11DepthStencilState_iface);
806 *state = object;
808
809 return S_OK;
810 }
811
812 if (!(object = calloc(1, sizeof(*object))))
813 {
815 return E_OUTOFMEMORY;
816 }
817
818 object->ID3D11DepthStencilState_iface.lpVtbl = &d3d11_depthstencil_state_vtbl;
819 object->ID3D10DepthStencilState_iface.lpVtbl = &d3d10_depthstencil_state_vtbl;
820 object->refcount = 1;
821 wined3d_private_store_init(&object->private_store);
822 object->desc = tmp_desc;
823
824 if (wine_rb_put(&device->depthstencil_states, &tmp_desc, &object->entry) == -1)
825 {
826 ERR("Failed to insert depth/stencil state entry.\n");
827 wined3d_private_store_cleanup(&object->private_store);
828 free(object);
830 return E_FAIL;
831 }
832
833 wined3d_desc.depth = desc->DepthEnable;
834 wined3d_desc.depth_write = desc->DepthWriteMask;
835 wined3d_desc.depth_func = wined3d_cmp_func_from_d3d11(desc->DepthFunc);
836 wined3d_desc.stencil = desc->StencilEnable;
837 wined3d_desc.stencil_read_mask = desc->StencilReadMask;
838 wined3d_desc.stencil_write_mask = desc->StencilWriteMask;
839 wined3d_desc.front.fail_op = wined3d_stencil_op_from_d3d11(desc->FrontFace.StencilFailOp);
840 wined3d_desc.front.depth_fail_op = wined3d_stencil_op_from_d3d11(desc->FrontFace.StencilDepthFailOp);
841 wined3d_desc.front.pass_op = wined3d_stencil_op_from_d3d11(desc->FrontFace.StencilPassOp);
842 wined3d_desc.front.func = wined3d_cmp_func_from_d3d11(desc->FrontFace.StencilFunc);
843 wined3d_desc.back.fail_op = wined3d_stencil_op_from_d3d11(desc->BackFace.StencilFailOp);
844 wined3d_desc.back.depth_fail_op = wined3d_stencil_op_from_d3d11(desc->BackFace.StencilDepthFailOp);
845 wined3d_desc.back.pass_op = wined3d_stencil_op_from_d3d11(desc->BackFace.StencilPassOp);
846 wined3d_desc.back.func = wined3d_cmp_func_from_d3d11(desc->BackFace.StencilFunc);
847
848 /* We cannot fail after creating a wined3d_depth_stencil_state object. It
849 * would lead to double free. */
850 if (FAILED(hr = wined3d_depth_stencil_state_create(device->wined3d_device, &wined3d_desc,
851 object, &d3d_depthstencil_state_wined3d_parent_ops, &object->wined3d_state)))
852 {
853 WARN("Failed to create wined3d depth/stencil state, hr %#lx.\n", hr);
854 wined3d_private_store_cleanup(&object->private_store);
855 wine_rb_remove(&device->depthstencil_states, &object->entry);
856 free(object);
858 return hr;
859 }
861
862 ID3D11Device2_AddRef(object->device = &device->ID3D11Device2_iface);
863
864 TRACE("Created depth/stencil state %p.\n", object);
865 *state = object;
866
867 return S_OK;
868}
869
871{
872 if (!iface)
873 return NULL;
874 assert(iface->lpVtbl == &d3d11_depthstencil_state_vtbl);
875
877}
878
880{
881 if (!iface)
882 return NULL;
883 assert(iface->lpVtbl == &d3d10_depthstencil_state_vtbl);
884
886}
887
888/* ID3D11RasterizerState methods */
889
891{
893}
894
896 REFIID riid, void **object)
897{
899
900 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
901
902 if (IsEqualGUID(riid, &IID_ID3D11RasterizerState)
903 || IsEqualGUID(riid, &IID_ID3D11RasterizerState1)
904 || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
906 {
907 ID3D11RasterizerState1_AddRef(iface);
908 *object = iface;
909 return S_OK;
910 }
911
912 if (IsEqualGUID(riid, &IID_ID3D10RasterizerState)
913 || IsEqualGUID(riid, &IID_ID3D10DeviceChild))
914 {
915 ID3D10RasterizerState_AddRef(&state->ID3D10RasterizerState_iface);
916 *object = &state->ID3D10RasterizerState_iface;
917 return S_OK;
918 }
919
920 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
921
922 *object = NULL;
923 return E_NOINTERFACE;
924}
925
927{
930
931 TRACE("%p increasing refcount to %lu.\n", state, refcount);
932
933 if (refcount == 1)
934 {
935 ID3D11Device2_AddRef(state->device);
937 }
938
939 return refcount;
940}
941
943{
946
947 TRACE("%p decreasing refcount to %lu.\n", state, refcount);
948
949 if (!refcount)
950 {
951 ID3D11Device2 *device = state->device;
953 ID3D11Device2_Release(device);
954 }
955
956 return refcount;
957}
958
960 ID3D11Device **device)
961{
963
964 TRACE("iface %p, device %p.\n", iface, device);
965
966 *device = (ID3D11Device *)state->device;
967 ID3D11Device_AddRef(*device);
968}
969
971 REFGUID guid, UINT *data_size, void *data)
972{
974
975 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
976
977 return d3d_get_private_data(&state->private_store, guid, data_size, data);
978}
979
981 REFGUID guid, UINT data_size, const void *data)
982{
984
985 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
986
987 return d3d_set_private_data(&state->private_store, guid, data_size, data);
988}
989
991 REFGUID guid, const IUnknown *data)
992{
994
995 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
996
997 return d3d_set_private_data_interface(&state->private_store, guid, data);
998}
999
1002{
1004
1005 TRACE("iface %p, desc %p.\n", iface, desc);
1006
1007 memcpy(desc, &state->desc, sizeof(*desc));
1008}
1009
1012{
1014
1015 TRACE("iface %p, desc %p.\n", iface, desc);
1016
1017 *desc = state->desc;
1018}
1019
1020static const struct ID3D11RasterizerState1Vtbl d3d11_rasterizer_state_vtbl =
1021{
1022 /* IUnknown methods */
1026 /* ID3D11DeviceChild methods */
1031 /* ID3D11RasterizerState methods */
1033 /* ID3D11RasterizerState1 methods */
1035};
1036
1037/* ID3D10RasterizerState methods */
1038
1040{
1042}
1043
1044/* IUnknown methods */
1045
1047 REFIID riid, void **object)
1048{
1050
1051 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
1052
1053 return d3d11_rasterizer_state_QueryInterface(&state->ID3D11RasterizerState1_iface, riid, object);
1054}
1055
1057{
1059
1060 TRACE("iface %p.\n", iface);
1061
1062 return d3d11_rasterizer_state_AddRef(&state->ID3D11RasterizerState1_iface);
1063}
1064
1066{
1068
1069 TRACE("iface %p.\n", state);
1070
1071 return d3d11_rasterizer_state_Release(&state->ID3D11RasterizerState1_iface);
1072}
1073
1074/* ID3D10DeviceChild methods */
1075
1077{
1079
1080 TRACE("iface %p, device %p.\n", iface, device);
1081
1082 ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
1083}
1084
1086 REFGUID guid, UINT *data_size, void *data)
1087{
1089
1090 TRACE("iface %p, guid %s, data_size %p, data %p.\n",
1091 iface, debugstr_guid(guid), data_size, data);
1092
1093 return d3d_get_private_data(&state->private_store, guid, data_size, data);
1094}
1095
1097 REFGUID guid, UINT data_size, const void *data)
1098{
1100
1101 TRACE("iface %p, guid %s, data_size %u, data %p.\n",
1102 iface, debugstr_guid(guid), data_size, data);
1103
1104 return d3d_set_private_data(&state->private_store, guid, data_size, data);
1105}
1106
1108 REFGUID guid, const IUnknown *data)
1109{
1111
1112 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
1113
1114 return d3d_set_private_data_interface(&state->private_store, guid, data);
1115}
1116
1117/* ID3D10RasterizerState methods */
1118
1121{
1123
1124 TRACE("iface %p, desc %p.\n", iface, desc);
1125
1126 memcpy(desc, &state->desc, sizeof(*desc));
1127}
1128
1129static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl =
1130{
1131 /* IUnknown methods */
1135 /* ID3D10DeviceChild methods */
1140 /* ID3D10RasterizerState methods */
1142};
1143
1145{
1148
1149 wine_rb_remove(&device->rasterizer_states, &state->entry);
1150 wined3d_private_store_cleanup(&state->private_store);
1151 free(parent);
1152}
1153
1155{
1157};
1158
1160{
1161 return (enum wined3d_fill_mode)mode;
1162}
1163
1165{
1166 return (enum wined3d_cull)mode;
1167}
1168
1171{
1172 struct wined3d_rasterizer_state_desc wined3d_desc;
1173 HRESULT hr;
1174
1175 state->ID3D11RasterizerState1_iface.lpVtbl = &d3d11_rasterizer_state_vtbl;
1176 state->ID3D10RasterizerState_iface.lpVtbl = &d3d10_rasterizer_state_vtbl;
1177 state->refcount = 1;
1178 wined3d_private_store_init(&state->private_store);
1179 state->desc = *desc;
1180
1181 if (wine_rb_put(&device->rasterizer_states, desc, &state->entry) == -1)
1182 {
1183 ERR("Failed to insert rasterizer state entry.\n");
1184 wined3d_private_store_cleanup(&state->private_store);
1185 return E_FAIL;
1186 }
1187
1188 wined3d_desc.fill_mode = wined3d_fill_mode_from_d3d11(desc->FillMode);
1189 wined3d_desc.cull_mode = wined3d_cull_from_d3d11(desc->CullMode);
1190 wined3d_desc.front_ccw = desc->FrontCounterClockwise;
1191 wined3d_desc.depth_bias = desc->DepthBias;
1192 wined3d_desc.depth_bias_clamp = desc->DepthBiasClamp;
1193 wined3d_desc.scale_bias = desc->SlopeScaledDepthBias;
1194 wined3d_desc.depth_clip = desc->DepthClipEnable;
1195 wined3d_desc.scissor = desc->ScissorEnable;
1196 wined3d_desc.line_antialias = desc->AntialiasedLineEnable;
1197
1198 if (desc->MultisampleEnable)
1199 {
1200 static unsigned int once;
1201 if (!once++)
1202 FIXME("Ignoring MultisampleEnable %#x.\n", desc->MultisampleEnable);
1203 }
1204
1205 if (desc->ForcedSampleCount)
1206 {
1207 static unsigned int once;
1208 if (!once++)
1209 FIXME("Ignoring ForcedSampleCount %#x.\n", desc->ForcedSampleCount);
1210 }
1211
1212 /* We cannot fail after creating a wined3d_rasterizer_state object. It
1213 * would lead to double free. */
1214 if (FAILED(hr = wined3d_rasterizer_state_create(device->wined3d_device, &wined3d_desc,
1216 {
1217 WARN("Failed to create wined3d rasteriser state, hr %#lx.\n", hr);
1218 wined3d_private_store_cleanup(&state->private_store);
1219 wine_rb_remove(&device->rasterizer_states, &state->entry);
1220 return hr;
1221 }
1222
1223 ID3D11Device2_AddRef(state->device = &device->ID3D11Device2_iface);
1224
1225 return S_OK;
1226}
1227
1229 struct d3d_rasterizer_state **state)
1230{
1232 struct wine_rb_entry *entry;
1233 HRESULT hr;
1234
1236 if ((entry = wine_rb_get(&device->rasterizer_states, desc)))
1237 {
1239
1240 TRACE("Returning existing rasterizer state %p.\n", object);
1241 ID3D11RasterizerState1_AddRef(&object->ID3D11RasterizerState1_iface);
1242 *state = object;
1244
1245 return S_OK;
1246 }
1247
1248 if (!(object = calloc(1, sizeof(*object))))
1249 {
1251 return E_OUTOFMEMORY;
1252 }
1253
1256 if (FAILED(hr))
1257 {
1258 WARN("Failed to initialise rasterizer state, hr %#lx.\n", hr);
1259 free(object);
1260 return hr;
1261 }
1262
1263 TRACE("Created rasterizer state %p.\n", object);
1264 *state = object;
1265
1266 return S_OK;
1267}
1268
1270{
1271 if (!iface)
1272 return NULL;
1273 assert(iface->lpVtbl == (ID3D11RasterizerStateVtbl *)&d3d11_rasterizer_state_vtbl);
1274
1276}
1277
1279{
1280 if (!iface)
1281 return NULL;
1282 assert(iface->lpVtbl == &d3d10_rasterizer_state_vtbl);
1283
1284 return impl_from_ID3D10RasterizerState(iface);
1285}
1286
1287/* ID3D11SampleState methods */
1288
1289static inline struct d3d_sampler_state *impl_from_ID3D11SamplerState(ID3D11SamplerState *iface)
1290{
1292}
1293
1295 REFIID riid, void **object)
1296{
1298
1299 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
1300
1301 if (IsEqualGUID(riid, &IID_ID3D11SamplerState)
1302 || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
1304 {
1305 ID3D11SamplerState_AddRef(iface);
1306 *object = iface;
1307 return S_OK;
1308 }
1309
1310 if (IsEqualGUID(riid, &IID_ID3D10SamplerState)
1311 || IsEqualGUID(riid, &IID_ID3D10DeviceChild))
1312 {
1313 ID3D10SamplerState_AddRef(&state->ID3D10SamplerState_iface);
1314 *object = &state->ID3D10SamplerState_iface;
1315 return S_OK;
1316 }
1317
1318 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
1319
1320 *object = NULL;
1321 return E_NOINTERFACE;
1322}
1323
1324static ULONG STDMETHODCALLTYPE d3d11_sampler_state_AddRef(ID3D11SamplerState *iface)
1325{
1328
1329 TRACE("%p increasing refcount to %lu.\n", state, refcount);
1330
1331 if (refcount == 1)
1332 {
1333 ID3D11Device2_AddRef(state->device);
1334 wined3d_sampler_incref(state->wined3d_sampler);
1335 }
1336
1337 return refcount;
1338}
1339
1340static ULONG STDMETHODCALLTYPE d3d11_sampler_state_Release(ID3D11SamplerState *iface)
1341{
1344
1345 TRACE("%p decreasing refcount to %lu.\n", state, refcount);
1346
1347 if (!refcount)
1348 {
1349 ID3D11Device2 *device = state->device;
1350 wined3d_sampler_decref(state->wined3d_sampler);
1351 ID3D11Device2_Release(device);
1352 }
1353
1354 return refcount;
1355}
1356
1357static void STDMETHODCALLTYPE d3d11_sampler_state_GetDevice(ID3D11SamplerState *iface,
1358 ID3D11Device **device)
1359{
1361
1362 TRACE("iface %p, device %p.\n", iface, device);
1363
1364 *device = (ID3D11Device *)state->device;
1365 ID3D11Device_AddRef(*device);
1366}
1367
1369 REFGUID guid, UINT *data_size, void *data)
1370{
1372
1373 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
1374
1375 return d3d_get_private_data(&state->private_store, guid, data_size, data);
1376}
1377
1379 REFGUID guid, UINT data_size, const void *data)
1380{
1382
1383 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
1384
1385 return d3d_set_private_data(&state->private_store, guid, data_size, data);
1386}
1387
1389 REFGUID guid, const IUnknown *data)
1390{
1392
1393 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
1394
1395 return d3d_set_private_data_interface(&state->private_store, guid, data);
1396}
1397
1398static void STDMETHODCALLTYPE d3d11_sampler_state_GetDesc(ID3D11SamplerState *iface,
1399 D3D11_SAMPLER_DESC *desc)
1400{
1402
1403 TRACE("iface %p, desc %p.\n", iface, desc);
1404
1405 *desc = state->desc;
1406}
1407
1408static const struct ID3D11SamplerStateVtbl d3d11_sampler_state_vtbl =
1409{
1410 /* IUnknown methods */
1414 /* ID3D11DeviceChild methods */
1419 /* ID3D11SamplerState methods */
1421};
1422
1423/* ID3D10SamplerState methods */
1424
1426{
1428}
1429
1430/* IUnknown methods */
1431
1433 REFIID riid, void **object)
1434{
1436
1437 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
1438
1439 return d3d11_sampler_state_QueryInterface(&state->ID3D11SamplerState_iface, riid, object);
1440}
1441
1443{
1445
1446 TRACE("iface %p.\n", iface);
1447
1448 return d3d11_sampler_state_AddRef(&state->ID3D11SamplerState_iface);
1449}
1450
1452{
1454
1455 TRACE("iface %p.\n", iface);
1456
1457 return d3d11_sampler_state_Release(&state->ID3D11SamplerState_iface);
1458}
1459
1460/* ID3D10DeviceChild methods */
1461
1463{
1465
1466 TRACE("iface %p, device %p.\n", iface, device);
1467
1468 ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
1469}
1470
1472 REFGUID guid, UINT *data_size, void *data)
1473{
1475
1476 TRACE("iface %p, guid %s, data_size %p, data %p.\n",
1477 iface, debugstr_guid(guid), data_size, data);
1478
1479 return d3d_get_private_data(&state->private_store, guid, data_size, data);
1480}
1481
1483 REFGUID guid, UINT data_size, const void *data)
1484{
1486
1487 TRACE("iface %p, guid %s, data_size %u, data %p.\n",
1488 iface, debugstr_guid(guid), data_size, data);
1489
1490 return d3d_set_private_data(&state->private_store, guid, data_size, data);
1491}
1492
1494 REFGUID guid, const IUnknown *data)
1495{
1497
1498 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
1499
1500 return d3d_set_private_data_interface(&state->private_store, guid, data);
1501}
1502
1503/* ID3D10SamplerState methods */
1504
1507{
1509
1510 TRACE("iface %p, desc %p.\n", iface, desc);
1511
1512 memcpy(desc, &state->desc, sizeof(*desc));
1513}
1514
1515static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl =
1516{
1517 /* IUnknown methods */
1521 /* ID3D10DeviceChild methods */
1526 /* ID3D10SamplerState methods */
1528};
1529
1531{
1532 struct d3d_sampler_state *state = parent;
1534
1535 wine_rb_remove(&device->sampler_states, &state->entry);
1536 wined3d_private_store_cleanup(&state->private_store);
1537 free(parent);
1538}
1539
1541{
1543};
1544
1545static enum wined3d_texture_address wined3d_texture_address_from_d3d11(enum D3D11_TEXTURE_ADDRESS_MODE t)
1546{
1547 return (enum wined3d_texture_address)t;
1548}
1549
1551{
1552 if (D3D11_DECODE_MIP_FILTER(f) == D3D11_FILTER_TYPE_LINEAR)
1553 return WINED3D_TEXF_LINEAR;
1554 return WINED3D_TEXF_POINT;
1555}
1556
1558{
1559 if (D3D11_DECODE_MAG_FILTER(f) == D3D11_FILTER_TYPE_LINEAR)
1560 return WINED3D_TEXF_LINEAR;
1561 return WINED3D_TEXF_POINT;
1562}
1563
1565{
1566 if (D3D11_DECODE_MIN_FILTER(f) == D3D11_FILTER_TYPE_LINEAR)
1567 return WINED3D_TEXF_LINEAR;
1568 return WINED3D_TEXF_POINT;
1569}
1570
1572{
1573 return D3D11_DECODE_IS_COMPARISON_FILTER(f);
1574}
1575
1577 const D3D11_SAMPLER_DESC *desc)
1578{
1579 struct wined3d_sampler_desc wined3d_desc;
1580 HRESULT hr;
1581
1582 state->ID3D11SamplerState_iface.lpVtbl = &d3d11_sampler_state_vtbl;
1583 state->ID3D10SamplerState_iface.lpVtbl = &d3d10_sampler_state_vtbl;
1584 state->refcount = 1;
1585 wined3d_private_store_init(&state->private_store);
1586 state->desc = *desc;
1587
1588 wined3d_desc.address_u = wined3d_texture_address_from_d3d11(desc->AddressU);
1589 wined3d_desc.address_v = wined3d_texture_address_from_d3d11(desc->AddressV);
1590 wined3d_desc.address_w = wined3d_texture_address_from_d3d11(desc->AddressW);
1591 memcpy(wined3d_desc.border_color, desc->BorderColor, sizeof(wined3d_desc.border_color));
1595 wined3d_desc.lod_bias = desc->MipLODBias;
1596 wined3d_desc.min_lod = desc->MinLOD;
1597 wined3d_desc.max_lod = max(desc->MinLOD, desc->MaxLOD);
1598 wined3d_desc.mip_base_level = 0;
1599 wined3d_desc.max_anisotropy = D3D11_DECODE_IS_ANISOTROPIC_FILTER(desc->Filter) ? desc->MaxAnisotropy : 1;
1600 wined3d_desc.compare = wined3d_texture_compare_from_d3d11(desc->Filter);
1601 wined3d_desc.comparison_func = wined3d_cmp_func_from_d3d11(desc->ComparisonFunc);
1602 wined3d_desc.srgb_decode = TRUE;
1603
1604 if (wine_rb_put(&device->sampler_states, desc, &state->entry) == -1)
1605 {
1606 ERR("Failed to insert sampler state entry.\n");
1607 wined3d_private_store_cleanup(&state->private_store);
1608 return E_FAIL;
1609 }
1610
1611 /* We cannot fail after creating a wined3d_sampler object. It would lead to
1612 * double free. */
1613 if (FAILED(hr = wined3d_sampler_create(device->wined3d_device, &wined3d_desc,
1614 state, &d3d_sampler_wined3d_parent_ops, &state->wined3d_sampler)))
1615 {
1616 WARN("Failed to create wined3d sampler, hr %#lx.\n", hr);
1617 wined3d_private_store_cleanup(&state->private_store);
1618 wine_rb_remove(&device->sampler_states, &state->entry);
1619 return hr;
1620 }
1621
1622 ID3D11Device2_AddRef(state->device = &device->ID3D11Device2_iface);
1623
1624 return S_OK;
1625}
1626
1627HRESULT d3d_sampler_state_create(struct d3d_device *device, const D3D11_SAMPLER_DESC *desc,
1628 struct d3d_sampler_state **state)
1629{
1630 D3D11_SAMPLER_DESC normalized_desc;
1631 struct d3d_sampler_state *object;
1632 struct wine_rb_entry *entry;
1633 HRESULT hr;
1634
1635 if (!desc)
1636 return E_INVALIDARG;
1637
1638 normalized_desc = *desc;
1639 if (!D3D11_DECODE_IS_ANISOTROPIC_FILTER(normalized_desc.Filter))
1640 normalized_desc.MaxAnisotropy = 0;
1641 if (!D3D11_DECODE_IS_COMPARISON_FILTER(normalized_desc.Filter))
1642 normalized_desc.ComparisonFunc = D3D11_COMPARISON_NEVER;
1643 if (normalized_desc.AddressU != D3D11_TEXTURE_ADDRESS_BORDER
1644 && normalized_desc.AddressV != D3D11_TEXTURE_ADDRESS_BORDER
1645 && normalized_desc.AddressW != D3D11_TEXTURE_ADDRESS_BORDER)
1646 memset(&normalized_desc.BorderColor, 0, sizeof(normalized_desc.BorderColor));
1647
1649 if ((entry = wine_rb_get(&device->sampler_states, &normalized_desc)))
1650 {
1652
1653 TRACE("Returning existing sampler state %p.\n", object);
1654 ID3D11SamplerState_AddRef(&object->ID3D11SamplerState_iface);
1655 *state = object;
1657
1658 return S_OK;
1659 }
1660
1661 if (!(object = calloc(1, sizeof(*object))))
1662 {
1664 return E_OUTOFMEMORY;
1665 }
1666
1667 hr = d3d_sampler_state_init(object, device, &normalized_desc);
1669 if (FAILED(hr))
1670 {
1671 WARN("Failed to initialise sampler state, hr %#lx.\n", hr);
1672 free(object);
1673 return hr;
1674 }
1675
1676 TRACE("Created sampler state %p.\n", object);
1677 *state = object;
1678
1679 return S_OK;
1680}
1681
1683{
1684 if (!iface)
1685 return NULL;
1686 assert(iface->lpVtbl == &d3d11_sampler_state_vtbl);
1687
1688 return impl_from_ID3D11SamplerState(iface);
1689}
1690
1692{
1693 if (!iface)
1694 return NULL;
1695 assert(iface->lpVtbl == &d3d10_sampler_state_vtbl);
1696
1697 return impl_from_ID3D10SamplerState(iface);
1698}
static int state
Definition: maze.c:121
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
D3D10_BLEND
Definition: d3d10.idl:260
const unsigned int D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT
Definition: d3d10.idl:203
D3D10_BLEND_OP
Definition: d3d10.idl:280
@ D3D11_FILTER_TYPE_LINEAR
Definition: d3d11.idl:855
D3D11_FILTER
Definition: d3d11.idl:894
const UINT D3D11_DEFAULT_STENCIL_READ_MASK
Definition: d3d11.idl:146
D3D11_BLEND
Definition: d3d11.idl:299
@ D3D11_BLEND_ONE
Definition: d3d11.idl:301
@ D3D11_BLEND_ZERO
Definition: d3d11.idl:300
const unsigned int D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT
Definition: d3d11.idl:172
D3D11_COMPARISON_FUNC
Definition: d3d11.idl:586
@ D3D11_COMPARISON_NEVER
Definition: d3d11.idl:587
@ D3D11_COMPARISON_ALWAYS
Definition: d3d11.idl:594
@ D3D11_COMPARISON_LESS
Definition: d3d11.idl:588
D3D11_BLEND_OP
Definition: d3d11.idl:320
@ D3D11_BLEND_OP_ADD
Definition: d3d11.idl:321
@ D3D11_DEPTH_WRITE_MASK_ALL
Definition: d3d11.idl:633
D3D11_CULL_MODE
Definition: d3d11.idl:624
const UINT D3D11_DEFAULT_STENCIL_WRITE_MASK
Definition: d3d11.idl:148
D3D11_FILL_MODE
Definition: d3d11.idl:847
@ D3D11_LOGIC_OP_NOOP
Definition: d3d11_1.idl:31
static struct d3d_depthstencil_state * impl_from_ID3D11DepthStencilState(ID3D11DepthStencilState *iface)
HRESULT d3d_get_private_data(struct wined3d_private_store *store, REFGUID guid, UINT *data_size, void *data)
Definition: utils.c:803
static struct d3d_blend_state * impl_from_ID3D11BlendState1(ID3D11BlendState1 *iface)
static struct d3d_device * impl_from_ID3D11Device2(ID3D11Device2 *iface)
HRESULT d3d_set_private_data_interface(struct wined3d_private_store *store, REFGUID guid, const IUnknown *object)
Definition: utils.c:867
HRESULT d3d_set_private_data(struct wined3d_private_store *store, REFGUID guid, UINT data_size, const void *data)
Definition: utils.c:841
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
#define free
Definition: debug_ros.c:5
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
static ULONG STDMETHODCALLTYPE d3d10_depthstencil_state_Release(ID3D10DepthStencilState *iface)
Definition: state.c:647
HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC1 *desc, struct d3d_blend_state **state)
Definition: state.c:346
static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_GetPrivateData(ID3D10RasterizerState *iface, REFGUID guid, UINT *data_size, void *data)
Definition: state.c:1085
static void STDMETHODCALLTYPE d3d11_blend_state_GetDesc1(ID3D11BlendState1 *iface, D3D11_BLEND_DESC1 *desc)
Definition: state.c:155
static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_QueryInterface(ID3D10SamplerState *iface, REFIID riid, void **object)
Definition: state.c:1432
static HRESULT STDMETHODCALLTYPE d3d11_rasterizer_state_SetPrivateData(ID3D11RasterizerState1 *iface, REFGUID guid, UINT data_size, const void *data)
Definition: state.c:980
static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl
Definition: state.c:1515
static HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, struct d3d_device *device, const D3D11_RASTERIZER_DESC1 *desc)
Definition: state.c:1169
static D3D10_BLEND d3d10_blend_from_d3d11(D3D11_BLEND factor)
Definition: state.c:263
static HRESULT STDMETHODCALLTYPE d3d11_sampler_state_GetPrivateData(ID3D11SamplerState *iface, REFGUID guid, UINT *data_size, void *data)
Definition: state.c:1368
static HRESULT STDMETHODCALLTYPE d3d11_rasterizer_state_GetPrivateData(ID3D11RasterizerState1 *iface, REFGUID guid, UINT *data_size, void *data)
Definition: state.c:970
static void STDMETHODCALLTYPE d3d11_sampler_state_GetDevice(ID3D11SamplerState *iface, ID3D11Device **device)
Definition: state.c:1357
static void STDMETHODCALLTYPE d3d_rasterizer_state_wined3d_object_destroyed(void *parent)
Definition: state.c:1144
static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_SetPrivateDataInterface(ID3D10DepthStencilState *iface, REFGUID guid, const IUnknown *data)
Definition: state.c:689
struct d3d_rasterizer_state * unsafe_impl_from_ID3D11RasterizerState(ID3D11RasterizerState *iface)
Definition: state.c:1269
struct d3d_sampler_state * unsafe_impl_from_ID3D11SamplerState(ID3D11SamplerState *iface)
Definition: state.c:1682
static void STDMETHODCALLTYPE d3d11_sampler_state_GetDesc(ID3D11SamplerState *iface, D3D11_SAMPLER_DESC *desc)
Definition: state.c:1398
static D3D10_BLEND_OP d3d10_blend_op_from_d3d11(D3D11_BLEND_OP op)
Definition: state.c:268
static struct d3d_rasterizer_state * impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface)
Definition: state.c:1039
static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateDataInterface(ID3D10SamplerState *iface, REFGUID guid, const IUnknown *data)
Definition: state.c:1493
static struct d3d_sampler_state * impl_from_ID3D11SamplerState(ID3D11SamplerState *iface)
Definition: state.c:1289
static const struct ID3D10DepthStencilStateVtbl d3d10_depthstencil_state_vtbl
Definition: state.c:711
static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_GetPrivateData(ID3D10DepthStencilState *iface, REFGUID guid, UINT *data_size, void *data)
Definition: state.c:667
static ULONG STDMETHODCALLTYPE d3d11_blend_state_Release(ID3D11BlendState1 *iface)
Definition: state.c:74
static HRESULT STDMETHODCALLTYPE d3d10_blend_state_GetPrivateData(ID3D10BlendState1 *iface, REFGUID guid, UINT *data_size, void *data)
Definition: state.c:229
static ULONG STDMETHODCALLTYPE d3d10_depthstencil_state_AddRef(ID3D10DepthStencilState *iface)
Definition: state.c:638
static ULONG STDMETHODCALLTYPE d3d11_sampler_state_Release(ID3D11SamplerState *iface)
Definition: state.c:1340
static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_Release(ID3D11DepthStencilState *iface)
Definition: state.c:535
static const struct wined3d_parent_ops d3d_depthstencil_state_wined3d_parent_ops
Definition: state.c:736
static const struct ID3D11BlendState1Vtbl d3d11_blend_state_vtbl
Definition: state.c:164
static enum wined3d_texture_filter_type wined3d_texture_filter_mip_from_d3d11(enum D3D11_FILTER f)
Definition: state.c:1550
static ULONG STDMETHODCALLTYPE d3d10_blend_state_AddRef(ID3D10BlendState1 *iface)
Definition: state.c:200
static void STDMETHODCALLTYPE d3d10_sampler_state_GetDesc(ID3D10SamplerState *iface, D3D10_SAMPLER_DESC *desc)
Definition: state.c:1505
static void STDMETHODCALLTYPE d3d11_depthstencil_state_GetDesc(ID3D11DepthStencilState *iface, D3D11_DEPTH_STENCIL_DESC *desc)
Definition: state.c:594
static HRESULT STDMETHODCALLTYPE d3d11_sampler_state_QueryInterface(ID3D11SamplerState *iface, REFIID riid, void **object)
Definition: state.c:1294
static HRESULT STDMETHODCALLTYPE d3d11_rasterizer_state_SetPrivateDataInterface(ID3D11RasterizerState1 *iface, REFGUID guid, const IUnknown *data)
Definition: state.c:990
static enum wined3d_texture_filter_type wined3d_texture_filter_min_from_d3d11(enum D3D11_FILTER f)
Definition: state.c:1564
static ULONG STDMETHODCALLTYPE d3d11_blend_state_AddRef(ID3D11BlendState1 *iface)
Definition: state.c:58
static BOOL wined3d_texture_compare_from_d3d11(enum D3D11_FILTER f)
Definition: state.c:1571
static ULONG STDMETHODCALLTYPE d3d10_sampler_state_Release(ID3D10SamplerState *iface)
Definition: state.c:1451
HRESULT d3d_rasterizer_state_create(struct d3d_device *device, const D3D11_RASTERIZER_DESC1 *desc, struct d3d_rasterizer_state **state)
Definition: state.c:1228
static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateData(ID3D10SamplerState *iface, REFGUID guid, UINT data_size, const void *data)
Definition: state.c:1482
static const struct ID3D11DepthStencilStateVtbl d3d11_depthstencil_state_vtbl
Definition: state.c:604
static ULONG STDMETHODCALLTYPE d3d11_sampler_state_AddRef(ID3D11SamplerState *iface)
Definition: state.c:1324
static const struct wined3d_parent_ops d3d_sampler_wined3d_parent_ops
Definition: state.c:1540
static enum wined3d_blend_op wined3d_blend_op_from_d3d11(D3D11_BLEND_OP op)
Definition: state.c:341
static struct d3d_depthstencil_state * impl_from_ID3D10DepthStencilState(ID3D10DepthStencilState *iface)
Definition: state.c:621
static enum wined3d_fill_mode wined3d_fill_mode_from_d3d11(D3D11_FILL_MODE mode)
Definition: state.c:1159
struct d3d_blend_state * unsafe_impl_from_ID3D11BlendState(ID3D11BlendState *iface)
Definition: state.c:469
static enum wined3d_blend wined3d_blend_from_d3d11(D3D11_BLEND factor)
Definition: state.c:336
static const struct ID3D11RasterizerState1Vtbl d3d11_rasterizer_state_vtbl
Definition: state.c:1020
static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_AddRef(ID3D11RasterizerState1 *iface)
Definition: state.c:926
static struct d3d_rasterizer_state * impl_from_ID3D11RasterizerState1(ID3D11RasterizerState1 *iface)
Definition: state.c:890
static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_GetPrivateData(ID3D10SamplerState *iface, REFGUID guid, UINT *data_size, void *data)
Definition: state.c:1471
static enum wined3d_stencil_op wined3d_stencil_op_from_d3d11(D3D11_STENCIL_OP stencil_op)
Definition: state.c:746
static void STDMETHODCALLTYPE d3d10_sampler_state_GetDevice(ID3D10SamplerState *iface, ID3D10Device **device)
Definition: state.c:1462
static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_Release(ID3D11RasterizerState1 *iface)
Definition: state.c:942
static void STDMETHODCALLTYPE d3d11_blend_state_GetDevice(ID3D11BlendState1 *iface, ID3D11Device **device)
Definition: state.c:91
static enum wined3d_cmp_func wined3d_cmp_func_from_d3d11(D3D11_COMPARISON_FUNC func)
Definition: state.c:741
static void STDMETHODCALLTYPE d3d_sampler_wined3d_object_destroyed(void *parent)
Definition: state.c:1530
static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_state_SetPrivateDataInterface(ID3D11DepthStencilState *iface, REFGUID guid, const IUnknown *data)
Definition: state.c:584
struct d3d_rasterizer_state * unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface)
Definition: state.c:1278
static HRESULT STDMETHODCALLTYPE d3d11_blend_state_GetPrivateData(ID3D11BlendState1 *iface, REFGUID guid, UINT *data_size, void *data)
Definition: state.c:102
static void STDMETHODCALLTYPE d3d_blend_state_wined3d_object_destroyed(void *parent)
Definition: state.c:321
static const struct wined3d_parent_ops d3d_rasterizer_state_wined3d_parent_ops
Definition: state.c:1154
static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_SetPrivateData(ID3D10RasterizerState *iface, REFGUID guid, UINT data_size, const void *data)
Definition: state.c:1096
static void STDMETHODCALLTYPE d3d11_rasterizer_state_GetDesc1(ID3D11RasterizerState1 *iface, D3D11_RASTERIZER_DESC1 *desc)
Definition: state.c:1010
static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl
Definition: state.c:1129
static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_Release(ID3D10RasterizerState *iface)
Definition: state.c:1065
static void STDMETHODCALLTYPE d3d11_rasterizer_state_GetDesc(ID3D11RasterizerState1 *iface, D3D11_RASTERIZER_DESC *desc)
Definition: state.c:1000
static struct d3d_sampler_state * impl_from_ID3D10SamplerState(ID3D10SamplerState *iface)
Definition: state.c:1425
static HRESULT STDMETHODCALLTYPE d3d11_blend_state_SetPrivateDataInterface(ID3D11BlendState1 *iface, REFGUID guid, const IUnknown *data)
Definition: state.c:122
static void STDMETHODCALLTYPE d3d10_blend_state_GetDevice(ID3D10BlendState1 *iface, ID3D10Device **device)
Definition: state.c:220
static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_SetPrivateDataInterface(ID3D10RasterizerState *iface, REFGUID guid, const IUnknown *data)
Definition: state.c:1107
static HRESULT STDMETHODCALLTYPE d3d10_blend_state_QueryInterface(ID3D10BlendState1 *iface, REFIID riid, void **object)
Definition: state.c:190
static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateDataInterface(ID3D10BlendState1 *iface, REFGUID guid, const IUnknown *data)
Definition: state.c:251
struct d3d_depthstencil_state * unsafe_impl_from_ID3D11DepthStencilState(ID3D11DepthStencilState *iface)
Definition: state.c:870
static void STDMETHODCALLTYPE d3d11_rasterizer_state_GetDevice(ID3D11RasterizerState1 *iface, ID3D11Device **device)
Definition: state.c:959
static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc1(ID3D10BlendState1 *iface, D3D10_BLEND_DESC1 *desc)
Definition: state.c:295
struct d3d_depthstencil_state * unsafe_impl_from_ID3D10DepthStencilState(ID3D10DepthStencilState *iface)
Definition: state.c:879
static HRESULT STDMETHODCALLTYPE d3d11_blend_state_QueryInterface(ID3D11BlendState1 *iface, REFIID riid, void **object)
Definition: state.c:26
static HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3d_device *device, const D3D11_SAMPLER_DESC *desc)
Definition: state.c:1576
static void STDMETHODCALLTYPE d3d11_depthstencil_state_GetDevice(ID3D11DepthStencilState *iface, ID3D11Device **device)
Definition: state.c:553
static ULONG STDMETHODCALLTYPE d3d10_sampler_state_AddRef(ID3D10SamplerState *iface)
Definition: state.c:1442
static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDevice(ID3D10RasterizerState *iface, ID3D10Device **device)
Definition: state.c:1076
HRESULT d3d_sampler_state_create(struct d3d_device *device, const D3D11_SAMPLER_DESC *desc, struct d3d_sampler_state **state)
Definition: state.c:1627
static void STDMETHODCALLTYPE d3d11_blend_state_GetDesc(ID3D11BlendState1 *iface, D3D11_BLEND_DESC *desc)
Definition: state.c:132
static HRESULT STDMETHODCALLTYPE d3d11_sampler_state_SetPrivateData(ID3D11SamplerState *iface, REFGUID guid, UINT data_size, const void *data)
Definition: state.c:1378
static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_SetPrivateData(ID3D10DepthStencilState *iface, REFGUID guid, UINT data_size, const void *data)
Definition: state.c:678
static HRESULT STDMETHODCALLTYPE d3d11_sampler_state_SetPrivateDataInterface(ID3D11SamplerState *iface, REFGUID guid, const IUnknown *data)
Definition: state.c:1388
static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_AddRef(ID3D11DepthStencilState *iface)
Definition: state.c:519
static const struct wined3d_parent_ops d3d_blend_state_wined3d_parent_ops
Definition: state.c:331
static void STDMETHODCALLTYPE d3d_depthstencil_state_wined3d_object_destroyed(void *parent)
Definition: state.c:726
static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_state_SetPrivateData(ID3D11DepthStencilState *iface, REFGUID guid, UINT data_size, const void *data)
Definition: state.c:574
static HRESULT STDMETHODCALLTYPE d3d11_rasterizer_state_QueryInterface(ID3D11RasterizerState1 *iface, REFIID riid, void **object)
Definition: state.c:895
static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_state_QueryInterface(ID3D11DepthStencilState *iface, REFIID riid, void **object)
Definition: state.c:489
static const struct ID3D11SamplerStateVtbl d3d11_sampler_state_vtbl
Definition: state.c:1408
static enum wined3d_cull wined3d_cull_from_d3d11(D3D11_CULL_MODE mode)
Definition: state.c:1164
static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_state_GetPrivateData(ID3D11DepthStencilState *iface, REFGUID guid, UINT *data_size, void *data)
Definition: state.c:564
static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc(ID3D10BlendState1 *iface, D3D10_BLEND_DESC *desc)
Definition: state.c:273
static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_AddRef(ID3D10RasterizerState *iface)
Definition: state.c:1056
struct d3d_blend_state * unsafe_impl_from_ID3D10BlendState(ID3D10BlendState *iface)
Definition: state.c:478
static const struct ID3D10BlendState1Vtbl d3d10_blend_state_vtbl
Definition: state.c:304
static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDesc(ID3D10RasterizerState *iface, D3D10_RASTERIZER_DESC *desc)
Definition: state.c:1119
static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDesc(ID3D10DepthStencilState *iface, D3D10_DEPTH_STENCIL_DESC *desc)
Definition: state.c:701
static enum wined3d_texture_address wined3d_texture_address_from_d3d11(enum D3D11_TEXTURE_ADDRESS_MODE t)
Definition: state.c:1545
static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_QueryInterface(ID3D10RasterizerState *iface, REFIID riid, void **object)
Definition: state.c:1046
static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_QueryInterface(ID3D10DepthStencilState *iface, REFIID riid, void **object)
Definition: state.c:628
static enum wined3d_texture_filter_type wined3d_texture_filter_mag_from_d3d11(enum D3D11_FILTER f)
Definition: state.c:1557
struct d3d_sampler_state * unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface)
Definition: state.c:1691
static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDevice(ID3D10DepthStencilState *iface, ID3D10Device **device)
Definition: state.c:658
HRESULT d3d_depthstencil_state_create(struct d3d_device *device, const D3D11_DEPTH_STENCIL_DESC *desc, struct d3d_depthstencil_state **state)
Definition: state.c:751
static struct d3d_blend_state * impl_from_ID3D10BlendState(ID3D10BlendState1 *iface)
Definition: state.c:183
static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateData(ID3D10BlendState1 *iface, REFGUID guid, UINT data_size, const void *data)
Definition: state.c:240
static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState1 *iface)
Definition: state.c:209
static HRESULT STDMETHODCALLTYPE d3d11_blend_state_SetPrivateData(ID3D11BlendState1 *iface, REFGUID guid, UINT data_size, const void *data)
Definition: state.c:112
UINT op
Definition: effect.c:235
ULONG CDECL wined3d_blend_state_incref(struct wined3d_blend_state *state)
Definition: device.c:268
ULONG CDECL wined3d_depth_stencil_state_decref(struct wined3d_depth_stencil_state *state)
Definition: device.c:359
HRESULT CDECL wined3d_rasterizer_state_create(struct wined3d_device *device, const struct wined3d_rasterizer_state_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rasterizer_state **state)
Definition: device.c:470
ULONG CDECL wined3d_blend_state_decref(struct wined3d_blend_state *state)
Definition: device.c:284
HRESULT CDECL wined3d_blend_state_create(struct wined3d_device *device, const struct wined3d_blend_state_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_blend_state **state)
Definition: device.c:313
ULONG CDECL wined3d_rasterizer_state_incref(struct wined3d_rasterizer_state *state)
Definition: device.c:430
HRESULT CDECL wined3d_depth_stencil_state_create(struct wined3d_device *device, const struct wined3d_depth_stencil_state_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_depth_stencil_state **state)
Definition: device.c:404
ULONG CDECL wined3d_depth_stencil_state_incref(struct wined3d_depth_stencil_state *state)
Definition: device.c:343
ULONG CDECL wined3d_rasterizer_state_decref(struct wined3d_rasterizer_state *state)
Definition: device.c:446
GUID guid
Definition: version.c:147
#define assert(_expr)
Definition: assert.h:32
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble t
Definition: gl.h:2047
GLenum func
Definition: glext.h:6028
GLfloat f
Definition: glext.h:7540
GLenum mode
Definition: glext.h:6217
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint factor
Definition: glfuncs.h:178
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
unsigned int UINT
Definition: sysinfo.c:13
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_guid
Definition: kernel32.h:35
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define calloc
Definition: rosglue.h:14
ULONG CDECL wined3d_sampler_incref(struct wined3d_sampler *sampler)
Definition: sampler.c:26
HRESULT CDECL wined3d_sampler_create(struct wined3d_device *device, const struct wined3d_sampler_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_sampler **sampler)
Definition: sampler.c:287
ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler)
Definition: sampler.c:35
#define wine_rb_entry
Definition: rbtree.h:404
#define WINE_RB_ENTRY_VALUE
Definition: rbtree.h:414
#define wine_rb_put
Definition: rbtree.h:410
#define wine_rb_get
Definition: rbtree.h:409
#define wine_rb_remove
Definition: rbtree.h:411
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
BOOL AlphaToCoverageEnable
Definition: d3d11_1.idl:96
BOOL IndependentBlendEnable
Definition: d3d11_1.idl:97
D3D11_RENDER_TARGET_BLEND_DESC1 RenderTarget[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT]
Definition: d3d11_1.idl:98
Definition: scsiwmi.h:51
ID3D10BlendState1 ID3D10BlendState1_iface
ID3D10DepthStencilState ID3D10DepthStencilState_iface
ID3D10RasterizerState ID3D10RasterizerState_iface
ID3D11RasterizerState1 ID3D11RasterizerState1_iface
ID3D10SamplerState ID3D10SamplerState_iface
ID3D11SamplerState ID3D11SamplerState_iface
Definition: devices.h:37
struct wined3d_blend_state_desc::wined3d_rendertarget_blend_state_desc rt[WINED3D_MAX_RENDER_TARGETS]
struct wined3d_stencil_op_desc front
Definition: wined3d.h:2067
enum wined3d_cmp_func depth_func
Definition: wined3d.h:2063
struct wined3d_stencil_op_desc back
Definition: wined3d.h:2068
enum wined3d_fill_mode fill_mode
Definition: wined3d.h:2073
enum wined3d_cull cull_mode
Definition: wined3d.h:2074
enum wined3d_texture_address address_v
Definition: wined3d.h:2087
enum wined3d_cmp_func comparison_func
Definition: wined3d.h:2099
unsigned int max_anisotropy
Definition: wined3d.h:2097
enum wined3d_texture_filter_type mag_filter
Definition: wined3d.h:2090
enum wined3d_texture_filter_type min_filter
Definition: wined3d.h:2091
enum wined3d_texture_address address_u
Definition: wined3d.h:2086
float border_color[4]
Definition: wined3d.h:2089
unsigned int mip_base_level
Definition: wined3d.h:2096
enum wined3d_texture_filter_type mip_filter
Definition: wined3d.h:2092
enum wined3d_texture_address address_w
Definition: wined3d.h:2088
#define max(a, b)
Definition: svc.c:63
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
wined3d_blend_op
Definition: wined3d.h:441
static void wined3d_private_store_cleanup(struct wined3d_private_store *store)
Definition: wined3d.h:2636
wined3d_texture_filter_type
Definition: wined3d.h:704
@ WINED3D_TEXF_POINT
Definition: wined3d.h:706
@ WINED3D_TEXF_LINEAR
Definition: wined3d.h:707
wined3d_texture_address
Definition: wined3d.h:657
wined3d_cmp_func
Definition: wined3d.h:460
static void wined3d_private_store_init(struct wined3d_private_store *store)
Definition: wined3d.h:2607
wined3d_blend
Definition: wined3d.h:418
wined3d_fill_mode
Definition: wined3d.h:494
wined3d_stencil_op
Definition: wined3d.h:508
wined3d_cull
Definition: wined3d.h:501
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:544
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:539
#define E_NOINTERFACE
Definition: winerror.h:3479