1 /**************************************************************************
3 * Copyright 2010 Luca Barbieri
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial
15 * portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
21 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 **************************************************************************/
27 template<typename Base = ID3D11DeviceChild>
28 struct GalliumD3D11DeviceChild : public GalliumPrivateDataComObject<Base, dual_refcnt_t>
30 GalliumD3D11Screen* device; // must not be null
33 // if this is called, the subclass constructor must set device itself
34 GalliumD3D11DeviceChild()
38 GalliumD3D11DeviceChild(GalliumD3D11Screen* p_device)
40 // we store the reference count minus one in refcnt
45 /* The purpose of this is to avoid cyclic garbage, since this won't hold
46 * a pointer to the device if it is only held by a pipeline binding in the immediate context
48 * TODO: we could only manipulate the device refcnt when atomic_refcnt == 0 changes,
49 * but this requires more complex atomic ops
51 inline ULONG add_ref()
54 return GalliumPrivateDataComObject<Base, dual_refcnt_t>::add_ref();
57 inline ULONG release()
60 return GalliumPrivateDataComObject<Base, dual_refcnt_t>::release();
63 virtual ULONG STDMETHODCALLTYPE AddRef()
68 virtual ULONG STDMETHODCALLTYPE Release()
73 virtual void STDMETHODCALLTYPE GetDevice(
74 ID3D11Device **out_device
82 template<typename Base = ID3D11DeviceChild, typename Object = void>
83 struct GalliumD3D11Object : public GalliumD3D11DeviceChild<Base>
86 GalliumD3D11Object(GalliumD3D11Screen* device, Object* object)
87 : GalliumD3D11DeviceChild<Base>(device), object(object)
90 virtual ~GalliumD3D11Object();
93 #define IMPLEMENT_OBJECT_DTOR(name, gallium) \
95 GalliumD3D11Object<ID3D11##name, void>::~GalliumD3D11Object() \
97 DX10_ONLY(device->Unbind##name(this)); \
98 device->immediate_pipe->delete_##gallium##_state(device->immediate_pipe, object); \
101 #define IMPLEMENT_VIEW_DTOR(name, gallium) \
103 GalliumD3D11Object<ID3D11##name, struct pipe_##gallium>::~GalliumD3D11Object() \
105 DX10_ONLY(device->Unbind##name(this)); \
106 pipe_##gallium##_reference(&object, 0); \
109 IMPLEMENT_OBJECT_DTOR(InputLayout, vertex_elements)
110 IMPLEMENT_OBJECT_DTOR(DepthStencilState, depth_stencil_alpha)
111 IMPLEMENT_OBJECT_DTOR(RasterizerState, rasterizer)
112 IMPLEMENT_OBJECT_DTOR(SamplerState, sampler)
113 IMPLEMENT_OBJECT_DTOR(BlendState, blend)
114 IMPLEMENT_OBJECT_DTOR(VertexShader, vs)
115 IMPLEMENT_OBJECT_DTOR(PixelShader, fs)
116 IMPLEMENT_OBJECT_DTOR(GeometryShader, gs)
118 IMPLEMENT_VIEW_DTOR(ShaderResourceView, sampler_view)
119 IMPLEMENT_VIEW_DTOR(RenderTargetView, surface)
120 IMPLEMENT_VIEW_DTOR(DepthStencilView, surface)
123 // IMPLEMENT_VIEW_DTOR(UnorderedAccessView, surface);
124 // IMPLEMENT_OBJECT_DTOR(HullShader, tcs);
125 // IMPLEMENT_OBJECT_DTOR(DomainShader, tes);
126 // IMPLEMENT_OBJECT_DTOR(ComputeShader, cs);
128 IMPLEMENT_OBJECT_DTOR(BlendState1, blend)
129 IMPLEMENT_VIEW_DTOR(ShaderResourceView1, sampler_view)
132 template<typename Base, typename Desc, typename Object = void>
133 struct GalliumD3D11DescribedObject : public GalliumD3D11Object<Base, Object>
136 GalliumD3D11DescribedObject(GalliumD3D11Screen* device, Object* object, const Desc& desc)
137 : GalliumD3D11Object<Base, Object>(device, object), desc(desc)
140 virtual void STDMETHODCALLTYPE GetDesc(Desc *out_desc)
142 memcpy(out_desc, &desc, sizeof(desc));
146 typedef GalliumD3D11Object<ID3D11InputLayout> GalliumD3D11InputLayout;
147 typedef GalliumD3D11DescribedObject<ID3D11DepthStencilState, D3D11_DEPTH_STENCIL_DESC> GalliumD3D11DepthStencilState;
148 typedef GalliumD3D11DescribedObject<ID3D11RasterizerState, D3D11_RASTERIZER_DESC> GalliumD3D11RasterizerStateBase;
149 typedef GalliumD3D11DescribedObject<ID3D11SamplerState, D3D11_SAMPLER_DESC> GalliumD3D11SamplerState;
152 typedef GalliumD3D11DescribedObject<ID3D11BlendState, D3D11_BLEND_DESC> GalliumD3D11BlendState;
154 typedef GalliumD3D10DescribedObject<ID3D10BlendState1, D3D10_BLEND_DESC> GalliumD3D10BlendStateBase;
156 struct GalliumD3D10BlendState : public GalliumD3D10BlendStateBase
158 static D3D10_BLEND_DESC convert_to_d3d10(const D3D10_BLEND_DESC1& desc1)
160 D3D10_BLEND_DESC desc;
161 desc.AlphaToCoverageEnable = desc1.AlphaToCoverageEnable;
162 desc.SrcBlend = desc1.RenderTarget[0].SrcBlend;
163 desc.DestBlend = desc1.RenderTarget[0].DestBlend;
164 desc.BlendOp = desc1.RenderTarget[0].BlendOp;
165 desc.SrcBlendAlpha = desc1.RenderTarget[0].SrcBlendAlpha;
166 desc.DestBlendAlpha = desc1.RenderTarget[0].DestBlendAlpha;
167 desc.BlendOpAlpha = desc1.RenderTarget[0].BlendOpAlpha;
168 for(unsigned i = 0; i < 8; ++i)
170 desc.BlendEnable[i] = desc1.RenderTarget[i].BlendEnable;
171 desc.RenderTargetWriteMask[i] = desc1.RenderTarget[i].RenderTargetWriteMask;
176 D3D10_BLEND_DESC1 desc1;
178 GalliumD3D10BlendState(GalliumD3D10Screen* device, void* object, const D3D10_BLEND_DESC& desc)
179 : GalliumD3D10BlendStateBase(device, object, desc)
181 memset(&desc1, 0, sizeof(desc1));
182 desc1.AlphaToCoverageEnable = desc.AlphaToCoverageEnable;
183 desc1.RenderTarget[0].SrcBlend = desc.SrcBlend;
184 desc1.RenderTarget[0].DestBlend = desc.DestBlend;
185 desc1.RenderTarget[0].BlendOp = desc.BlendOp;
186 desc1.RenderTarget[0].SrcBlendAlpha = desc.SrcBlendAlpha;
187 desc1.RenderTarget[0].DestBlendAlpha = desc.DestBlendAlpha;
188 desc1.RenderTarget[0].BlendOpAlpha = desc.BlendOpAlpha;
189 for(unsigned i = 0; i < 8; ++i)
191 desc1.RenderTarget[i].BlendEnable = desc.BlendEnable[i];
192 desc1.RenderTarget[i].RenderTargetWriteMask = desc.RenderTargetWriteMask[i];
196 GalliumD3D10BlendState(GalliumD3D10Screen* device, void* object, const D3D10_BLEND_DESC1& desc)
197 : GalliumD3D10BlendStateBase(device, object, convert_to_d3d10(desc)), desc1(desc1)
200 virtual void STDMETHODCALLTYPE GetDesc1(D3D10_BLEND_DESC1 *out_desc)
202 memcpy(out_desc, &desc1, sizeof(desc1));
207 struct GalliumD3D11RasterizerState : public GalliumD3D11RasterizerStateBase
211 GalliumD3D11RasterizerState(GalliumD3D11Screen* device, void* object, const D3D11_RASTERIZER_DESC& desc, bool depth_clamp)
212 : GalliumD3D11RasterizerStateBase(device, object, desc), depth_clamp(depth_clamp)
216 template<typename Base = ID3D11DeviceChild>
217 struct GalliumD3D11Shader : public GalliumD3D11Object<Base>
219 std::vector<int> slot_to_resource;
220 std::vector<int> slot_to_sampler;
222 GalliumD3D11Shader(GalliumD3D11Screen* device, void* object)
223 : GalliumD3D11Object<Base>(device, object)
227 typedef GalliumD3D11Shader<ID3D11VertexShader> GalliumD3D11VertexShader;
228 typedef GalliumD3D11Shader<ID3D11GeometryShader> GalliumD3D11GeometryShader;
229 typedef GalliumD3D11Shader<ID3D11PixelShader> GalliumD3D11PixelShader;
233 typedef GalliumD3D11Shader<ID3D11HullShader> GalliumD3D11HullShader;
234 typedef GalliumD3D11Shader<ID3D11DomainShader> GalliumD3D11DomainShader;
235 typedef GalliumD3D11Shader<ID3D11ComputeShader> GalliumD3D11ComputeShader;
239 template<typename Base = ID3D11Resource>
240 struct GalliumD3D11ResourceBase : public GalliumD3D11DeviceChild<Base>
242 unsigned eviction_priority;
244 virtual void STDMETHODCALLTYPE SetEvictionPriority(
245 unsigned new_eviction_priority
248 eviction_priority = new_eviction_priority;
251 virtual unsigned STDMETHODCALLTYPE GetEvictionPriority()
253 return eviction_priority;
257 template<typename Real>
258 struct GalliumDXGIResource : public IDXGIResource
260 virtual HRESULT STDMETHODCALLTYPE SetEvictionPriority(
261 unsigned new_eviction_priority
264 static_cast<Real*>(this)->eviction_priority = new_eviction_priority;
268 virtual HRESULT STDMETHODCALLTYPE GetEvictionPriority(unsigned* out_eviction_priority)
270 *out_eviction_priority = static_cast<Real*>(this)->eviction_priority;
274 virtual HRESULT STDMETHODCALLTYPE GetDevice(
278 if(!static_cast<Real*>(this)->device)
279 return E_NOINTERFACE;
280 return static_cast<Real*>(this)->device->QueryInterface(riid, out_parent);
283 virtual HRESULT STDMETHODCALLTYPE GetParent(
287 if(!static_cast<Real*>(this)->device)
288 return E_NOINTERFACE;
289 return static_cast<Real*>(this)->device->QueryInterface(riid, out_parent);
294 struct com_traits<GalliumDXGIResource<T> > : public com_traits<IDXGIResource>
297 template<typename Base = ID3D11Resource>
298 struct GalliumD3D11Resource
299 : public GalliumMultiComObject<
300 GalliumMultiPrivateDataComObject<
301 GalliumD3D11ResourceBase<Base>,
302 GalliumDXGIResource<GalliumD3D11Resource<Base> >
307 struct pipe_resource* resource;
308 std::unordered_map<unsigned, pipe_transfer*> transfers;
310 DXGI_USAGE dxgi_usage;
312 GalliumD3D11Resource(GalliumD3D11Screen* device = 0, struct pipe_resource* resource = 0, unsigned dxgi_usage = 0)
313 : resource(resource), min_lod(0), dxgi_usage(dxgi_usage)
315 this->device = device;
318 this->eviction_priority = 0;
321 ~GalliumD3D11Resource()
323 pipe_resource_reference(&resource, 0);
326 virtual HRESULT STDMETHODCALLTYPE GetUsage(
327 DXGI_USAGE *out_usage
330 *out_usage = this->dxgi_usage;
334 virtual HRESULT STDMETHODCALLTYPE GetSharedHandle(HANDLE *out_shared_handle)
339 virtual struct pipe_resource* STDMETHODCALLTYPE GetGalliumResource()
345 template<typename Base, typename Desc, D3D11_RESOURCE_DIMENSION Dim>
346 struct GalliumD3D11TypedResource : public GalliumD3D11Resource<Base>
349 GalliumD3D11TypedResource() {}
350 GalliumD3D11TypedResource(GalliumD3D11Screen* device, struct pipe_resource* resource, const Desc& desc, unsigned dxgi_usage)
351 : GalliumD3D11Resource<Base>(device, resource, dxgi_usage), desc(desc)
353 virtual void STDMETHODCALLTYPE GetType(
354 D3D11_RESOURCE_DIMENSION *out_resource_dimension)
356 *out_resource_dimension = Dim;
358 virtual void STDMETHODCALLTYPE GetDesc(Desc *out_desc)
360 memcpy(out_desc, &desc, sizeof(desc));
364 typedef GalliumD3D11TypedResource<ID3D11Texture1D, D3D11_TEXTURE1D_DESC, D3D11_RESOURCE_DIMENSION_TEXTURE1D> GalliumD3D11Texture1DBase;
365 typedef GalliumD3D11TypedResource<ID3D11Texture2D, D3D11_TEXTURE2D_DESC, D3D11_RESOURCE_DIMENSION_TEXTURE2D> GalliumD3D11Texture2DBase;
366 typedef GalliumD3D11TypedResource<ID3D11Texture3D, D3D11_TEXTURE3D_DESC, D3D11_RESOURCE_DIMENSION_TEXTURE3D> GalliumD3D11Texture3DBase;
367 typedef GalliumD3D11TypedResource<ID3D11Buffer, D3D11_BUFFER_DESC, D3D11_RESOURCE_DIMENSION_BUFFER> GalliumD3D11BufferBase;
370 typedef GalliumD3D11BufferBase GalliumD3D11Buffer;
371 typedef GalliumD3D11Texture1DBase GalliumD3D11Texture1D;
372 typedef GalliumD3D11Texture2DBase GalliumD3D11Texture2D;
373 typedef GalliumD3D11Texture3DBase GalliumD3D11Texture3D;
375 struct GalliumD3D10Buffer : public GalliumD3D10BufferBase
377 GalliumD3D10Buffer(GalliumD3D10Screen* device, struct pipe_resource* resource, const D3D10_BUFFER_DESC& desc, unsigned dxgi_usage)
378 : GalliumD3D10BufferBase(device, resource, desc, dxgi_usage)
381 ~GalliumD3D10Buffer()
383 device->UnbindBuffer(this);
386 virtual HRESULT STDMETHODCALLTYPE Map(
391 D3D10_MAPPED_SUBRESOURCE msr;
392 HRESULT hr = device->Map(this, 0, map_type, map_flags, &msr);
395 *out_data = msr.pData;
399 virtual void STDMETHODCALLTYPE Unmap()
401 device->Unmap(this, 0);
405 struct GalliumD3D10Texture1D : public GalliumD3D10Texture1DBase
407 GalliumD3D10Texture1D(GalliumD3D10Screen* device, struct pipe_resource* resource, const D3D10_TEXTURE1D_DESC& desc, unsigned dxgi_usage)
408 : GalliumD3D10Texture1DBase(device, resource, desc, dxgi_usage)
411 virtual HRESULT STDMETHODCALLTYPE Map(
412 unsigned subresource,
417 D3D10_MAPPED_SUBRESOURCE msr;
418 HRESULT hr = device->Map(this, subresource, map_type, map_flags, &msr);
421 *out_data = msr.pData;
425 virtual void STDMETHODCALLTYPE Unmap(
429 device->Unmap(this, subresource);
433 struct GalliumD3D10Texture2D : public GalliumD3D10Texture2DBase
435 GalliumD3D10Texture2D() {}
436 GalliumD3D10Texture2D(GalliumD3D10Screen* device, struct pipe_resource* resource, const D3D10_TEXTURE2D_DESC& desc, unsigned dxgi_usage)
437 : GalliumD3D10Texture2DBase(device, resource, desc, dxgi_usage)
440 virtual HRESULT STDMETHODCALLTYPE Map(
441 unsigned subresource,
444 D3D10_MAPPED_TEXTURE2D *out_mapped_subresource)
446 D3D10_MAPPED_SUBRESOURCE msr;
447 HRESULT hr = device->Map(this, subresource, map_type, map_flags, &msr);
450 out_mapped_subresource->pData = msr.pData;
451 out_mapped_subresource->RowPitch = msr.RowPitch;
455 virtual void STDMETHODCALLTYPE Unmap(
459 device->Unmap(this, subresource);
464 struct GalliumD3D10Texture3D : public GalliumD3D10Texture3DBase
466 GalliumD3D10Texture3D(GalliumD3D10Screen* device, struct pipe_resource* resource, const D3D10_TEXTURE3D_DESC& desc, unsigned dxgi_usage)
467 : GalliumD3D10Texture3DBase(device, resource, desc, dxgi_usage)
470 virtual HRESULT STDMETHODCALLTYPE Map(
471 unsigned subresource,
474 D3D10_MAPPED_TEXTURE3D *out_mapped_subresource)
476 D3D10_MAPPED_SUBRESOURCE msr;
477 HRESULT hr = device->Map(this, subresource, map_type, map_flags, &msr);
480 out_mapped_subresource->pData = msr.pData;
481 out_mapped_subresource->RowPitch = msr.RowPitch;
482 out_mapped_subresource->DepthPitch = msr.DepthPitch;
486 virtual void STDMETHODCALLTYPE Unmap(
490 device->Unmap(this, subresource);
495 struct GalliumD3D11Surface : public GalliumMultiPrivateDataComObject<GalliumD3D11Texture2D, IDXGISurface1>
497 GalliumD3D11Surface(GalliumD3D11Screen* device, struct pipe_resource* resource, const D3D11_TEXTURE2D_DESC& desc, unsigned dxgi_usage)
499 this->device = device;
500 this->device->AddRef();
501 this->resource = resource;
503 this->dxgi_usage = dxgi_usage;
506 virtual HRESULT STDMETHODCALLTYPE GetDesc(
507 DXGI_SURFACE_DESC *out_desc)
509 out_desc->Format = this->desc.Format;
510 out_desc->Width = this->desc.Width;
511 out_desc->Height = this->desc.Height;
512 out_desc->SampleDesc = this->desc.SampleDesc;
516 virtual HRESULT STDMETHODCALLTYPE GetParent(
521 return E_NOINTERFACE;
522 return device->QueryInterface(riid, out_parent);
525 /* TODO: somehow implement these */
526 virtual HRESULT STDMETHODCALLTYPE GetDC(
534 virtual HRESULT STDMETHODCALLTYPE ReleaseDC(
535 RECT *out_dirty_rect)
540 virtual HRESULT STDMETHODCALLTYPE Map(
541 DXGI_MAPPED_RECT *out_locked_rect,
545 if(map_flags & DXGI_MAP_DISCARD)
546 d3d_map = D3D11_MAP_WRITE_DISCARD;
549 if(map_flags & DXGI_MAP_READ)
551 if(map_flags & DXGI_MAP_WRITE)
552 d3d_map = D3D11_MAP_READ_WRITE;
554 d3d_map = D3D11_MAP_READ;
557 d3d_map = D3D11_MAP_WRITE;
559 D3D11_MAPPED_SUBRESOURCE d3d_mapped;
560 HRESULT hres = this->device->get_immediate_context()->Map(this, 0, d3d_map, 0, &d3d_mapped);
561 out_locked_rect->pBits = (uint8_t*)d3d_mapped.pData;
562 out_locked_rect->Pitch = d3d_mapped.RowPitch;
566 virtual HRESULT STDMETHODCALLTYPE Unmap(void)
568 this->device->get_immediate_context()->Unmap(this, 0);
572 virtual HRESULT STDMETHODCALLTYPE GetDevice(
577 return E_NOINTERFACE;
578 return device->QueryInterface(riid, out_parent);
582 template<typename Base, typename Desc, typename Object>
583 struct GalliumD3D11View : public GalliumD3D11DescribedObject<Base, Desc, Object>
585 GalliumD3D11Resource<>* resource;
586 GalliumD3D11View(GalliumD3D11Screen* device, GalliumD3D11Resource<>* resource, Object* object, const Desc& desc)
587 : GalliumD3D11DescribedObject<Base, Desc, Object>(device, object, desc), resource(resource)
597 virtual void STDMETHODCALLTYPE GetResource(ID3D11Resource** out_resource)
600 *out_resource = resource;
604 typedef GalliumD3D11View<ID3D11DepthStencilView, D3D11_DEPTH_STENCIL_VIEW_DESC, struct pipe_surface> GalliumD3D11DepthStencilView;
605 typedef GalliumD3D11View<ID3D11RenderTargetView, D3D11_RENDER_TARGET_VIEW_DESC, struct pipe_surface> GalliumD3D11RenderTargetView;
608 typedef GalliumD3D11View<ID3D11ShaderResourceView, D3D11_SHADER_RESOURCE_VIEW_DESC, struct pipe_sampler_view> GalliumD3D11ShaderResourceView;
610 typedef GalliumD3D10View<ID3D10ShaderResourceView1, D3D10_SHADER_RESOURCE_VIEW_DESC1, struct pipe_sampler_view> GalliumD3D10ShaderResourceViewBase;
612 struct GalliumD3D10ShaderResourceView : public GalliumD3D10ShaderResourceViewBase
614 GalliumD3D10ShaderResourceView(GalliumD3D10Screen* device, GalliumD3D10Resource<>* resource, struct pipe_sampler_view* view, const D3D10_SHADER_RESOURCE_VIEW_DESC1& desc)
615 : GalliumD3D10ShaderResourceViewBase(device, resource, view, desc)
618 virtual void STDMETHODCALLTYPE GetDesc1(D3D10_SHADER_RESOURCE_VIEW_DESC1 *out_desc)
620 memcpy(out_desc, &desc, sizeof(*out_desc));
623 virtual void STDMETHODCALLTYPE GetDesc(D3D10_SHADER_RESOURCE_VIEW_DESC *out_desc)
625 memcpy(out_desc, &desc, sizeof(*out_desc));
630 template<typename Base = ID3D11Asynchronous>
631 struct GalliumD3D11Asynchronous : public GalliumD3D11DeviceChild<Base>
633 struct pipe_query* query;
636 GalliumD3D11Asynchronous(GalliumD3D11Screen* device, struct pipe_query* query, unsigned data_size)
637 : GalliumD3D11DeviceChild<Base>(device), query(query), data_size(data_size)
640 ~GalliumD3D11Asynchronous()
642 this->device->immediate_pipe->destroy_query(this->device->immediate_pipe, query);
645 virtual unsigned STDMETHODCALLTYPE GetDataSize()
651 virtual void STDMETHODCALLTYPE Begin()
653 this->device->Begin(this);
656 virtual void STDMETHODCALLTYPE End()
658 this->device->End(this);
661 virtual HRESULT STDMETHODCALLTYPE GetData(
664 unsigned get_data_flags)
666 return this->device->GetData(this, out_data, data_size, get_data_flags);
671 template<typename Base = ID3D11Asynchronous>
672 struct GalliumD3D11QueryOrPredicate : public GalliumD3D11Asynchronous<Base>
674 D3D11_QUERY_DESC desc;
675 GalliumD3D11QueryOrPredicate(GalliumD3D11Screen* device, struct pipe_query* query, unsigned data_size, const D3D11_QUERY_DESC& desc)
676 : GalliumD3D11Asynchronous<Base>(device, query, data_size), desc(desc)
679 virtual void STDMETHODCALLTYPE GetDesc(
680 D3D11_QUERY_DESC *out_desc)
686 struct GalliumD3D11Query : public GalliumD3D11QueryOrPredicate<ID3D11Query>
688 GalliumD3D11Query(GalliumD3D11Screen* device, struct pipe_query* query, unsigned data_size, const D3D11_QUERY_DESC& desc)
689 : GalliumD3D11QueryOrPredicate<ID3D11Query>(device, query, data_size, desc)
693 struct GalliumD3D11Predicate : public GalliumD3D11QueryOrPredicate<ID3D11Predicate>
695 GalliumD3D11Predicate(GalliumD3D11Screen* device, struct pipe_query* query, unsigned data_size, const D3D11_QUERY_DESC& desc)
696 : GalliumD3D11QueryOrPredicate<ID3D11Predicate>(device, query, data_size, desc)
699 ~GalliumD3D11Predicate()
701 DX10_ONLY(device->UnbindPredicate(this));
705 struct GalliumD3D11Counter : public GalliumD3D11Asynchronous<ID3D11Counter>
707 D3D11_COUNTER_DESC desc;
708 GalliumD3D11Counter(GalliumD3D11Screen* device, struct pipe_query* query, unsigned data_size, const D3D11_COUNTER_DESC& desc)
709 : GalliumD3D11Asynchronous<ID3D11Counter>(device, query, data_size), desc(desc)
712 virtual void STDMETHODCALLTYPE GetDesc(
713 D3D11_COUNTER_DESC *out_desc)