Added API function call type specification to fix c/c++ mismatch on x86 MSVC
assiduous
3 years ago
47 | 47 | const Char* Path, |
48 | 48 | EFileAccessMode Access = EFileAccessMode::Read); |
49 | 49 | |
50 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
50 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
51 | 51 | |
52 | 52 | /// Reads data from the stream |
53 | virtual void ReadBlob(IDataBlob* pData) override; | |
53 | virtual void DILIGENT_CALL_TYPE ReadBlob(IDataBlob* pData) override; | |
54 | 54 | |
55 | 55 | /// Reads data from the stream |
56 | virtual bool Read(void* Data, size_t Size) override; | |
56 | virtual bool DILIGENT_CALL_TYPE Read(void* Data, size_t Size) override; | |
57 | 57 | |
58 | 58 | /// Writes data to the stream |
59 | virtual bool Write(const void* Data, size_t Size) override; | |
59 | virtual bool DILIGENT_CALL_TYPE Write(const void* Data, size_t Size) override; | |
60 | 60 | |
61 | virtual size_t GetSize() override; | |
61 | virtual size_t DILIGENT_CALL_TYPE GetSize() override; | |
62 | 62 | |
63 | virtual bool IsValid() override; | |
63 | virtual bool DILIGENT_CALL_TYPE IsValid() override; | |
64 | 64 | |
65 | 65 | private: |
66 | 66 | FileWrapper m_FileWrpr; |
45 | 45 | |
46 | 46 | DataBlobImpl(IReferenceCounters* pRefCounters, size_t InitialSize = 0); |
47 | 47 | |
48 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
48 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
49 | 49 | |
50 | 50 | /// Sets the size of the internal data buffer |
51 | virtual void Resize(size_t NewSize) override; | |
51 | virtual void DILIGENT_CALL_TYPE Resize(size_t NewSize) override; | |
52 | 52 | |
53 | 53 | /// Returns the size of the internal data buffer |
54 | virtual size_t GetSize() override; | |
54 | virtual size_t DILIGENT_CALL_TYPE GetSize() override; | |
55 | 55 | |
56 | 56 | /// Returns the pointer to the internal data buffer |
57 | virtual void* GetDataPtr() override; | |
57 | virtual void* DILIGENT_CALL_TYPE GetDataPtr() override; | |
58 | 58 | |
59 | 59 | private: |
60 | 60 | std::vector<Uint8> m_DataBuff; |
47 | 47 | MemoryFileStream(IReferenceCounters* pRefCounters, |
48 | 48 | IDataBlob* pData); |
49 | 49 | |
50 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
50 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
51 | 51 | |
52 | 52 | /// Reads data from the stream |
53 | virtual void ReadBlob(IDataBlob* pData) override; | |
53 | virtual void DILIGENT_CALL_TYPE ReadBlob(IDataBlob* pData) override; | |
54 | 54 | |
55 | 55 | /// Reads data from the stream |
56 | virtual bool Read(void* Data, size_t Size) override; | |
56 | virtual bool DILIGENT_CALL_TYPE Read(void* Data, size_t Size) override; | |
57 | 57 | |
58 | 58 | /// Writes data to the stream |
59 | virtual bool Write(const void* Data, size_t Size) override; | |
59 | virtual bool DILIGENT_CALL_TYPE Write(const void* Data, size_t Size) override; | |
60 | 60 | |
61 | virtual size_t GetSize() override; | |
61 | virtual size_t DILIGENT_CALL_TYPE GetSize() override; | |
62 | 62 | |
63 | virtual bool IsValid() override; | |
63 | virtual bool DILIGENT_CALL_TYPE IsValid() override; | |
64 | 64 | |
65 | 65 | private: |
66 | 66 | RefCntAutoPtr<IDataBlob> m_DataBlob; |
55 | 55 | void ClassName::QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) \ |
56 | 56 | IMPLEMENT_QUERY_INTERFACE_BODY(InterfaceID, ParentClassName) |
57 | 57 | |
58 | #define IMPLEMENT_QUERY_INTERFACE_IN_PLACE(InterfaceID, ParentClassName) \ | |
59 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override \ | |
58 | #define IMPLEMENT_QUERY_INTERFACE_IN_PLACE(InterfaceID, ParentClassName) \ | |
59 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override \ | |
60 | 60 | IMPLEMENT_QUERY_INTERFACE_BODY(InterfaceID, ParentClassName) |
61 | 61 | |
62 | 62 | |
69 | 69 | RefCountedObject<BaseInterface>{pRefCounters} |
70 | 70 | {} |
71 | 71 | |
72 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) | |
72 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) | |
73 | 73 | { |
74 | 74 | if (ppInterface == nullptr) |
75 | 75 | return; |
524 | 524 | // "There remain strong references to the object being destroyed" ); |
525 | 525 | } |
526 | 526 | |
527 | inline virtual IReferenceCounters* GetReferenceCounters() const override final | |
527 | inline virtual IReferenceCounters* DILIGENT_CALL_TYPE GetReferenceCounters() const override final | |
528 | 528 | { |
529 | 529 | VERIFY_EXPR(m_pRefCounters != nullptr); |
530 | 530 | return m_pRefCounters; |
531 | 531 | } |
532 | 532 | |
533 | inline virtual ReferenceCounterValueType AddRef() override final | |
533 | inline virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef() override final | |
534 | 534 | { |
535 | 535 | VERIFY_EXPR(m_pRefCounters != nullptr); |
536 | 536 | // Since type of m_pRefCounters is RefCountersImpl, |
538 | 538 | return m_pRefCounters->AddStrongRef(); |
539 | 539 | } |
540 | 540 | |
541 | inline virtual ReferenceCounterValueType Release() override | |
541 | inline virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release() override | |
542 | 542 | { |
543 | 543 | VERIFY_EXPR(m_pRefCounters != nullptr); |
544 | 544 | // Since type of m_pRefCounters is RefCountersImpl, |
53 | 53 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_DataBlob, TBase) |
54 | 54 | |
55 | 55 | /// Sets the size of the internal data buffer |
56 | virtual void Resize(size_t NewSize) override | |
56 | virtual void DILIGENT_CALL_TYPE Resize(size_t NewSize) override | |
57 | 57 | { |
58 | 58 | m_String.resize(NewSize); |
59 | 59 | } |
60 | 60 | |
61 | 61 | /// Returns the size of the internal data buffer |
62 | virtual size_t GetSize() override | |
62 | virtual size_t DILIGENT_CALL_TYPE GetSize() override | |
63 | 63 | { |
64 | 64 | return m_String.length(); |
65 | 65 | } |
66 | 66 | |
67 | 67 | /// Returns the pointer to the internal data buffer |
68 | virtual void* GetDataPtr() override | |
68 | virtual void* DILIGENT_CALL_TYPE GetDataPtr() override | |
69 | 69 | { |
70 | 70 | return &m_String[0]; |
71 | 71 | } |
120 | 120 | |
121 | 121 | /// Implementation of IBuffer::CreateView(); calls CreateViewInternal() virtual function |
122 | 122 | /// that creates buffer view for the specific engine implementation. |
123 | virtual void CreateView(const struct BufferViewDesc& ViewDesc, IBufferView** ppView) override; | |
123 | virtual void DILIGENT_CALL_TYPE CreateView(const struct BufferViewDesc& ViewDesc, IBufferView** ppView) override; | |
124 | 124 | |
125 | 125 | /// Implementation of IBuffer::GetDefaultView(). |
126 | virtual IBufferView* GetDefaultView(BUFFER_VIEW_TYPE ViewType) override; | |
126 | virtual IBufferView* DILIGENT_CALL_TYPE GetDefaultView(BUFFER_VIEW_TYPE ViewType) override; | |
127 | 127 | |
128 | 128 | /// Creates default buffer views. |
129 | 129 | |
134 | 134 | /// The function calls CreateViewInternal(). |
135 | 135 | void CreateDefaultViews(); |
136 | 136 | |
137 | virtual void SetState(RESOURCE_STATE State) override final | |
137 | virtual void DILIGENT_CALL_TYPE SetState(RESOURCE_STATE State) override final | |
138 | 138 | { |
139 | 139 | this->m_State = State; |
140 | 140 | } |
141 | 141 | |
142 | virtual RESOURCE_STATE GetState() const override final | |
142 | virtual RESOURCE_STATE DILIGENT_CALL_TYPE GetState() const override final | |
143 | 143 | { |
144 | 144 | return this->m_State; |
145 | 145 | } |
75 | 75 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_BufferView, TDeviceObjectBase) |
76 | 76 | |
77 | 77 | /// Implementation of IBufferView::GetBuffer() |
78 | virtual IBuffer* GetBuffer() override final | |
78 | virtual IBuffer* DILIGENT_CALL_TYPE GetBuffer() override final | |
79 | 79 | { |
80 | 80 | return m_pBuffer; |
81 | 81 | } |
96 | 96 | |
97 | 97 | /// Base implementation of IDeviceContext::SetVertexBuffers(); validates parameters and |
98 | 98 | /// caches references to the buffers. |
99 | inline virtual void SetVertexBuffers(Uint32 StartSlot, | |
100 | Uint32 NumBuffersSet, | |
101 | IBuffer** ppBuffers, | |
102 | Uint32* pOffsets, | |
103 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, | |
104 | SET_VERTEX_BUFFERS_FLAGS Flags) override = 0; | |
105 | ||
106 | inline virtual void InvalidateState() override = 0; | |
99 | inline virtual void DILIGENT_CALL_TYPE SetVertexBuffers(Uint32 StartSlot, | |
100 | Uint32 NumBuffersSet, | |
101 | IBuffer** ppBuffers, | |
102 | Uint32* pOffsets, | |
103 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, | |
104 | SET_VERTEX_BUFFERS_FLAGS Flags) override = 0; | |
105 | ||
106 | inline virtual void DILIGENT_CALL_TYPE InvalidateState() override = 0; | |
107 | 107 | |
108 | 108 | /// Base implementation of IDeviceContext::CommitShaderResources(); validates parameters. |
109 | 109 | inline bool CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, |
111 | 111 | int); |
112 | 112 | |
113 | 113 | /// Base implementation of IDeviceContext::SetIndexBuffer(); caches the strong reference to the index buffer |
114 | inline virtual void SetIndexBuffer(IBuffer* pIndexBuffer, Uint32 ByteOffset, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override = 0; | |
114 | inline virtual void DILIGENT_CALL_TYPE SetIndexBuffer(IBuffer* pIndexBuffer, Uint32 ByteOffset, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override = 0; | |
115 | 115 | |
116 | 116 | /// Caches the viewports |
117 | 117 | inline void SetViewports(Uint32 NumViewports, const Viewport* pViewports, Uint32& RTWidth, Uint32& RTHeight); |
124 | 124 | inline bool SetRenderTargets(Uint32 NumRenderTargets, ITextureView* ppRenderTargets[], ITextureView* pDepthStencil); |
125 | 125 | |
126 | 126 | /// Base implementation of IDeviceContext::UpdateBuffer(); validates input parameters. |
127 | virtual void UpdateBuffer(IBuffer* pBuffer, Uint32 Offset, Uint32 Size, const void* pData, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override = 0; | |
127 | virtual void DILIGENT_CALL_TYPE UpdateBuffer(IBuffer* pBuffer, | |
128 | Uint32 Offset, | |
129 | Uint32 Size, | |
130 | const void* pData, | |
131 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override = 0; | |
128 | 132 | |
129 | 133 | /// Base implementation of IDeviceContext::CopyBuffer(); validates input parameters. |
130 | virtual void CopyBuffer(IBuffer* pSrcBuffer, | |
131 | Uint32 SrcOffset, | |
132 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
133 | IBuffer* pDstBuffer, | |
134 | Uint32 DstOffset, | |
135 | Uint32 Size, | |
136 | RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode) override = 0; | |
134 | virtual void DILIGENT_CALL_TYPE CopyBuffer(IBuffer* pSrcBuffer, | |
135 | Uint32 SrcOffset, | |
136 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
137 | IBuffer* pDstBuffer, | |
138 | Uint32 DstOffset, | |
139 | Uint32 Size, | |
140 | RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode) override = 0; | |
137 | 141 | |
138 | 142 | /// Base implementation of IDeviceContext::MapBuffer(); validates input parameters. |
139 | virtual void MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData) override = 0; | |
143 | virtual void DILIGENT_CALL_TYPE MapBuffer(IBuffer* pBuffer, | |
144 | MAP_TYPE MapType, | |
145 | MAP_FLAGS MapFlags, | |
146 | PVoid& pMappedData) override = 0; | |
140 | 147 | |
141 | 148 | /// Base implementation of IDeviceContext::UnmapBuffer() |
142 | virtual void UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType) override = 0; | |
149 | virtual void DILIGENT_CALL_TYPE UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType) override = 0; | |
143 | 150 | |
144 | 151 | /// Base implementaiton of IDeviceContext::UpdateData(); validates input parameters |
145 | virtual void UpdateTexture(ITexture* pTexture, | |
146 | Uint32 MipLevel, | |
147 | Uint32 Slice, | |
148 | const Box& DstBox, | |
149 | const TextureSubResData& SubresData, | |
150 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
151 | RESOURCE_STATE_TRANSITION_MODE TextureTransitionMode) override = 0; | |
152 | virtual void DILIGENT_CALL_TYPE UpdateTexture(ITexture* pTexture, | |
153 | Uint32 MipLevel, | |
154 | Uint32 Slice, | |
155 | const Box& DstBox, | |
156 | const TextureSubResData& SubresData, | |
157 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
158 | RESOURCE_STATE_TRANSITION_MODE TextureTransitionMode) override = 0; | |
152 | 159 | |
153 | 160 | /// Base implementaiton of IDeviceContext::CopyTexture(); validates input parameters |
154 | virtual void CopyTexture(const CopyTextureAttribs& CopyAttribs) override = 0; | |
161 | virtual void DILIGENT_CALL_TYPE CopyTexture(const CopyTextureAttribs& CopyAttribs) override = 0; | |
155 | 162 | |
156 | 163 | /// Base implementaiton of IDeviceContext::MapTextureSubresource() |
157 | virtual void MapTextureSubresource(ITexture* pTexture, | |
158 | Uint32 MipLevel, | |
159 | Uint32 ArraySlice, | |
160 | MAP_TYPE MapType, | |
161 | MAP_FLAGS MapFlags, | |
162 | const Box* pMapRegion, | |
163 | MappedTextureSubresource& MappedData) override = 0; | |
164 | virtual void DILIGENT_CALL_TYPE MapTextureSubresource(ITexture* pTexture, | |
165 | Uint32 MipLevel, | |
166 | Uint32 ArraySlice, | |
167 | MAP_TYPE MapType, | |
168 | MAP_FLAGS MapFlags, | |
169 | const Box* pMapRegion, | |
170 | MappedTextureSubresource& MappedData) override = 0; | |
164 | 171 | |
165 | 172 | /// Base implementaiton of IDeviceContext::UnmapTextureSubresource() |
166 | virtual void UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice) override = 0; | |
167 | ||
168 | virtual void GenerateMips(ITextureView* pTexView) override = 0; | |
169 | ||
170 | virtual void ResolveTextureSubresource(ITexture* pSrcTexture, | |
171 | ITexture* pDstTexture, | |
172 | const ResolveTextureSubresourceAttribs& ResolveAttribs) override = 0; | |
173 | virtual void DILIGENT_CALL_TYPE UnmapTextureSubresource(ITexture* pTexture, | |
174 | Uint32 MipLevel, | |
175 | Uint32 ArraySlice) override = 0; | |
176 | ||
177 | virtual void DILIGENT_CALL_TYPE GenerateMips(ITextureView* pTexView) override = 0; | |
178 | ||
179 | virtual void DILIGENT_CALL_TYPE ResolveTextureSubresource(ITexture* pSrcTexture, | |
180 | ITexture* pDstTexture, | |
181 | const ResolveTextureSubresourceAttribs& ResolveAttribs) override = 0; | |
173 | 182 | |
174 | 183 | /// Returns currently bound pipeline state and blend factors |
175 | 184 | inline void GetPipelineState(IPipelineState** ppPSO, float* BlendFactors, Uint32& StencilRef); |
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
110 | inline virtual Atomics::Long Release() override final | |
110 | inline virtual Atomics::Long DILIGENT_CALL_TYPE Release() override final | |
111 | 111 | { |
112 | 112 | // Render device owns allocators for all types of device objects, |
113 | 113 | // so it must be destroyed after all device objects are released. |
136 | 136 | |
137 | 137 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_DeviceObject, TBase) |
138 | 138 | |
139 | virtual const ObjectDescType& GetDesc() const override final | |
139 | virtual const ObjectDescType& DILIGENT_CALL_TYPE GetDesc() const override final | |
140 | 140 | { |
141 | 141 | return m_Desc; |
142 | 142 | } |
143 | 143 | |
144 | 144 | /// Returns unique identifier |
145 | virtual Int32 GetUniqueID() const override final | |
145 | virtual Int32 DILIGENT_CALL_TYPE GetUniqueID() const override final | |
146 | 146 | { |
147 | 147 | /// \note |
148 | 148 | /// This unique ID is used to unambiguously identify device object for |
55 | 55 | { |
56 | 56 | } |
57 | 57 | |
58 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final | |
58 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final | |
59 | 59 | { |
60 | 60 | if (ppInterface == nullptr) |
61 | 61 | return; |
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | virtual ReferenceCounterValueType AddRef() override final | |
71 | virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef() override final | |
72 | 72 | { |
73 | 73 | return m_RefCounters.AddStrongRef(); |
74 | 74 | } |
75 | 75 | |
76 | virtual ReferenceCounterValueType Release() override final | |
76 | virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release() override final | |
77 | 77 | { |
78 | 78 | return m_RefCounters.ReleaseStrongRef(); |
79 | 79 | } |
80 | 80 | |
81 | virtual IReferenceCounters* GetReferenceCounters() const override final | |
81 | virtual IReferenceCounters* DILIGENT_CALL_TYPE GetReferenceCounters() const override final | |
82 | 82 | { |
83 | 83 | return const_cast<IReferenceCounters*>(static_cast<const IReferenceCounters*>(&m_RefCounters)); |
84 | 84 | } |
85 | 85 | |
86 | virtual const APIInfo& GetAPIInfo() const override final | |
86 | virtual const APIInfo& DILIGENT_CALL_TYPE GetAPIInfo() const override final | |
87 | 87 | { |
88 | 88 | return Diligent::GetAPIInfo(); |
89 | 89 | } |
90 | 90 | |
91 | virtual void CreateDefaultShaderSourceStreamFactory(const Char* SearchDirectories, | |
92 | IShaderSourceInputStreamFactory** ppShaderSourceFactory) const override final | |
91 | virtual void DILIGENT_CALL_TYPE CreateDefaultShaderSourceStreamFactory(const Char* SearchDirectories, | |
92 | IShaderSourceInputStreamFactory** ppShaderSourceFactory) const override final | |
93 | 93 | { |
94 | 94 | Diligent::CreateDefaultShaderSourceStreamFactory(SearchDirectories, ppShaderSourceFactory); |
95 | 95 | } |
106 | 106 | |
107 | 107 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_Query, TDeviceObjectBase) |
108 | 108 | |
109 | virtual void Invalidate() override | |
109 | virtual void DILIGENT_CALL_TYPE Invalidate() override | |
110 | 110 | { |
111 | 111 | m_State = QueryState::Inactive; |
112 | 112 | } |
312 | 312 | |
313 | 313 | // It is important to have final implementation of Release() method to avoid |
314 | 314 | // virtual calls |
315 | inline virtual ReferenceCounterValueType Release() override final | |
315 | inline virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release() override final | |
316 | 316 | { |
317 | 317 | return TObjectBase::Release(); |
318 | 318 | } |
319 | 319 | |
320 | 320 | /// Implementation of IRenderDevice::CreateResourceMapping(). |
321 | virtual void CreateResourceMapping(const ResourceMappingDesc& MappingDesc, IResourceMapping** ppMapping) override final; | |
321 | virtual void DILIGENT_CALL_TYPE CreateResourceMapping(const ResourceMappingDesc& MappingDesc, IResourceMapping** ppMapping) override final; | |
322 | 322 | |
323 | 323 | /// Implementation of IRenderDevice::GetDeviceCaps(). |
324 | virtual const DeviceCaps& GetDeviceCaps() const override final | |
324 | virtual const DeviceCaps& DILIGENT_CALL_TYPE GetDeviceCaps() const override final | |
325 | 325 | { |
326 | 326 | return m_DeviceCaps; |
327 | 327 | } |
328 | 328 | |
329 | 329 | /// Implementation of IRenderDevice::GetTextureFormatInfo(). |
330 | virtual const TextureFormatInfo& GetTextureFormatInfo(TEXTURE_FORMAT TexFormat) override final | |
330 | virtual const TextureFormatInfo& DILIGENT_CALL_TYPE GetTextureFormatInfo(TEXTURE_FORMAT TexFormat) override final | |
331 | 331 | { |
332 | 332 | VERIFY(TexFormat >= TEX_FORMAT_UNKNOWN && TexFormat < TEX_FORMAT_NUM_FORMATS, "Texture format out of range"); |
333 | 333 | const auto& TexFmtInfo = m_TextureFormatsInfo[TexFormat]; |
336 | 336 | } |
337 | 337 | |
338 | 338 | /// Implementation of IRenderDevice::GetTextureFormatInfoExt(). |
339 | virtual const TextureFormatInfoExt& GetTextureFormatInfoExt(TEXTURE_FORMAT TexFormat) override final | |
339 | virtual const TextureFormatInfoExt& DILIGENT_CALL_TYPE GetTextureFormatInfoExt(TEXTURE_FORMAT TexFormat) override final | |
340 | 340 | { |
341 | 341 | VERIFY(TexFormat >= TEX_FORMAT_UNKNOWN && TexFormat < TEX_FORMAT_NUM_FORMATS, "Texture format out of range"); |
342 | 342 | const auto& TexFmtInfo = m_TextureFormatsInfo[TexFormat]; |
350 | 350 | return TexFmtInfo; |
351 | 351 | } |
352 | 352 | |
353 | virtual IEngineFactory* GetEngineFactory() const override final | |
353 | virtual IEngineFactory* DILIGENT_CALL_TYPE GetEngineFactory() const override final | |
354 | 354 | { |
355 | 355 | return m_pEngineFactory.RawPtr<IEngineFactory>(); |
356 | 356 | } |
108 | 108 | |
109 | 109 | ~ResourceMappingImpl(); |
110 | 110 | |
111 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
111 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
112 | 112 | |
113 | 113 | /// Implementation of IResourceMapping::AddResource() |
114 | virtual void AddResource(const Char* Name, IDeviceObject* pObject, bool bIsUnique) override final; | |
114 | virtual void DILIGENT_CALL_TYPE AddResource(const Char* Name, | |
115 | IDeviceObject* pObject, | |
116 | bool bIsUnique) override final; | |
115 | 117 | |
116 | 118 | /// Implementation of IResourceMapping::AddResourceArray() |
117 | virtual void AddResourceArray(const Char* Name, Uint32 StartIndex, IDeviceObject* const* ppObjects, Uint32 NumElements, bool bIsUnique) override final; | |
119 | virtual void DILIGENT_CALL_TYPE AddResourceArray(const Char* Name, | |
120 | Uint32 StartIndex, | |
121 | IDeviceObject* const* ppObjects, | |
122 | Uint32 NumElements, | |
123 | bool bIsUnique) override final; | |
118 | 124 | |
119 | 125 | /// Implementation of IResourceMapping::RemoveResourceByName() |
120 | virtual void RemoveResourceByName(const Char* Name, Uint32 ArrayIndex) override final; | |
126 | virtual void DILIGENT_CALL_TYPE RemoveResourceByName(const Char* Name, Uint32 ArrayIndex) override final; | |
121 | 127 | |
122 | 128 | /// Implementation of IResourceMapping::GetResource() |
123 | virtual void GetResource(const Char* Name, IDeviceObject** ppResource, Uint32 ArrayIndex) override final; | |
129 | virtual void DILIGENT_CALL_TYPE GetResource(const Char* Name, | |
130 | IDeviceObject** ppResource, | |
131 | Uint32 ArrayIndex) override final; | |
124 | 132 | |
125 | 133 | /// Returns number of resources in the resource mapping. |
126 | virtual size_t GetSize() override final; | |
134 | virtual size_t DILIGENT_CALL_TYPE GetSize() override final; | |
127 | 135 | |
128 | 136 | private: |
129 | 137 | ThreadingTools::LockHelper Lock(); |
61 | 61 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_ShaderResourceBinding, TObjectBase) |
62 | 62 | |
63 | 63 | /// Implementation of IShaderResourceBinding::GetPipelineState(). |
64 | virtual IPipelineState* GetPipelineState() override final | |
64 | virtual IPipelineState* DILIGENT_CALL_TYPE GetPipelineState() override final | |
65 | 65 | { |
66 | 66 | return m_pPSO; |
67 | 67 | } |
343 | 343 | { |
344 | 344 | } |
345 | 345 | |
346 | void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final | |
346 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final | |
347 | 347 | { |
348 | 348 | if (ppInterface == nullptr) |
349 | 349 | return; |
356 | 356 | } |
357 | 357 | } |
358 | 358 | |
359 | virtual Atomics::Long AddRef() override final | |
359 | virtual Atomics::Long DILIGENT_CALL_TYPE AddRef() override final | |
360 | 360 | { |
361 | 361 | return m_ParentResLayout.GetOwner().AddRef(); |
362 | 362 | } |
363 | 363 | |
364 | virtual Atomics::Long Release() override final | |
364 | virtual Atomics::Long DILIGENT_CALL_TYPE Release() override final | |
365 | 365 | { |
366 | 366 | return m_ParentResLayout.GetOwner().Release(); |
367 | 367 | } |
368 | 368 | |
369 | virtual IReferenceCounters* GetReferenceCounters() const override final | |
369 | virtual IReferenceCounters* DILIGENT_CALL_TYPE GetReferenceCounters() const override final | |
370 | 370 | { |
371 | 371 | return m_ParentResLayout.GetOwner().GetReferenceCounters(); |
372 | 372 | } |
83 | 83 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_SwapChain, TObjectBase) |
84 | 84 | |
85 | 85 | /// Implementation of ISwapChain::GetDesc() |
86 | virtual const SwapChainDesc& GetDesc() const override final | |
86 | virtual const SwapChainDesc& DILIGENT_CALL_TYPE GetDesc() const override final | |
87 | 87 | { |
88 | 88 | return m_SwapChainDesc; |
89 | 89 | } |
130 | 130 | |
131 | 131 | /// Implementaiton of ITexture::CreateView(); calls CreateViewInternal() virtual function that |
132 | 132 | /// creates texture view for the specific engine implementation. |
133 | virtual void CreateView(const struct TextureViewDesc& ViewDesc, ITextureView** ppView) override | |
133 | virtual void DILIGENT_CALL_TYPE CreateView(const struct TextureViewDesc& ViewDesc, ITextureView** ppView) override | |
134 | 134 | { |
135 | 135 | DEV_CHECK_ERR(ViewDesc.ViewType != TEXTURE_VIEW_UNDEFINED, "Texture view type is not specified"); |
136 | 136 | if (ViewDesc.ViewType == TEXTURE_VIEW_SHADER_RESOURCE) |
158 | 158 | /// The function calls CreateViewInternal(). |
159 | 159 | void CreateDefaultViews(); |
160 | 160 | |
161 | virtual void SetState(RESOURCE_STATE State) override final | |
161 | virtual void DILIGENT_CALL_TYPE SetState(RESOURCE_STATE State) override final | |
162 | 162 | { |
163 | 163 | this->m_State = State; |
164 | 164 | } |
165 | 165 | |
166 | virtual RESOURCE_STATE GetState() const override final | |
166 | virtual RESOURCE_STATE DILIGENT_CALL_TYPE GetState() const override final | |
167 | 167 | { |
168 | 168 | return this->m_State; |
169 | 169 | } |
181 | 181 | } |
182 | 182 | |
183 | 183 | /// Implementation of ITexture::GetDefaultView(). |
184 | virtual ITextureView* GetDefaultView(TEXTURE_VIEW_TYPE ViewType) override | |
184 | virtual ITextureView* DILIGENT_CALL_TYPE GetDefaultView(TEXTURE_VIEW_TYPE ViewType) override | |
185 | 185 | { |
186 | 186 | switch (ViewType) |
187 | 187 | { |
76 | 76 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_TextureView, TDeviceObjectBase) |
77 | 77 | |
78 | 78 | /// Implementation of ITextureView::SetSampler() |
79 | virtual void SetSampler(ISampler* pSampler) override final | |
79 | virtual void DILIGENT_CALL_TYPE SetSampler(ISampler* pSampler) override final | |
80 | 80 | { |
81 | 81 | #ifdef DEVELOPMENT |
82 | 82 | if (this->m_Desc.ViewType != TEXTURE_VIEW_SHADER_RESOURCE) |
86 | 86 | } |
87 | 87 | |
88 | 88 | /// Implementation of ITextureView::GetSampler() |
89 | virtual ISampler* GetSampler() override final | |
89 | virtual ISampler* DILIGENT_CALL_TYPE GetSampler() override final | |
90 | 90 | { |
91 | 91 | return m_pSampler; |
92 | 92 | } |
97 | 97 | } |
98 | 98 | |
99 | 99 | /// Implementation of ITextureView::GetTexture() |
100 | virtual ITexture* GetTexture() override final | |
100 | virtual ITexture* DILIGENT_CALL_TYPE GetTexture() override final | |
101 | 101 | { |
102 | 102 | return m_pTexture; |
103 | 103 | } |
104 | 104 | |
105 | const ITexture* GetTexture() const | |
105 | const ITexture* DILIGENT_CALL_TYPE GetTexture() const | |
106 | 106 | { |
107 | 107 | return m_pTexture; |
108 | 108 | } |
186 | 186 | { |
187 | 187 | #if DILIGENT_CPP_INTERFACE |
188 | 188 | /// Returns the buffer description used to create the object |
189 | virtual const BufferDesc& GetDesc() const override = 0; | |
189 | virtual const BufferDesc& METHOD(GetDesc)() const override = 0; | |
190 | 190 | #endif |
191 | 191 | |
192 | 192 | /// Creates a new buffer view |
155 | 155 | { |
156 | 156 | #if DILIGENT_CPP_INTERFACE |
157 | 157 | /// Returns the buffer view description used to create the object |
158 | virtual const BufferViewDesc& GetDesc() const override = 0; | |
158 | virtual const BufferViewDesc& METHOD(GetDesc)() const override = 0; | |
159 | 159 | #endif |
160 | 160 | |
161 | 161 | /// Returns pointer to the referenced buffer object. |
62 | 62 | { |
63 | 63 | #if DILIGENT_CPP_INTERFACE |
64 | 64 | /// Returns the fence description used to create the object |
65 | virtual const FenceDesc& GetDesc() const override = 0; | |
65 | virtual const FenceDesc& METHOD(GetDesc)() const override = 0; | |
66 | 66 | #endif |
67 | 67 | |
68 | 68 | /// Returns the last completed value signaled by the GPU |
267 | 267 | { |
268 | 268 | #if DILIGENT_CPP_INTERFACE |
269 | 269 | /// Returns the blend state description used to create the object |
270 | virtual const PipelineStateDesc& GetDesc()const override = 0; | |
270 | virtual const PipelineStateDesc& METHOD(GetDesc)()const override = 0; | |
271 | 271 | #endif |
272 | 272 | |
273 | 273 |
187 | 187 | { |
188 | 188 | #if DILIGENT_CPP_INTERFACE |
189 | 189 | /// Returns the Query description used to create the object. |
190 | virtual const QueryDesc& GetDesc() const override = 0; | |
190 | virtual const QueryDesc& METHOD(GetDesc)() const override = 0; | |
191 | 191 | #endif |
192 | 192 | |
193 | 193 | /// Gets the query data. |
192 | 192 | { |
193 | 193 | #if DILIGENT_CPP_INTERFACE |
194 | 194 | /// Returns the sampler description used to create the object |
195 | virtual const SamplerDesc& GetDesc() const override = 0; | |
195 | virtual const SamplerDesc& METHOD(GetDesc)() const override = 0; | |
196 | 196 | #endif |
197 | 197 | }; |
198 | 198 | DILIGENT_END_INTERFACE |
321 | 321 | { |
322 | 322 | #if DILIGENT_CPP_INTERFACE |
323 | 323 | /// Returns the shader description |
324 | virtual const ShaderDesc& GetDesc() const override = 0; | |
324 | virtual const ShaderDesc& METHOD(GetDesc)() const override = 0; | |
325 | 325 | #endif |
326 | 326 | |
327 | 327 | /// Returns the total number of shader resources |
319 | 319 | { |
320 | 320 | #if DILIGENT_CPP_INTERFACE |
321 | 321 | /// Returns the texture description used to create the object |
322 | virtual const TextureDesc& GetDesc()const override = 0; | |
322 | virtual const TextureDesc& METHOD(GetDesc)()const override = 0; | |
323 | 323 | #endif |
324 | 324 | |
325 | 325 | /// Creates a new texture view |
202 | 202 | { |
203 | 203 | #if DILIGENT_CPP_INTERFACE |
204 | 204 | /// Returns the texture view description used to create the object |
205 | virtual const TextureViewDesc& GetDesc() const override = 0; | |
205 | virtual const TextureViewDesc& METHOD(GetDesc)() const override = 0; | |
206 | 206 | #endif |
207 | 207 | |
208 | 208 | /// Sets the texture sampler to use for filtering operations |
39 | 39 | public: |
40 | 40 | DefaultShaderSourceStreamFactory(IReferenceCounters* pRefCounters, const Char* SearchDirectories); |
41 | 41 | |
42 | virtual void CreateInputStream(const Char* Name, IFileStream** ppStream) override final; | |
42 | virtual void DILIGENT_CALL_TYPE CreateInputStream(const Char* Name, IFileStream** ppStream) override final; | |
43 | 43 | |
44 | 44 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_IShaderSourceInputStreamFactory, ObjectBase<IShaderSourceInputStreamFactory>); |
45 | 45 |
61 | 61 | |
62 | 62 | ~BufferD3D11Impl(); |
63 | 63 | |
64 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
64 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
65 | 65 | |
66 | 66 | /// Implementation of IBufferD3D11::GetD3D11Buffer(). |
67 | virtual ID3D11Buffer* GetD3D11Buffer() override final { return m_pd3d11Buffer; } | |
67 | virtual ID3D11Buffer* DILIGENT_CALL_TYPE GetD3D11Buffer() override final { return m_pd3d11Buffer; } | |
68 | 68 | |
69 | 69 | /// Implementation of IBuffer::GetNativeHandle(). |
70 | virtual void* GetNativeHandle() override final { return GetD3D11Buffer(); } | |
70 | virtual void* DILIGENT_CALL_TYPE GetNativeHandle() override final { return GetD3D11Buffer(); } | |
71 | 71 | |
72 | 72 | void AddState(RESOURCE_STATE State) |
73 | 73 | { |
52 | 52 | ID3D11View* pD3D11View, |
53 | 53 | bool bIsDefaultView); |
54 | 54 | |
55 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) final; | |
55 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) final; | |
56 | 56 | |
57 | 57 | /// Implementation of IBufferViewD3D11::GetD3D11View(). |
58 | virtual ID3D11View* GetD3D11View() override final | |
58 | virtual ID3D11View* DILIGENT_CALL_TYPE GetD3D11View() override final | |
59 | 59 | { |
60 | 60 | return m_pD3D11View; |
61 | 61 | } |
68 | 68 | ID3D11DeviceContext* pd3d11DeviceContext, |
69 | 69 | const struct EngineD3D11CreateInfo& EngineAttribs, |
70 | 70 | bool bIsDeferred); |
71 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
71 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
72 | 72 | |
73 | 73 | /// Implementation of IDeviceContext::SetPipelineState() in Direct3D11 backend. |
74 | virtual void SetPipelineState(IPipelineState* pPipelineState) override final; | |
74 | virtual void DILIGENT_CALL_TYPE SetPipelineState(IPipelineState* pPipelineState) override final; | |
75 | 75 | |
76 | 76 | /// Implementation of IDeviceContext::TransitionShaderResources() in Direct3D11 backend. |
77 | virtual void TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding) override final; | |
77 | virtual void DILIGENT_CALL_TYPE TransitionShaderResources(IPipelineState* pPipelineState, | |
78 | IShaderResourceBinding* pShaderResourceBinding) override final; | |
78 | 79 | |
79 | 80 | /// Implementation of IDeviceContext::CommitShaderResources() in Direct3D11 backend. |
80 | virtual void CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
81 | virtual void DILIGENT_CALL_TYPE CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, | |
82 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
81 | 83 | |
82 | 84 | /// Implementation of IDeviceContext::SetStencilRef() in Direct3D11 backend. |
83 | virtual void SetStencilRef(Uint32 StencilRef) override final; | |
85 | virtual void DILIGENT_CALL_TYPE SetStencilRef(Uint32 StencilRef) override final; | |
84 | 86 | |
85 | 87 | /// Implementation of IDeviceContext::SetBlendFactors() in Direct3D11 backend. |
86 | virtual void SetBlendFactors(const float* pBlendFactors = nullptr) override final; | |
88 | virtual void DILIGENT_CALL_TYPE SetBlendFactors(const float* pBlendFactors = nullptr) override final; | |
87 | 89 | |
88 | 90 | /// Implementation of IDeviceContext::SetVertexBuffers() in Direct3D11 backend. |
89 | virtual void SetVertexBuffers(Uint32 StartSlot, | |
90 | Uint32 NumBuffersSet, | |
91 | IBuffer** ppBuffers, | |
92 | Uint32* pOffsets, | |
93 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, | |
94 | SET_VERTEX_BUFFERS_FLAGS Flags) override final; | |
91 | virtual void DILIGENT_CALL_TYPE SetVertexBuffers(Uint32 StartSlot, | |
92 | Uint32 NumBuffersSet, | |
93 | IBuffer** ppBuffers, | |
94 | Uint32* pOffsets, | |
95 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, | |
96 | SET_VERTEX_BUFFERS_FLAGS Flags) override final; | |
95 | 97 | |
96 | 98 | /// Implementation of IDeviceContext::InvalidateState() in Direct3D11 backend. |
97 | virtual void InvalidateState() override final; | |
99 | virtual void DILIGENT_CALL_TYPE InvalidateState() override final; | |
98 | 100 | |
99 | 101 | /// Implementation of IDeviceContext::SetIndexBuffer() in Direct3D11 backend. |
100 | virtual void SetIndexBuffer(IBuffer* pIndexBuffer, Uint32 ByteOffset, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
102 | virtual void DILIGENT_CALL_TYPE SetIndexBuffer(IBuffer* pIndexBuffer, | |
103 | Uint32 ByteOffset, | |
104 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
101 | 105 | |
102 | 106 | /// Implementation of IDeviceContext::SetViewports() in Direct3D11 backend. |
103 | virtual void SetViewports(Uint32 NumViewports, const Viewport* pViewports, Uint32 RTWidth, Uint32 RTHeight) override final; | |
107 | virtual void DILIGENT_CALL_TYPE SetViewports(Uint32 NumViewports, | |
108 | const Viewport* pViewports, | |
109 | Uint32 RTWidth, | |
110 | Uint32 RTHeight) override final; | |
104 | 111 | |
105 | 112 | /// Implementation of IDeviceContext::SetScissorRects() in Direct3D11 backend. |
106 | virtual void SetScissorRects(Uint32 NumRects, const Rect* pRects, Uint32 RTWidth, Uint32 RTHeight) override final; | |
113 | virtual void DILIGENT_CALL_TYPE SetScissorRects(Uint32 NumRects, | |
114 | const Rect* pRects, | |
115 | Uint32 RTWidth, | |
116 | Uint32 RTHeight) override final; | |
107 | 117 | |
108 | 118 | /// Implementation of IDeviceContext::SetRenderTargets() in Direct3D11 backend. |
109 | virtual void SetRenderTargets(Uint32 NumRenderTargets, | |
110 | ITextureView* ppRenderTargets[], | |
111 | ITextureView* pDepthStencil, | |
112 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
119 | virtual void DILIGENT_CALL_TYPE SetRenderTargets(Uint32 NumRenderTargets, | |
120 | ITextureView* ppRenderTargets[], | |
121 | ITextureView* pDepthStencil, | |
122 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
113 | 123 | |
114 | 124 | /// Implementation of IDeviceContext::Draw() in Direct3D11 backend. |
115 | virtual void Draw(const DrawAttribs& Attribs) override final; | |
125 | virtual void DILIGENT_CALL_TYPE Draw(const DrawAttribs& Attribs) override final; | |
116 | 126 | /// Implementation of IDeviceContext::DrawIndexed() in Direct3D11 backend. |
117 | virtual void DrawIndexed(const DrawIndexedAttribs& Attribs) override final; | |
127 | virtual void DILIGENT_CALL_TYPE DrawIndexed(const DrawIndexedAttribs& Attribs) override final; | |
118 | 128 | /// Implementation of IDeviceContext::DrawIndirect() in Direct3D11 backend. |
119 | virtual void DrawIndirect(const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
129 | virtual void DILIGENT_CALL_TYPE DrawIndirect(const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
120 | 130 | /// Implementation of IDeviceContext::DrawIndexedIndirect() in Direct3D11 backend. |
121 | virtual void DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
131 | virtual void DILIGENT_CALL_TYPE DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
122 | 132 | |
123 | 133 | /// Implementation of IDeviceContext::DispatchCompute() in Direct3D11 backend. |
124 | virtual void DispatchCompute(const DispatchComputeAttribs& Attribs) override final; | |
134 | virtual void DILIGENT_CALL_TYPE DispatchCompute(const DispatchComputeAttribs& Attribs) override final; | |
125 | 135 | /// Implementation of IDeviceContext::DispatchComputeIndirect() in Direct3D11 backend. |
126 | virtual void DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
136 | virtual void DILIGENT_CALL_TYPE DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
127 | 137 | |
128 | 138 | /// Implementation of IDeviceContext::ClearDepthStencil() in Direct3D11 backend. |
129 | virtual void ClearDepthStencil(ITextureView* pView, | |
130 | CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, | |
131 | float fDepth, | |
132 | Uint8 Stencil, | |
133 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
139 | virtual void DILIGENT_CALL_TYPE ClearDepthStencil(ITextureView* pView, | |
140 | CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, | |
141 | float fDepth, | |
142 | Uint8 Stencil, | |
143 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
134 | 144 | |
135 | 145 | /// Implementation of IDeviceContext::ClearRenderTarget() in Direct3D11 backend. |
136 | virtual void ClearRenderTarget(ITextureView* pView, const float* RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
146 | virtual void DILIGENT_CALL_TYPE ClearRenderTarget(ITextureView* pView, const float* RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
137 | 147 | |
138 | 148 | /// Implementation of IDeviceContext::UpdateBuffer() in Direct3D11 backend. |
139 | virtual void UpdateBuffer(IBuffer* pBuffer, | |
140 | Uint32 Offset, | |
141 | Uint32 Size, | |
142 | const void* pData, | |
143 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
149 | virtual void DILIGENT_CALL_TYPE UpdateBuffer(IBuffer* pBuffer, | |
150 | Uint32 Offset, | |
151 | Uint32 Size, | |
152 | const void* pData, | |
153 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
144 | 154 | |
145 | 155 | /// Implementation of IDeviceContext::CopyBuffer() in Direct3D11 backend. |
146 | virtual void CopyBuffer(IBuffer* pSrcBuffer, | |
147 | Uint32 SrcOffset, | |
148 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
149 | IBuffer* pDstBuffer, | |
150 | Uint32 DstOffset, | |
151 | Uint32 Size, | |
152 | RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode) override final; | |
156 | virtual void DILIGENT_CALL_TYPE CopyBuffer(IBuffer* pSrcBuffer, | |
157 | Uint32 SrcOffset, | |
158 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
159 | IBuffer* pDstBuffer, | |
160 | Uint32 DstOffset, | |
161 | Uint32 Size, | |
162 | RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode) override final; | |
153 | 163 | |
154 | 164 | /// Implementation of IDeviceContext::MapBuffer() in Direct3D11 backend. |
155 | virtual void MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData) override final; | |
165 | virtual void DILIGENT_CALL_TYPE MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData) override final; | |
156 | 166 | |
157 | 167 | /// Implementation of IDeviceContext::UnmapBuffer() in Direct3D11 backend. |
158 | virtual void UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType) override final; | |
168 | virtual void DILIGENT_CALL_TYPE UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType) override final; | |
159 | 169 | |
160 | 170 | /// Implementation of IDeviceContext::UpdateTexture() in Direct3D11 backend. |
161 | virtual void UpdateTexture(ITexture* pTexture, | |
162 | Uint32 MipLevel, | |
163 | Uint32 Slice, | |
164 | const Box& DstBox, | |
165 | const TextureSubResData& SubresData, | |
166 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
167 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
171 | virtual void DILIGENT_CALL_TYPE UpdateTexture(ITexture* pTexture, | |
172 | Uint32 MipLevel, | |
173 | Uint32 Slice, | |
174 | const Box& DstBox, | |
175 | const TextureSubResData& SubresData, | |
176 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
177 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
168 | 178 | |
169 | 179 | /// Implementation of IDeviceContext::CopyTexture() in Direct3D11 backend. |
170 | virtual void CopyTexture(const CopyTextureAttribs& CopyAttribs) override final; | |
180 | virtual void DILIGENT_CALL_TYPE CopyTexture(const CopyTextureAttribs& CopyAttribs) override final; | |
171 | 181 | |
172 | 182 | /// Implementation of IDeviceContext::MapTextureSubresource() in Direct3D11 backend. |
173 | virtual void MapTextureSubresource(ITexture* pTexture, | |
174 | Uint32 MipLevel, | |
175 | Uint32 ArraySlice, | |
176 | MAP_TYPE MapType, | |
177 | MAP_FLAGS MapFlags, | |
178 | const Box* pMapRegion, | |
179 | MappedTextureSubresource& MappedData) override final; | |
183 | virtual void DILIGENT_CALL_TYPE MapTextureSubresource(ITexture* pTexture, | |
184 | Uint32 MipLevel, | |
185 | Uint32 ArraySlice, | |
186 | MAP_TYPE MapType, | |
187 | MAP_FLAGS MapFlags, | |
188 | const Box* pMapRegion, | |
189 | MappedTextureSubresource& MappedData) override final; | |
180 | 190 | |
181 | 191 | /// Implementation of IDeviceContext::UnmapTextureSubresource() in Direct3D11 backend. |
182 | virtual void UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice) override final; | |
192 | virtual void DILIGENT_CALL_TYPE UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice) override final; | |
183 | 193 | |
184 | 194 | /// Implementation of IDeviceContext::GenerateMips() in Direct3D11 backend. |
185 | virtual void GenerateMips(ITextureView* pTextureView) override final; | |
195 | virtual void DILIGENT_CALL_TYPE GenerateMips(ITextureView* pTextureView) override final; | |
186 | 196 | |
187 | 197 | /// Implementation of IDeviceContext::FinishFrame() in Direct3D11 backend. |
188 | virtual void FinishFrame() override final; | |
198 | virtual void DILIGENT_CALL_TYPE FinishFrame() override final; | |
189 | 199 | |
190 | 200 | /// Implementation of IDeviceContext::TransitionResourceStates() in Direct3D11 backend. |
191 | virtual void TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers) override final; | |
201 | virtual void DILIGENT_CALL_TYPE TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers) override final; | |
192 | 202 | |
193 | 203 | /// Implementation of IDeviceContext::ResolveTextureSubresource() in Direct3D11 backend. |
194 | virtual void ResolveTextureSubresource(ITexture* pSrcTexture, | |
195 | ITexture* pDstTexture, | |
196 | const ResolveTextureSubresourceAttribs& ResolveAttribs) override final; | |
204 | virtual void DILIGENT_CALL_TYPE ResolveTextureSubresource(ITexture* pSrcTexture, | |
205 | ITexture* pDstTexture, | |
206 | const ResolveTextureSubresourceAttribs& ResolveAttribs) override final; | |
197 | 207 | |
198 | 208 | /// Implementation of IDeviceContext::FinishCommandList() in Direct3D11 backend. |
199 | void FinishCommandList(class ICommandList** ppCommandList) override final; | |
209 | void DILIGENT_CALL_TYPE FinishCommandList(class ICommandList** ppCommandList) override final; | |
200 | 210 | |
201 | 211 | /// Implementation of IDeviceContext::ExecuteCommandList() in Direct3D11 backend. |
202 | virtual void ExecuteCommandList(class ICommandList* pCommandList) override final; | |
212 | virtual void DILIGENT_CALL_TYPE ExecuteCommandList(class ICommandList* pCommandList) override final; | |
203 | 213 | |
204 | 214 | /// Implementation of IDeviceContext::SignalFence() in Direct3D11 backend. |
205 | virtual void SignalFence(IFence* pFence, Uint64 Value) override final; | |
215 | virtual void DILIGENT_CALL_TYPE SignalFence(IFence* pFence, Uint64 Value) override final; | |
206 | 216 | |
207 | 217 | /// Implementation of IDeviceContext::WaitForFence() in Direct3D11 backend. |
208 | virtual void WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext) override final; | |
218 | virtual void DILIGENT_CALL_TYPE WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext) override final; | |
209 | 219 | |
210 | 220 | /// Implementation of IDeviceContext::WaitForIdle() in Direct3D11 backend. |
211 | virtual void WaitForIdle() override final; | |
221 | virtual void DILIGENT_CALL_TYPE WaitForIdle() override final; | |
212 | 222 | |
213 | 223 | /// Implementation of IDeviceContext::BeginQuery() in Direct3D11 backend. |
214 | virtual void BeginQuery(IQuery* pQuery) override final; | |
224 | virtual void DILIGENT_CALL_TYPE BeginQuery(IQuery* pQuery) override final; | |
215 | 225 | |
216 | 226 | /// Implementation of IDeviceContext::EndQuery() in Direct3D11 backend. |
217 | virtual void EndQuery(IQuery* pQuery) override final; | |
227 | virtual void DILIGENT_CALL_TYPE EndQuery(IQuery* pQuery) override final; | |
218 | 228 | |
219 | 229 | /// Implementation of IDeviceContext::Flush() in Direct3D11 backend. |
220 | virtual void Flush() override final; | |
230 | virtual void DILIGENT_CALL_TYPE Flush() override final; | |
221 | 231 | |
222 | 232 | /// Implementation of IDeviceContextD3D11::GetD3D11DeviceContext(). |
223 | virtual ID3D11DeviceContext* GetD3D11DeviceContext() override final { return m_pd3d11DeviceContext; } | |
233 | virtual ID3D11DeviceContext* DILIGENT_CALL_TYPE GetD3D11DeviceContext() override final { return m_pd3d11DeviceContext; } | |
224 | 234 | |
225 | 235 | void CommitRenderTargets(); |
226 | 236 |
54 | 54 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_FenceD3D11, TFenceBase); |
55 | 55 | |
56 | 56 | /// Implementation of IFence::GetCompletedValue() in Direct3D11 backend. |
57 | virtual Uint64 GetCompletedValue() override final; | |
57 | virtual Uint64 DILIGENT_CALL_TYPE GetCompletedValue() override final; | |
58 | 58 | |
59 | 59 | /// Implementation of IFence::Reset() in Direct3D11 backend. |
60 | virtual void Reset(Uint64 Value) override final; | |
60 | virtual void DILIGENT_CALL_TYPE Reset(Uint64 Value) override final; | |
61 | 61 | |
62 | 62 | void AddPendingQuery(CComPtr<ID3D11DeviceContext> pCtx, CComPtr<ID3D11Query> pQuery, Uint64 Value) |
63 | 63 | { |
52 | 52 | const PipelineStateDesc& PipelineDesc); |
53 | 53 | ~PipelineStateD3D11Impl(); |
54 | 54 | |
55 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
55 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
56 | 56 | |
57 | 57 | /// Implementation of IPipelineState::BindStaticResources() in Direct3D11 backend. |
58 | virtual void BindStaticResources(Uint32 ShaderFlags, IResourceMapping* pResourceMapping, Uint32 Flags) override final; | |
58 | virtual void DILIGENT_CALL_TYPE BindStaticResources(Uint32 ShaderFlags, | |
59 | IResourceMapping* pResourceMapping, | |
60 | Uint32 Flags) override final; | |
59 | 61 | |
60 | 62 | /// Implementation of IPipelineState::GetStaticVariableCount() in Direct3D11 backend. |
61 | virtual Uint32 GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; | |
63 | virtual Uint32 DILIGENT_CALL_TYPE GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; | |
62 | 64 | |
63 | 65 | /// Implementation of IPipelineState::GetStaticVariableByName() in Direct3D11 backend. |
64 | virtual IShaderResourceVariable* GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) override final; | |
66 | virtual IShaderResourceVariable* DILIGENT_CALL_TYPE GetStaticVariableByName(SHADER_TYPE ShaderType, | |
67 | const Char* Name) override final; | |
65 | 68 | |
66 | 69 | /// Implementation of IPipelineState::GetStaticVariableByIndex() in Direct3D11 backend. |
67 | virtual IShaderResourceVariable* GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; | |
70 | virtual IShaderResourceVariable* DILIGENT_CALL_TYPE GetStaticVariableByIndex(SHADER_TYPE ShaderType, | |
71 | Uint32 Index) override final; | |
68 | 72 | |
69 | 73 | /// Implementation of IPipelineState::CreateShaderResourceBinding() in Direct3D11 backend. |
70 | virtual void CreateShaderResourceBinding(IShaderResourceBinding** ppShaderResourceBinding, bool InitStaticResources) override final; | |
74 | virtual void DILIGENT_CALL_TYPE CreateShaderResourceBinding(IShaderResourceBinding** ppShaderResourceBinding, | |
75 | bool InitStaticResources) override final; | |
71 | 76 | |
72 | 77 | /// Implementation of IPipelineState::IsCompatibleWith() in Direct3D11 backend. |
73 | virtual bool IsCompatibleWith(const IPipelineState* pPSO) const override final; | |
78 | virtual bool DILIGENT_CALL_TYPE IsCompatibleWith(const IPipelineState* pPSO) const override final; | |
74 | 79 | |
75 | 80 | |
76 | 81 | /// Implementation of IPipelineStateD3D11::GetD3D11BlendState() method. |
77 | virtual ID3D11BlendState* GetD3D11BlendState() override final; | |
82 | virtual ID3D11BlendState* DILIGENT_CALL_TYPE GetD3D11BlendState() override final; | |
78 | 83 | |
79 | 84 | /// Implementation of IPipelineStateD3D11::GetD3D11RasterizerState() method. |
80 | virtual ID3D11RasterizerState* GetD3D11RasterizerState() override final; | |
85 | virtual ID3D11RasterizerState* DILIGENT_CALL_TYPE GetD3D11RasterizerState() override final; | |
81 | 86 | |
82 | 87 | /// Implementation of IPipelineStateD3D11::GetD3D11DepthStencilState() method. |
83 | virtual ID3D11DepthStencilState* GetD3D11DepthStencilState() override final; | |
88 | virtual ID3D11DepthStencilState* DILIGENT_CALL_TYPE GetD3D11DepthStencilState() override final; | |
84 | 89 | |
85 | 90 | /// Implementation of IPipelineStateD3D11::GetD3D11InputLayout() method. |
86 | virtual ID3D11InputLayout* GetD3D11InputLayout() override final; | |
91 | virtual ID3D11InputLayout* DILIGENT_CALL_TYPE GetD3D11InputLayout() override final; | |
87 | 92 | |
88 | 93 | /// Implementation of IPipelineStateD3D11::GetD3D11VertexShader() method. |
89 | virtual ID3D11VertexShader* GetD3D11VertexShader() override final; | |
94 | virtual ID3D11VertexShader* DILIGENT_CALL_TYPE GetD3D11VertexShader() override final; | |
90 | 95 | |
91 | 96 | /// Implementation of IPipelineStateD3D11::GetD3D11PixelShader() method. |
92 | virtual ID3D11PixelShader* GetD3D11PixelShader() override final; | |
97 | virtual ID3D11PixelShader* DILIGENT_CALL_TYPE GetD3D11PixelShader() override final; | |
93 | 98 | |
94 | 99 | /// Implementation of IPipelineStateD3D11::GetD3D11GeometryShader() method. |
95 | virtual ID3D11GeometryShader* GetD3D11GeometryShader() override final; | |
100 | virtual ID3D11GeometryShader* DILIGENT_CALL_TYPE GetD3D11GeometryShader() override final; | |
96 | 101 | |
97 | 102 | /// Implementation of IPipelineStateD3D11::GetD3D11DomainShader() method. |
98 | virtual ID3D11DomainShader* GetD3D11DomainShader() override final; | |
103 | virtual ID3D11DomainShader* DILIGENT_CALL_TYPE GetD3D11DomainShader() override final; | |
99 | 104 | |
100 | 105 | /// Implementation of IPipelineStateD3D11::GetD3D11HullShader() method. |
101 | virtual ID3D11HullShader* GetD3D11HullShader() override final; | |
106 | virtual ID3D11HullShader* DILIGENT_CALL_TYPE GetD3D11HullShader() override final; | |
102 | 107 | |
103 | 108 | /// Implementation of IPipelineStateD3D11::GetD3D11ComputeShader() method. |
104 | virtual ID3D11ComputeShader* GetD3D11ComputeShader() override final; | |
109 | virtual ID3D11ComputeShader* DILIGENT_CALL_TYPE GetD3D11ComputeShader() override final; | |
105 | 110 | |
106 | 111 | |
107 | 112 | SRBMemoryAllocator& GetSRBMemoryAllocator() |
55 | 55 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_QueryD3D11, TQueryBase); |
56 | 56 | |
57 | 57 | /// Implementation of IQuery::GetData(). |
58 | virtual bool GetData(void* pData, Uint32 DataSize, bool AutoInvalidate) override final; | |
58 | virtual bool DILIGENT_CALL_TYPE GetData(void* pData, Uint32 DataSize, bool AutoInvalidate) override final; | |
59 | 59 | |
60 | 60 | /// Implementation of IQuery::Invalidate(). |
61 | virtual void Invalidate() override final | |
61 | virtual void DILIGENT_CALL_TYPE Invalidate() override final | |
62 | 62 | { |
63 | 63 | m_DisjointQuery.reset(); |
64 | 64 | TQueryBase::Invalidate(); |
65 | 65 | } |
66 | 66 | |
67 | 67 | /// Implementation of IQueryD3D11::GetD3D11Query(). |
68 | virtual ID3D11Query* GetD3D11Query() override final | |
68 | virtual ID3D11Query* DILIGENT_CALL_TYPE GetD3D11Query() override final | |
69 | 69 | { |
70 | 70 | return m_pd3d11Query; |
71 | 71 | } |
48 | 48 | const EngineD3D11CreateInfo& EngineAttribs, |
49 | 49 | ID3D11Device* pd3d11Device, |
50 | 50 | Uint32 NumDeferredContexts); |
51 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
51 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
52 | 52 | |
53 | 53 | /// Implementation of IRenderDevice::CreateBuffer() in Direct3D11 backend. |
54 | virtual void CreateBuffer(const BufferDesc& BuffDesc, const BufferData* pBuffData, IBuffer** ppBuffer) override final; | |
54 | virtual void DILIGENT_CALL_TYPE CreateBuffer(const BufferDesc& BuffDesc, | |
55 | const BufferData* pBuffData, | |
56 | IBuffer** ppBuffer) override final; | |
55 | 57 | |
56 | 58 | /// Implementation of IRenderDevice::CreateShader() in Direct3D11 backend. |
57 | virtual void CreateShader(const ShaderCreateInfo& ShaderCI, IShader** ppShader) override final; | |
59 | virtual void DILIGENT_CALL_TYPE CreateShader(const ShaderCreateInfo& ShaderCI, | |
60 | IShader** ppShader) override final; | |
58 | 61 | |
59 | 62 | /// Implementation of IRenderDevice::CreateTexture() in Direct3D11 backend. |
60 | virtual void CreateTexture(const TextureDesc& TexDesc, const TextureData* pData, ITexture** ppTexture) override final; | |
63 | virtual void DILIGENT_CALL_TYPE CreateTexture(const TextureDesc& TexDesc, | |
64 | const TextureData* pData, | |
65 | ITexture** ppTexture) override final; | |
61 | 66 | |
62 | 67 | /// Implementation of IRenderDevice::CreateSampler() in Direct3D11 backend. |
63 | virtual void CreateSampler(const SamplerDesc& SamplerDesc, ISampler** ppSampler) override final; | |
68 | virtual void DILIGENT_CALL_TYPE CreateSampler(const SamplerDesc& SamplerDesc, | |
69 | ISampler** ppSampler) override final; | |
64 | 70 | |
65 | 71 | /// Implementation of IRenderDevice::CreatePipelineState() in Direct3D11 backend. |
66 | virtual void CreatePipelineState(const PipelineStateDesc& PipelineDesc, IPipelineState** ppPipelineState) override final; | |
72 | virtual void DILIGENT_CALL_TYPE CreatePipelineState(const PipelineStateDesc& PipelineDesc, | |
73 | IPipelineState** ppPipelineState) override final; | |
67 | 74 | |
68 | 75 | /// Implementation of IRenderDevice::CreateFence() in Direct3D11 backend. |
69 | virtual void CreateFence(const FenceDesc& Desc, IFence** ppFence) override final; | |
76 | virtual void DILIGENT_CALL_TYPE CreateFence(const FenceDesc& Desc, | |
77 | IFence** ppFence) override final; | |
70 | 78 | |
71 | 79 | /// Implementation of IRenderDevice::CreateQuery() in Direct3D11 backend. |
72 | virtual void CreateQuery(const QueryDesc& Desc, IQuery** ppQuery) override final; | |
80 | virtual void DILIGENT_CALL_TYPE CreateQuery(const QueryDesc& Desc, | |
81 | IQuery** ppQuery) override final; | |
73 | 82 | |
74 | 83 | /// Implementation of IRenderDeviceD3D11::GetD3D11Device() in Direct3D11 backend. |
75 | ID3D11Device* GetD3D11Device() override final { return m_pd3d11Device; } | |
84 | ID3D11Device* DILIGENT_CALL_TYPE GetD3D11Device() override final { return m_pd3d11Device; } | |
76 | 85 | |
77 | 86 | /// Implementation of IRenderDeviceD3D11::CreateBufferFromD3DResource() in Direct3D11 backend. |
78 | virtual void CreateBufferFromD3DResource(ID3D11Buffer* pd3d11Buffer, const BufferDesc& BuffDesc, RESOURCE_STATE InitialState, IBuffer** ppBuffer) override final; | |
87 | virtual void DILIGENT_CALL_TYPE CreateBufferFromD3DResource(ID3D11Buffer* pd3d11Buffer, const BufferDesc& BuffDesc, RESOURCE_STATE InitialState, IBuffer** ppBuffer) override final; | |
79 | 88 | |
80 | 89 | /// Implementation of IRenderDeviceD3D11::CreateTextureFromD3DResource() for 1D textures in Direct3D11 backend. |
81 | virtual void CreateTexture1DFromD3DResource(ID3D11Texture1D* pd3d11Texture, RESOURCE_STATE InitialState, ITexture** ppTexture) override final; | |
90 | virtual void DILIGENT_CALL_TYPE CreateTexture1DFromD3DResource(ID3D11Texture1D* pd3d11Texture, | |
91 | RESOURCE_STATE InitialState, | |
92 | ITexture** ppTexture) override final; | |
82 | 93 | |
83 | 94 | /// Implementation of IRenderDeviceD3D11::CreateTextureFromD3DResource() for 2D textures in Direct3D11 backend. |
84 | virtual void CreateTexture2DFromD3DResource(ID3D11Texture2D* pd3d11Texture, RESOURCE_STATE InitialState, ITexture** ppTexture) override final; | |
95 | virtual void DILIGENT_CALL_TYPE CreateTexture2DFromD3DResource(ID3D11Texture2D* pd3d11Texture, | |
96 | RESOURCE_STATE InitialState, | |
97 | ITexture** ppTexture) override final; | |
85 | 98 | |
86 | 99 | /// Implementation of IRenderDeviceD3D11::CreateTextureFromD3DResource() for 3D textures in Direct3D11 backend. |
87 | virtual void CreateTexture3DFromD3DResource(ID3D11Texture3D* pd3d11Texture, RESOURCE_STATE InitialState, ITexture** ppTexture) override final; | |
100 | virtual void DILIGENT_CALL_TYPE CreateTexture3DFromD3DResource(ID3D11Texture3D* pd3d11Texture, | |
101 | RESOURCE_STATE InitialState, | |
102 | ITexture** ppTexture) override final; | |
88 | 103 | |
89 | 104 | /// Implementation of IRenderDevice::ReleaseStaleResources() in Direct3D11 backend. |
90 | virtual void ReleaseStaleResources(bool ForceRelease = false) override final {} | |
105 | virtual void DILIGENT_CALL_TYPE ReleaseStaleResources(bool ForceRelease = false) override final {} | |
91 | 106 | |
92 | 107 | /// Implementation of IRenderDevice::IdleGPU() in Direct3D11 backend. |
93 | virtual void IdleGPU() override final; | |
108 | virtual void DILIGENT_CALL_TYPE IdleGPU() override final; | |
94 | 109 | |
95 | 110 | size_t GetCommandQueueCount() const { return 1; } |
96 | 111 | Uint64 GetCommandQueueMask() const { return Uint64{1}; } |
50 | 50 | const SamplerDesc& SamplerDesc); |
51 | 51 | ~SamplerD3D11Impl(); |
52 | 52 | |
53 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
53 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
54 | 54 | |
55 | 55 | /// Implementation of ISamplerD3D11::ISamplerD3D11() method. |
56 | virtual ID3D11SamplerState* GetD3D11SamplerState() override final { return m_pd3dSampler; } | |
56 | virtual ID3D11SamplerState* DILIGENT_CALL_TYPE GetD3D11SamplerState() override final { return m_pd3dSampler; } | |
57 | 57 | |
58 | 58 | private: |
59 | 59 | /// D3D11 sampler |
56 | 56 | const ShaderCreateInfo& ShaderCI); |
57 | 57 | ~ShaderD3D11Impl(); |
58 | 58 | |
59 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
59 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
60 | 60 | |
61 | 61 | /// Implementation of IShader::GetResourceCount() in Direct3D11 backend. |
62 | virtual Uint32 GetResourceCount() const override final | |
62 | virtual Uint32 DILIGENT_CALL_TYPE GetResourceCount() const override final | |
63 | 63 | { |
64 | 64 | return m_pShaderResources->GetTotalResources(); |
65 | 65 | } |
66 | 66 | |
67 | 67 | /// Implementation of IShader::GetResource() in Direct3D11 backend. |
68 | virtual void GetResourceDesc(Uint32 Index, ShaderResourceDesc& ResourceDesc) const override final | |
68 | virtual void DILIGENT_CALL_TYPE GetResourceDesc(Uint32 Index, ShaderResourceDesc& ResourceDesc) const override final | |
69 | 69 | { |
70 | 70 | ResourceDesc = m_pShaderResources->GetHLSLShaderResourceDesc(Index); |
71 | 71 | } |
72 | 72 | |
73 | 73 | /// Implementation of IShaderD3D::GetHLSLResource() method. |
74 | virtual void GetHLSLResource(Uint32 Index, HLSLShaderResourceDesc& ResourceDesc) const override final | |
74 | virtual void DILIGENT_CALL_TYPE GetHLSLResource(Uint32 Index, HLSLShaderResourceDesc& ResourceDesc) const override final | |
75 | 75 | { |
76 | 76 | ResourceDesc = m_pShaderResources->GetHLSLShaderResourceDesc(Index); |
77 | 77 | } |
78 | 78 | |
79 | 79 | /// Implementation of IShaderD3D11::GetD3D11Shader() method. |
80 | virtual ID3D11DeviceChild* GetD3D11Shader() override final | |
80 | virtual ID3D11DeviceChild* DILIGENT_CALL_TYPE GetD3D11Shader() override final | |
81 | 81 | { |
82 | 82 | return m_pShader; |
83 | 83 | } |
52 | 52 | bool IsInternal); |
53 | 53 | ~ShaderResourceBindingD3D11Impl(); |
54 | 54 | |
55 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
55 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
56 | 56 | |
57 | 57 | /// Implementation of IShaderResourceBinding::BindResources() in Direct3D11 backend. |
58 | virtual void BindResources(Uint32 ShaderFlags, IResourceMapping* pResMapping, Uint32 Flags) override final; | |
58 | virtual void DILIGENT_CALL_TYPE BindResources(Uint32 ShaderFlags, | |
59 | IResourceMapping* pResMapping, | |
60 | Uint32 Flags) override final; | |
59 | 61 | |
60 | 62 | /// Implementation of IShaderResourceBinding::GetVariableByName() in Direct3D11 backend. |
61 | virtual IShaderResourceVariable* GetVariableByName(SHADER_TYPE ShaderType, const char* Name) override final; | |
63 | virtual IShaderResourceVariable* DILIGENT_CALL_TYPE GetVariableByName(SHADER_TYPE ShaderType, const char* Name) override final; | |
62 | 64 | |
63 | 65 | /// Implementation of IShaderResourceBinding::GetVariableCount() in Direct3D11 backend. |
64 | virtual Uint32 GetVariableCount(SHADER_TYPE ShaderType) const override final; | |
66 | virtual Uint32 DILIGENT_CALL_TYPE GetVariableCount(SHADER_TYPE ShaderType) const override final; | |
65 | 67 | |
66 | 68 | /// Implementation of IShaderResourceBinding::GetVariableByIndex() in Direct3D11 backend. |
67 | virtual IShaderResourceVariable* GetVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; | |
69 | virtual IShaderResourceVariable* DILIGENT_CALL_TYPE GetVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; | |
68 | 70 | |
69 | 71 | /// Implementation of IShaderResourceBinding::InitializeStaticResources() in Direct3D11 backend. |
70 | virtual void InitializeStaticResources(const IPipelineState* pPipelineState) override final; | |
72 | virtual void DILIGENT_CALL_TYPE InitializeStaticResources(const IPipelineState* pPipelineState) override final; | |
71 | 73 | |
72 | 74 | ShaderResourceCacheD3D11& GetResourceCache(Uint32 Ind) |
73 | 75 | { |
83 | 83 | // Non-virtual function |
84 | 84 | __forceinline void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex); |
85 | 85 | |
86 | virtual void Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
87 | ||
88 | virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
89 | { | |
90 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
91 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
92 | BindResource(ppObjects[elem], FirstElement + elem); | |
93 | } | |
94 | ||
95 | virtual bool IsBound(Uint32 ArrayIndex) const override final | |
86 | virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
87 | ||
88 | virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, | |
89 | Uint32 FirstElement, | |
90 | Uint32 NumElements) override final | |
91 | { | |
92 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
93 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
94 | BindResource(ppObjects[elem], FirstElement + elem); | |
95 | } | |
96 | ||
97 | virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final | |
96 | 98 | { |
97 | 99 | VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); |
98 | 100 | return m_ParentResLayout.m_ResourceCache.IsCBBound(m_Attribs.BindPoint + ArrayIndex); |
112 | 114 | // Non-virtual function |
113 | 115 | __forceinline void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex); |
114 | 116 | |
115 | virtual void Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
116 | ||
117 | virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
118 | { | |
119 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
120 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
121 | BindResource(ppObjects[elem], FirstElement + elem); | |
122 | } | |
123 | ||
124 | virtual bool IsBound(Uint32 ArrayIndex) const override final | |
117 | virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
118 | ||
119 | virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, | |
120 | Uint32 FirstElement, | |
121 | Uint32 NumElements) override final | |
122 | { | |
123 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
124 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
125 | BindResource(ppObjects[elem], FirstElement + elem); | |
126 | } | |
127 | ||
128 | virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final | |
125 | 129 | { |
126 | 130 | VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); |
127 | 131 | return m_ParentResLayout.m_ResourceCache.IsSRVBound(m_Attribs.BindPoint + ArrayIndex, true); |
145 | 149 | // Provide non-virtual function |
146 | 150 | __forceinline void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex); |
147 | 151 | |
148 | virtual void Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
149 | ||
150 | virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
151 | { | |
152 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
153 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
154 | BindResource(ppObjects[elem], FirstElement + elem); | |
155 | } | |
156 | ||
157 | __forceinline virtual bool IsBound(Uint32 ArrayIndex) const override final | |
152 | virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
153 | ||
154 | virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, | |
155 | Uint32 FirstElement, | |
156 | Uint32 NumElements) override final | |
157 | { | |
158 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
159 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
160 | BindResource(ppObjects[elem], FirstElement + elem); | |
161 | } | |
162 | ||
163 | __forceinline virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final | |
158 | 164 | { |
159 | 165 | VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); |
160 | 166 | return m_ParentResLayout.m_ResourceCache.IsUAVBound(m_Attribs.BindPoint + ArrayIndex, true); |
172 | 178 | // Non-virtual function |
173 | 179 | __forceinline void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex); |
174 | 180 | |
175 | virtual void Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
176 | ||
177 | virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
178 | { | |
179 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
180 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
181 | BindResource(ppObjects[elem], FirstElement + elem); | |
182 | } | |
183 | ||
184 | virtual bool IsBound(Uint32 ArrayIndex) const override final | |
181 | virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
182 | ||
183 | virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, | |
184 | Uint32 FirstElement, | |
185 | Uint32 NumElements) override final | |
186 | { | |
187 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
188 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
189 | BindResource(ppObjects[elem], FirstElement + elem); | |
190 | } | |
191 | ||
192 | virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final | |
185 | 193 | { |
186 | 194 | VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); |
187 | 195 | return m_ParentResLayout.m_ResourceCache.IsUAVBound(m_Attribs.BindPoint + ArrayIndex, false); |
199 | 207 | // Non-virtual function |
200 | 208 | __forceinline void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex); |
201 | 209 | |
202 | virtual void Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
203 | ||
204 | virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
205 | { | |
206 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
207 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
208 | BindResource(ppObjects[elem], FirstElement + elem); | |
209 | } | |
210 | ||
211 | virtual bool IsBound(Uint32 ArrayIndex) const override final | |
210 | virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
211 | ||
212 | virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, | |
213 | Uint32 FirstElement, | |
214 | Uint32 NumElements) override final | |
215 | { | |
216 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
217 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
218 | BindResource(ppObjects[elem], FirstElement + elem); | |
219 | } | |
220 | ||
221 | virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final | |
212 | 222 | { |
213 | 223 | VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); |
214 | 224 | return m_ParentResLayout.m_ResourceCache.IsSRVBound(m_Attribs.BindPoint + ArrayIndex, false); |
226 | 236 | // Non-virtual function |
227 | 237 | __forceinline void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex); |
228 | 238 | |
229 | virtual void Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
230 | ||
231 | virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
232 | { | |
233 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
234 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
235 | BindResource(ppObjects[elem], FirstElement + elem); | |
236 | } | |
237 | ||
238 | virtual bool IsBound(Uint32 ArrayIndex) const override final | |
239 | virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final { BindResource(pObject, 0); } | |
240 | ||
241 | virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, | |
242 | Uint32 FirstElement, | |
243 | Uint32 NumElements) override final | |
244 | { | |
245 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.BindCount, FirstElement, NumElements); | |
246 | for (Uint32 elem = 0; elem < NumElements; ++elem) | |
247 | BindResource(ppObjects[elem], FirstElement + elem); | |
248 | } | |
249 | ||
250 | virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final | |
239 | 251 | { |
240 | 252 | VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); |
241 | 253 | return m_ParentResLayout.m_ResourceCache.IsSamplerBound(m_Attribs.BindPoint + ArrayIndex); |
49 | 49 | void* pNativeWndHandle); |
50 | 50 | ~SwapChainD3D11Impl(); |
51 | 51 | |
52 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
52 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
53 | 53 | |
54 | 54 | /// Implementation of ISwapChain::Present() in Direct3D11 backend. |
55 | virtual void Present(Uint32 SyncInterval) override final; | |
55 | virtual void DILIGENT_CALL_TYPE Present(Uint32 SyncInterval) override final; | |
56 | 56 | |
57 | 57 | /// Implementation of ISwapChain::Resize() in Direct3D11 backend. |
58 | virtual void Resize(Uint32 NewWidth, Uint32 NewHeight) override final; | |
58 | virtual void DILIGENT_CALL_TYPE Resize(Uint32 NewWidth, Uint32 NewHeight) override final; | |
59 | 59 | |
60 | 60 | /// Implementation of ISwapChainD3D11::GetDXGISwapChain() in Direct3D11 backend. |
61 | virtual IDXGISwapChain* GetDXGISwapChain() override final { return m_pSwapChain; } | |
61 | virtual IDXGISwapChain* DILIGENT_CALL_TYPE GetDXGISwapChain() override final { return m_pSwapChain; } | |
62 | 62 | |
63 | 63 | /// Implementation of ISwapChainD3D11::GetCurrentBackBufferRTV() in Direct3D11 backend. |
64 | virtual ITextureViewD3D11* GetCurrentBackBufferRTV() override final { return m_pRenderTargetView; } | |
64 | virtual ITextureViewD3D11* DILIGENT_CALL_TYPE GetCurrentBackBufferRTV() override final { return m_pRenderTargetView; } | |
65 | 65 | |
66 | 66 | /// Implementation of ISwapChainD3D11::GetDepthBufferDSV() in Direct3D11 backend. |
67 | virtual ITextureViewD3D11* GetDepthBufferDSV() override final { return m_pDepthStencilView; } | |
67 | virtual ITextureViewD3D11* DILIGENT_CALL_TYPE GetDepthBufferDSV() override final { return m_pDepthStencilView; } | |
68 | 68 | |
69 | 69 | private: |
70 | 70 | virtual void UpdateSwapChain(bool CreateNew) override final; |
54 | 54 | const TextureData* pInitData = nullptr); |
55 | 55 | ~TextureBaseD3D11(); |
56 | 56 | |
57 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
57 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
58 | 58 | |
59 | 59 | /// Implementation of ITextureD3D11::GetD3D11Texture(). |
60 | virtual ID3D11Resource* GetD3D11Texture() override final { return m_pd3d11Texture; } | |
60 | virtual ID3D11Resource* DILIGENT_CALL_TYPE GetD3D11Texture() override final { return m_pd3d11Texture; } | |
61 | 61 | |
62 | 62 | /// Implementation of ITexture::GetNativeHandle(). |
63 | virtual void* GetNativeHandle() override final { return GetD3D11Texture(); } | |
63 | virtual void* DILIGENT_CALL_TYPE GetNativeHandle() override final { return GetD3D11Texture(); } | |
64 | 64 | |
65 | 65 | void AddState(RESOURCE_STATE State) |
66 | 66 | { |
52 | 52 | ID3D11View* pD3D11View, |
53 | 53 | bool bIsDefaultView); |
54 | 54 | |
55 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
55 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
56 | 56 | |
57 | 57 | /// Implementation of ITextureViewD3D11::GetD3D11View(). |
58 | virtual ID3D11View* GetD3D11View() override final | |
58 | virtual ID3D11View* DILIGENT_CALL_TYPE GetD3D11View() override final | |
59 | 59 | { |
60 | 60 | return m_pD3D11View; |
61 | 61 | } |
57 | 57 | TBase{IID_EngineFactoryD3D11} |
58 | 58 | {} |
59 | 59 | |
60 | void CreateDeviceAndContextsD3D11(const EngineD3D11CreateInfo& EngineCI, | |
61 | IRenderDevice** ppDevice, | |
62 | IDeviceContext** ppContexts) override final; | |
63 | ||
64 | void CreateSwapChainD3D11(IRenderDevice* pDevice, | |
65 | IDeviceContext* pImmediateContext, | |
66 | const SwapChainDesc& SCDesc, | |
67 | const FullScreenModeDesc& FSDesc, | |
68 | void* pNativeWndHandle, | |
69 | ISwapChain** ppSwapChain) override final; | |
70 | ||
71 | void AttachToD3D11Device(void* pd3d11NativeDevice, | |
72 | void* pd3d11ImmediateContext, | |
73 | const EngineD3D11CreateInfo& EngineCI, | |
74 | IRenderDevice** ppDevice, | |
75 | IDeviceContext** ppContexts) override final; | |
60 | virtual void DILIGENT_CALL_TYPE CreateDeviceAndContextsD3D11(const EngineD3D11CreateInfo& EngineCI, | |
61 | IRenderDevice** ppDevice, | |
62 | IDeviceContext** ppContexts) override final; | |
63 | ||
64 | virtual void DILIGENT_CALL_TYPE CreateSwapChainD3D11(IRenderDevice* pDevice, | |
65 | IDeviceContext* pImmediateContext, | |
66 | const SwapChainDesc& SCDesc, | |
67 | const FullScreenModeDesc& FSDesc, | |
68 | void* pNativeWndHandle, | |
69 | ISwapChain** ppSwapChain) override final; | |
70 | ||
71 | virtual void DILIGENT_CALL_TYPE AttachToD3D11Device(void* pd3d11NativeDevice, | |
72 | void* pd3d11ImmediateContext, | |
73 | const EngineD3D11CreateInfo& EngineCI, | |
74 | IRenderDevice** ppDevice, | |
75 | IDeviceContext** ppContexts) override final; | |
76 | 76 | }; |
77 | 77 | |
78 | 78 |
62 | 62 | ID3D12Resource* pd3d12Buffer); |
63 | 63 | ~BufferD3D12Impl(); |
64 | 64 | |
65 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
65 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
66 | 66 | |
67 | 67 | #ifdef DEVELOPMENT |
68 | 68 | void DvpVerifyDynamicAllocation(class DeviceContextD3D12Impl* pCtx) const; |
69 | 69 | #endif |
70 | 70 | |
71 | 71 | /// Implementation of IBufferD3D12::GetD3D12Buffer(). |
72 | virtual ID3D12Resource* GetD3D12Buffer(Uint64& DataStartByteOffset, IDeviceContext* pContext) override final; | |
72 | virtual ID3D12Resource* DILIGENT_CALL_TYPE GetD3D12Buffer(Uint64& DataStartByteOffset, IDeviceContext* pContext) override final; | |
73 | 73 | |
74 | 74 | /// Implementation of IBuffer::GetNativeHandle(). |
75 | virtual void* GetNativeHandle() override final | |
75 | virtual void* DILIGENT_CALL_TYPE GetNativeHandle() override final | |
76 | 76 | { |
77 | 77 | VERIFY(GetD3D12Resource() != nullptr, "The buffer is dynamic and has no pointer to D3D12 resource"); |
78 | 78 | Uint64 DataStartByteOffset = 0; |
82 | 82 | } |
83 | 83 | |
84 | 84 | /// Implementation of IBufferD3D12::SetD3D12ResourceState(). |
85 | virtual void SetD3D12ResourceState(D3D12_RESOURCE_STATES state) override final; | |
85 | virtual void DILIGENT_CALL_TYPE SetD3D12ResourceState(D3D12_RESOURCE_STATES state) override final; | |
86 | 86 | |
87 | 87 | /// Implementation of IBufferD3D12::GetD3D12ResourceState(). |
88 | virtual D3D12_RESOURCE_STATES GetD3D12ResourceState() const override final; | |
88 | virtual D3D12_RESOURCE_STATES DILIGENT_CALL_TYPE GetD3D12ResourceState() const override final; | |
89 | 89 | |
90 | 90 | __forceinline D3D12_GPU_VIRTUAL_ADDRESS GetGPUAddress(Uint32 ContextId, class DeviceContextD3D12Impl* pCtx) |
91 | 91 | { |
53 | 53 | DescriptorHeapAllocation&& HandleAlloc, |
54 | 54 | bool bIsDefaultView); |
55 | 55 | |
56 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
56 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
57 | 57 | |
58 | 58 | /// Implementation of IBufferViewD3D12::GetCPUDescriptorHandle(). |
59 | virtual D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() override final { return m_DescriptorHandle.GetCpuHandle(); } | |
59 | virtual D3D12_CPU_DESCRIPTOR_HANDLE DILIGENT_CALL_TYPE GetCPUDescriptorHandle() override final | |
60 | { | |
61 | return m_DescriptorHandle.GetCpuHandle(); | |
62 | } | |
60 | 63 | |
61 | 64 | protected: |
62 | 65 | // Allocation in a CPU-only descriptor heap |
45 | 45 | CommandQueueD3D12Impl(IReferenceCounters* pRefCounters, ID3D12CommandQueue* pd3d12NativeCmdQueue, ID3D12Fence* pd3d12Fence); |
46 | 46 | ~CommandQueueD3D12Impl(); |
47 | 47 | |
48 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
48 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
49 | 49 | |
50 | 50 | // Implementation of ICommandQueueD3D12::GetNextFenceValue(). |
51 | virtual Uint64 GetNextFenceValue() const override final { return m_NextFenceValue; } | |
51 | virtual Uint64 DILIGENT_CALL_TYPE GetNextFenceValue() const override final { return m_NextFenceValue; } | |
52 | 52 | |
53 | 53 | // Implementation of ICommandQueueD3D12::Submit(). |
54 | virtual Uint64 Submit(ID3D12GraphicsCommandList* commandList) override final; | |
54 | virtual Uint64 DILIGENT_CALL_TYPE Submit(ID3D12GraphicsCommandList* commandList) override final; | |
55 | 55 | |
56 | 56 | // Implementation of ICommandQueueD3D12::GetD3D12CommandQueue(). |
57 | virtual ID3D12CommandQueue* GetD3D12CommandQueue() override final { return m_pd3d12CmdQueue; } | |
57 | virtual ID3D12CommandQueue* DILIGENT_CALL_TYPE GetD3D12CommandQueue() override final { return m_pd3d12CmdQueue; } | |
58 | 58 | |
59 | 59 | // Implementation of ICommandQueueD3D12::WaitForIdle(). |
60 | virtual Uint64 WaitForIdle() override final; | |
60 | virtual Uint64 DILIGENT_CALL_TYPE WaitForIdle() override final; | |
61 | 61 | |
62 | 62 | // Implementation of ICommandQueueD3D12::GetCompletedFenceValue(). |
63 | virtual Uint64 GetCompletedFenceValue() override final; | |
63 | virtual Uint64 DILIGENT_CALL_TYPE GetCompletedFenceValue() override final; | |
64 | 64 | |
65 | 65 | // Implementation of ICommandQueueD3D12::SignalFence(). |
66 | virtual void SignalFence(ID3D12Fence* pFence, Uint64 Value) override final; | |
66 | virtual void DILIGENT_CALL_TYPE SignalFence(ID3D12Fence* pFence, Uint64 Value) override final; | |
67 | 67 | |
68 | 68 | private: |
69 | 69 | // A value that will be signaled by the command queue next |
68 | 68 | Uint32 CommandQueueId); |
69 | 69 | ~DeviceContextD3D12Impl(); |
70 | 70 | |
71 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
71 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
72 | 72 | |
73 | 73 | /// Implementation of IDeviceContext::SetPipelineState() in Direct3D12 backend. |
74 | virtual void SetPipelineState(IPipelineState* pPipelineState) override final; | |
74 | virtual void DILIGENT_CALL_TYPE SetPipelineState(IPipelineState* pPipelineState) override final; | |
75 | 75 | |
76 | 76 | /// Implementation of IDeviceContext::TransitionShaderResources() in Direct3D12 backend. |
77 | virtual void TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding) override final; | |
77 | virtual void DILIGENT_CALL_TYPE TransitionShaderResources(IPipelineState* pPipelineState, | |
78 | IShaderResourceBinding* pShaderResourceBinding) override final; | |
78 | 79 | |
79 | 80 | /// Implementation of IDeviceContext::CommitShaderResources() in Direct3D12 backend. |
80 | virtual void CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
81 | virtual void DILIGENT_CALL_TYPE CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, | |
82 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
81 | 83 | |
82 | 84 | /// Implementation of IDeviceContext::SetStencilRef() in Direct3D12 backend. |
83 | virtual void SetStencilRef(Uint32 StencilRef) override final; | |
85 | virtual void DILIGENT_CALL_TYPE SetStencilRef(Uint32 StencilRef) override final; | |
84 | 86 | |
85 | 87 | /// Implementation of IDeviceContext::SetBlendFactors() in Direct3D12 backend. |
86 | virtual void SetBlendFactors(const float* pBlendFactors = nullptr) override final; | |
88 | virtual void DILIGENT_CALL_TYPE SetBlendFactors(const float* pBlendFactors = nullptr) override final; | |
87 | 89 | |
88 | 90 | /// Implementation of IDeviceContext::SetVertexBuffers() in Direct3D12 backend. |
89 | virtual void SetVertexBuffers(Uint32 StartSlot, | |
90 | Uint32 NumBuffersSet, | |
91 | IBuffer** ppBuffers, | |
92 | Uint32* pOffsets, | |
93 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, | |
94 | SET_VERTEX_BUFFERS_FLAGS Flags) override final; | |
91 | virtual void DILIGENT_CALL_TYPE SetVertexBuffers(Uint32 StartSlot, | |
92 | Uint32 NumBuffersSet, | |
93 | IBuffer** ppBuffers, | |
94 | Uint32* pOffsets, | |
95 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, | |
96 | SET_VERTEX_BUFFERS_FLAGS Flags) override final; | |
95 | 97 | |
96 | 98 | /// Implementation of IDeviceContext::InvalidateState() in Direct3D12 backend. |
97 | virtual void InvalidateState() override final; | |
99 | virtual void DILIGENT_CALL_TYPE InvalidateState() override final; | |
98 | 100 | |
99 | 101 | /// Implementation of IDeviceContext::SetIndexBuffer() in Direct3D12 backend. |
100 | virtual void SetIndexBuffer(IBuffer* pIndexBuffer, Uint32 ByteOffset, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
102 | virtual void DILIGENT_CALL_TYPE SetIndexBuffer(IBuffer* pIndexBuffer, | |
103 | Uint32 ByteOffset, | |
104 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
101 | 105 | |
102 | 106 | /// Implementation of IDeviceContext::SetViewports() in Direct3D12 backend. |
103 | virtual void SetViewports(Uint32 NumViewports, const Viewport* pViewports, Uint32 RTWidth, Uint32 RTHeight) override final; | |
107 | virtual void DILIGENT_CALL_TYPE SetViewports(Uint32 NumViewports, | |
108 | const Viewport* pViewports, | |
109 | Uint32 RTWidth, | |
110 | Uint32 RTHeight) override final; | |
104 | 111 | |
105 | 112 | /// Implementation of IDeviceContext::SetScissorRects() in Direct3D12 backend. |
106 | virtual void SetScissorRects(Uint32 NumRects, const Rect* pRects, Uint32 RTWidth, Uint32 RTHeight) override final; | |
113 | virtual void DILIGENT_CALL_TYPE SetScissorRects(Uint32 NumRects, | |
114 | const Rect* pRects, | |
115 | Uint32 RTWidth, | |
116 | Uint32 RTHeight) override final; | |
107 | 117 | |
108 | 118 | /// Implementation of IDeviceContext::SetRenderTargets() in Direct3D12 backend. |
109 | virtual void SetRenderTargets(Uint32 NumRenderTargets, | |
110 | ITextureView* ppRenderTargets[], | |
111 | ITextureView* pDepthStencil, | |
112 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
119 | virtual void DILIGENT_CALL_TYPE SetRenderTargets(Uint32 NumRenderTargets, | |
120 | ITextureView* ppRenderTargets[], | |
121 | ITextureView* pDepthStencil, | |
122 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
113 | 123 | |
114 | 124 | // clang-format off |
115 | 125 | /// Implementation of IDeviceContext::Draw() in Direct3D12 backend. |
116 | virtual void Draw (const DrawAttribs& Attribs) override final; | |
126 | virtual void DILIGENT_CALL_TYPE Draw (const DrawAttribs& Attribs) override final; | |
117 | 127 | /// Implementation of IDeviceContext::DrawIndexed() in Direct3D12 backend. |
118 | virtual void DrawIndexed (const DrawIndexedAttribs& Attribs) override final; | |
128 | virtual void DILIGENT_CALL_TYPE DrawIndexed (const DrawIndexedAttribs& Attribs) override final; | |
119 | 129 | /// Implementation of IDeviceContext::DrawIndirect() in Direct3D12 backend. |
120 | virtual void DrawIndirect (const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
130 | virtual void DILIGENT_CALL_TYPE DrawIndirect (const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
121 | 131 | /// Implementation of IDeviceContext::DrawIndexedIndirect() in Direct3D12 backend. |
122 | virtual void DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
132 | virtual void DILIGENT_CALL_TYPE DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
123 | 133 | |
124 | 134 | |
125 | 135 | /// Implementation of IDeviceContext::DispatchCompute() in Direct3D12 backend. |
126 | virtual void DispatchCompute (const DispatchComputeAttribs& Attribs) override final; | |
136 | virtual void DILIGENT_CALL_TYPE DispatchCompute (const DispatchComputeAttribs& Attribs) override final; | |
127 | 137 | /// Implementation of IDeviceContext::DispatchComputeIndirect() in Direct3D12 backend. |
128 | virtual void DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
138 | virtual void DILIGENT_CALL_TYPE DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
129 | 139 | // clang-format on |
130 | 140 | |
131 | 141 | /// Implementation of IDeviceContext::ClearDepthStencil() in Direct3D12 backend. |
132 | virtual void ClearDepthStencil(ITextureView* pView, | |
133 | CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, | |
134 | float fDepth, | |
135 | Uint8 Stencil, | |
136 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
142 | virtual void DILIGENT_CALL_TYPE ClearDepthStencil(ITextureView* pView, | |
143 | CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, | |
144 | float fDepth, | |
145 | Uint8 Stencil, | |
146 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
137 | 147 | |
138 | 148 | /// Implementation of IDeviceContext::ClearRenderTarget() in Direct3D12 backend. |
139 | virtual void ClearRenderTarget(ITextureView* pView, const float* RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
149 | virtual void DILIGENT_CALL_TYPE ClearRenderTarget(ITextureView* pView, | |
150 | const float* RGBA, | |
151 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
140 | 152 | |
141 | 153 | /// Implementation of IDeviceContext::UpdateBuffer() in Direct3D12 backend. |
142 | virtual void UpdateBuffer(IBuffer* pBuffer, | |
143 | Uint32 Offset, | |
144 | Uint32 Size, | |
145 | const void* pData, | |
146 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
154 | virtual void DILIGENT_CALL_TYPE UpdateBuffer(IBuffer* pBuffer, | |
155 | Uint32 Offset, | |
156 | Uint32 Size, | |
157 | const void* pData, | |
158 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
147 | 159 | |
148 | 160 | /// Implementation of IDeviceContext::CopyBuffer() in Direct3D12 backend. |
149 | virtual void CopyBuffer(IBuffer* pSrcBuffer, | |
150 | Uint32 SrcOffset, | |
151 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
152 | IBuffer* pDstBuffer, | |
153 | Uint32 DstOffset, | |
154 | Uint32 Size, | |
155 | RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode) override final; | |
161 | virtual void DILIGENT_CALL_TYPE CopyBuffer(IBuffer* pSrcBuffer, | |
162 | Uint32 SrcOffset, | |
163 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
164 | IBuffer* pDstBuffer, | |
165 | Uint32 DstOffset, | |
166 | Uint32 Size, | |
167 | RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode) override final; | |
156 | 168 | |
157 | 169 | /// Implementation of IDeviceContext::MapBuffer() in Direct3D12 backend. |
158 | virtual void MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData) override final; | |
170 | virtual void DILIGENT_CALL_TYPE MapBuffer(IBuffer* pBuffer, | |
171 | MAP_TYPE MapType, | |
172 | MAP_FLAGS MapFlags, | |
173 | PVoid& pMappedData) override final; | |
159 | 174 | |
160 | 175 | /// Implementation of IDeviceContext::UnmapBuffer() in Direct3D12 backend. |
161 | virtual void UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType) override final; | |
176 | virtual void DILIGENT_CALL_TYPE UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType) override final; | |
162 | 177 | |
163 | 178 | /// Implementation of IDeviceContext::UpdateTexture() in Direct3D12 backend. |
164 | virtual void UpdateTexture(ITexture* pTexture, | |
165 | Uint32 MipLevel, | |
166 | Uint32 Slice, | |
167 | const Box& DstBox, | |
168 | const TextureSubResData& SubresData, | |
169 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
170 | RESOURCE_STATE_TRANSITION_MODE TextureTransitionMode) override final; | |
179 | virtual void DILIGENT_CALL_TYPE UpdateTexture(ITexture* pTexture, | |
180 | Uint32 MipLevel, | |
181 | Uint32 Slice, | |
182 | const Box& DstBox, | |
183 | const TextureSubResData& SubresData, | |
184 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
185 | RESOURCE_STATE_TRANSITION_MODE TextureTransitionMode) override final; | |
171 | 186 | |
172 | 187 | /// Implementation of IDeviceContext::CopyTexture() in Direct3D12 backend. |
173 | virtual void CopyTexture(const CopyTextureAttribs& CopyAttribs) override final; | |
188 | virtual void DILIGENT_CALL_TYPE CopyTexture(const CopyTextureAttribs& CopyAttribs) override final; | |
174 | 189 | |
175 | 190 | /// Implementation of IDeviceContext::MapTextureSubresource() in Direct3D12 backend. |
176 | virtual void MapTextureSubresource(ITexture* pTexture, | |
177 | Uint32 MipLevel, | |
178 | Uint32 ArraySlice, | |
179 | MAP_TYPE MapType, | |
180 | MAP_FLAGS MapFlags, | |
181 | const Box* pMapRegion, | |
182 | MappedTextureSubresource& MappedData) override final; | |
191 | virtual void DILIGENT_CALL_TYPE MapTextureSubresource(ITexture* pTexture, | |
192 | Uint32 MipLevel, | |
193 | Uint32 ArraySlice, | |
194 | MAP_TYPE MapType, | |
195 | MAP_FLAGS MapFlags, | |
196 | const Box* pMapRegion, | |
197 | MappedTextureSubresource& MappedData) override final; | |
183 | 198 | |
184 | 199 | /// Implementation of IDeviceContext::UnmapTextureSubresource() in Direct3D12 backend. |
185 | virtual void UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice) override final; | |
200 | virtual void DILIGENT_CALL_TYPE UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice) override final; | |
186 | 201 | |
187 | 202 | /// Implementation of IDeviceContext::FinishFrame() in Direct3D12 backend. |
188 | virtual void FinishFrame() override final; | |
203 | virtual void DILIGENT_CALL_TYPE FinishFrame() override final; | |
189 | 204 | |
190 | 205 | /// Implementation of IDeviceContext::TransitionResourceStates() in Direct3D12 backend. |
191 | virtual void TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers) override final; | |
206 | virtual void DILIGENT_CALL_TYPE TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers) override final; | |
192 | 207 | |
193 | 208 | /// Implementation of IDeviceContext::ResolveTextureSubresource() in Direct3D12 backend. |
194 | virtual void ResolveTextureSubresource(ITexture* pSrcTexture, | |
195 | ITexture* pDstTexture, | |
196 | const ResolveTextureSubresourceAttribs& ResolveAttribs) override final; | |
209 | virtual void DILIGENT_CALL_TYPE ResolveTextureSubresource(ITexture* pSrcTexture, | |
210 | ITexture* pDstTexture, | |
211 | const ResolveTextureSubresourceAttribs& ResolveAttribs) override final; | |
197 | 212 | |
198 | 213 | /// Implementation of IDeviceContext::FinishCommandList() in Direct3D12 backend. |
199 | virtual void FinishCommandList(class ICommandList** ppCommandList) override final; | |
214 | virtual void DILIGENT_CALL_TYPE FinishCommandList(class ICommandList** ppCommandList) override final; | |
200 | 215 | |
201 | 216 | /// Implementation of IDeviceContext::ExecuteCommandList() in Direct3D12 backend. |
202 | virtual void ExecuteCommandList(class ICommandList* pCommandList) override final; | |
217 | virtual void DILIGENT_CALL_TYPE ExecuteCommandList(class ICommandList* pCommandList) override final; | |
203 | 218 | |
204 | 219 | /// Implementation of IDeviceContext::SignalFence() in Direct3D12 backend. |
205 | virtual void SignalFence(IFence* pFence, Uint64 Value) override final; | |
220 | virtual void DILIGENT_CALL_TYPE SignalFence(IFence* pFence, Uint64 Value) override final; | |
206 | 221 | |
207 | 222 | /// Implementation of IDeviceContext::WaitForFence() in Direct3D12 backend. |
208 | virtual void WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext) override final; | |
223 | virtual void DILIGENT_CALL_TYPE WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext) override final; | |
209 | 224 | |
210 | 225 | /// Implementation of IDeviceContext::WaitForIdle() in Direct3D12 backend. |
211 | virtual void WaitForIdle() override final; | |
226 | virtual void DILIGENT_CALL_TYPE WaitForIdle() override final; | |
212 | 227 | |
213 | 228 | /// Implementation of IDeviceContext::BeginQuery() in Direct3D12 backend. |
214 | virtual void BeginQuery(IQuery* pQuery) override final; | |
229 | virtual void DILIGENT_CALL_TYPE BeginQuery(IQuery* pQuery) override final; | |
215 | 230 | |
216 | 231 | /// Implementation of IDeviceContext::EndQuery() in Direct3D12 backend. |
217 | virtual void EndQuery(IQuery* pQuery) override final; | |
232 | virtual void DILIGENT_CALL_TYPE EndQuery(IQuery* pQuery) override final; | |
218 | 233 | |
219 | 234 | /// Implementation of IDeviceContext::Flush() in Direct3D12 backend. |
220 | virtual void Flush() override final; | |
235 | virtual void DILIGENT_CALL_TYPE Flush() override final; | |
221 | 236 | |
222 | 237 | /// Implementation of IDeviceContext::TransitionTextureState() in Direct3D12 backend. |
223 | virtual void TransitionTextureState(ITexture* pTexture, D3D12_RESOURCE_STATES State) override final; | |
238 | virtual void DILIGENT_CALL_TYPE TransitionTextureState(ITexture* pTexture, D3D12_RESOURCE_STATES State) override final; | |
224 | 239 | |
225 | 240 | /// Implementation of IDeviceContext::TransitionBufferState() in Direct3D12 backend. |
226 | virtual void TransitionBufferState(IBuffer* pBuffer, D3D12_RESOURCE_STATES State) override final; | |
241 | virtual void DILIGENT_CALL_TYPE TransitionBufferState(IBuffer* pBuffer, D3D12_RESOURCE_STATES State) override final; | |
227 | 242 | |
228 | 243 | /// Implementation of IDeviceContextD3D12::ID3D12GraphicsCommandList() in Direct3D12 backend. |
229 | virtual ID3D12GraphicsCommandList* GetD3D12CommandList() override final; | |
244 | virtual ID3D12GraphicsCommandList* DILIGENT_CALL_TYPE GetD3D12CommandList() override final; | |
230 | 245 | |
231 | 246 | ///// Number of different shader types (Vertex, Pixel, Geometry, Domain, Hull, Compute) |
232 | 247 | //static constexpr int NumShaderTypes = 6; |
275 | 290 | const Box& DstBox, |
276 | 291 | RESOURCE_STATE_TRANSITION_MODE TextureTransitionMode); |
277 | 292 | |
278 | virtual void GenerateMips(ITextureView* pTexView) override final; | |
293 | virtual void DILIGENT_CALL_TYPE GenerateMips(ITextureView* pTexView) override final; | |
279 | 294 | |
280 | 295 | D3D12DynamicAllocation AllocateDynamicSpace(size_t NumBytes, size_t Alignment); |
281 | 296 |
53 | 53 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_FenceD3D12, TFenceBase); |
54 | 54 | |
55 | 55 | /// Implementation of IFence::GetCompletedValue() in Direct3D12 backend. |
56 | virtual Uint64 GetCompletedValue() override final; | |
56 | virtual Uint64 DILIGENT_CALL_TYPE GetCompletedValue() override final; | |
57 | 57 | |
58 | 58 | /// Implementation of IFence::GetCompletedValue() in Direct3D12 backend. |
59 | virtual void Reset(Uint64 Value) override final; | |
59 | virtual void DILIGENT_CALL_TYPE Reset(Uint64 Value) override final; | |
60 | 60 | |
61 | 61 | /// Implementation of IFenceD3D12::GetD3D12Fence(). |
62 | ID3D12Fence* GetD3D12Fence() override final { return m_pd3d12Fence; } | |
62 | virtual ID3D12Fence* DILIGENT_CALL_TYPE GetD3D12Fence() override final { return m_pd3d12Fence; } | |
63 | 63 | |
64 | 64 | /// Implementation of IFenceD3D12::WaitForCompletion(). |
65 | virtual void WaitForCompletion(Uint64 Value) override final; | |
65 | virtual void DILIGENT_CALL_TYPE WaitForCompletion(Uint64 Value) override final; | |
66 | 66 | |
67 | 67 | private: |
68 | 68 | CComPtr<ID3D12Fence> m_pd3d12Fence; ///< D3D12 Fence object |
52 | 52 | PipelineStateD3D12Impl(IReferenceCounters* pRefCounters, RenderDeviceD3D12Impl* pDeviceD3D12, const PipelineStateDesc& PipelineDesc); |
53 | 53 | ~PipelineStateD3D12Impl(); |
54 | 54 | |
55 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
55 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
56 | 56 | |
57 | 57 | /// Implementation of IPipelineState::BindStaticResources() in Direct3D12 backend. |
58 | virtual void BindStaticResources(Uint32 ShaderFlags, IResourceMapping* pResourceMapping, Uint32 Flags) override final; | |
58 | virtual void DILIGENT_CALL_TYPE BindStaticResources(Uint32 ShaderFlags, IResourceMapping* pResourceMapping, Uint32 Flags) override final; | |
59 | 59 | |
60 | 60 | /// Implementation of IPipelineState::GetStaticVariableCount() in Direct3D12 backend. |
61 | virtual Uint32 GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; | |
61 | virtual Uint32 DILIGENT_CALL_TYPE GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; | |
62 | 62 | |
63 | 63 | /// Implementation of IPipelineState::GetStaticVariableByName() in Direct3D12 backend. |
64 | virtual IShaderResourceVariable* GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) override final; | |
64 | virtual IShaderResourceVariable* DILIGENT_CALL_TYPE GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) override final; | |
65 | 65 | |
66 | 66 | /// Implementation of IPipelineState::GetStaticVariableByIndex() in Direct3D12 backend. |
67 | virtual IShaderResourceVariable* GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; | |
67 | virtual IShaderResourceVariable* DILIGENT_CALL_TYPE GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; | |
68 | 68 | |
69 | 69 | /// Implementation of IPipelineState::CreateShaderResourceBinding() in Direct3D12 backend. |
70 | virtual void CreateShaderResourceBinding(IShaderResourceBinding** ppShaderResourceBinding, bool InitStaticResources) override final; | |
70 | virtual void DILIGENT_CALL_TYPE CreateShaderResourceBinding(IShaderResourceBinding** ppShaderResourceBinding, bool InitStaticResources) override final; | |
71 | 71 | |
72 | 72 | /// Implementation of IPipelineState::IsCompatibleWith() in Direct3D12 backend. |
73 | virtual bool IsCompatibleWith(const IPipelineState* pPSO) const override final; | |
73 | virtual bool DILIGENT_CALL_TYPE IsCompatibleWith(const IPipelineState* pPSO) const override final; | |
74 | 74 | |
75 | 75 | /// Implementation of IPipelineStateD3D12::GetD3D12PipelineState(). |
76 | virtual ID3D12PipelineState* GetD3D12PipelineState() const override final { return m_pd3d12PSO; } | |
76 | virtual ID3D12PipelineState* DILIGENT_CALL_TYPE DILIGENT_CALL_TYPE GetD3D12PipelineState() const override final { return m_pd3d12PSO; } | |
77 | 77 | |
78 | 78 | /// Implementation of IPipelineStateD3D12::GetD3D12RootSignature(). |
79 | virtual ID3D12RootSignature* GetD3D12RootSignature() const override final { return m_RootSig.GetD3D12RootSignature(); } | |
79 | virtual ID3D12RootSignature* DILIGENT_CALL_TYPE GetD3D12RootSignature() const override final { return m_RootSig.GetD3D12RootSignature(); } | |
80 | 80 | |
81 | 81 | struct CommitAndTransitionResourcesAttribs |
82 | 82 | { |
54 | 54 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_QueryD3D12, TQueryBase); |
55 | 55 | |
56 | 56 | /// Implementation of IQuery::GetData(). |
57 | virtual bool GetData(void* pData, Uint32 DataSize, bool AutoInvalidate) override final; | |
57 | virtual bool DILIGENT_CALL_TYPE GetData(void* pData, Uint32 DataSize, bool AutoInvalidate) override final; | |
58 | 58 | |
59 | 59 | /// Implementation of IQueryD3D12::GetD3D12QueryHeap(). |
60 | virtual ID3D12QueryHeap* GetD3D12QueryHeap() override final | |
60 | virtual ID3D12QueryHeap* DILIGENT_CALL_TYPE GetD3D12QueryHeap() override final | |
61 | 61 | { |
62 | 62 | return m_pDevice->GetQueryManager().GetQueryHeap(m_Desc.Type); |
63 | 63 | } |
64 | 64 | |
65 | 65 | /// Implementation of IQueryD3D12::GetQueryHeapIndex(). |
66 | virtual Uint32 GetQueryHeapIndex() const override final | |
66 | virtual Uint32 DILIGENT_CALL_TYPE GetQueryHeapIndex() const override final | |
67 | 67 | { |
68 | 68 | return m_QueryHeapIndex; |
69 | 69 | } |
58 | 58 | ICommandQueueD3D12** ppCmdQueues); |
59 | 59 | ~RenderDeviceD3D12Impl(); |
60 | 60 | |
61 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
61 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
62 | 62 | |
63 | 63 | /// Implementation of IRenderDevice::CreatePipelineState() in Direct3D12 backend. |
64 | virtual void CreatePipelineState(const PipelineStateDesc& PipelineDesc, IPipelineState** ppPipelineState) override final; | |
64 | virtual void DILIGENT_CALL_TYPE CreatePipelineState(const PipelineStateDesc& PipelineDesc, IPipelineState** ppPipelineState) override final; | |
65 | 65 | |
66 | 66 | /// Implementation of IRenderDevice::CreateBuffer() in Direct3D12 backend. |
67 | virtual void CreateBuffer(const BufferDesc& BuffDesc, const BufferData* pBuffData, IBuffer** ppBuffer) override final; | |
67 | virtual void DILIGENT_CALL_TYPE CreateBuffer(const BufferDesc& BuffDesc, | |
68 | const BufferData* pBuffData, | |
69 | IBuffer** ppBuffer) override final; | |
68 | 70 | |
69 | 71 | /// Implementation of IRenderDevice::CreateShader() in Direct3D12 backend. |
70 | virtual void CreateShader(const ShaderCreateInfo& ShaderCreateInfo, IShader** ppShader) override final; | |
72 | virtual void DILIGENT_CALL_TYPE CreateShader(const ShaderCreateInfo& ShaderCreateInfo, IShader** ppShader) override final; | |
71 | 73 | |
72 | 74 | /// Implementation of IRenderDevice::CreateTexture() in Direct3D12 backend. |
73 | virtual void CreateTexture(const TextureDesc& TexDesc, const TextureData* pData, ITexture** ppTexture) override final; | |
75 | virtual void DILIGENT_CALL_TYPE CreateTexture(const TextureDesc& TexDesc, | |
76 | const TextureData* pData, | |
77 | ITexture** ppTexture) override final; | |
74 | 78 | |
75 | void CreateTexture(const TextureDesc& TexDesc, ID3D12Resource* pd3d12Texture, RESOURCE_STATE InitialState, class TextureD3D12Impl** ppTexture); | |
79 | void CreateTexture(const TextureDesc& TexDesc, | |
80 | ID3D12Resource* pd3d12Texture, | |
81 | RESOURCE_STATE InitialState, | |
82 | class TextureD3D12Impl** ppTexture); | |
76 | 83 | |
77 | 84 | /// Implementation of IRenderDevice::CreateSampler() in Direct3D12 backend. |
78 | virtual void CreateSampler(const SamplerDesc& SamplerDesc, ISampler** ppSampler) override final; | |
85 | virtual void DILIGENT_CALL_TYPE CreateSampler(const SamplerDesc& SamplerDesc, | |
86 | ISampler** ppSampler) override final; | |
79 | 87 | |
80 | 88 | /// Implementation of IRenderDevice::CreateFence() in Direct3D12 backend. |
81 | virtual void CreateFence(const FenceDesc& Desc, IFence** ppFence) override final; | |
89 | virtual void DILIGENT_CALL_TYPE CreateFence(const FenceDesc& Desc, IFence** ppFence) override final; | |
82 | 90 | |
83 | 91 | /// Implementation of IRenderDevice::CreateQuery() in Direct3D12 backend. |
84 | virtual void CreateQuery(const QueryDesc& Desc, IQuery** ppQuery) override final; | |
92 | virtual void DILIGENT_CALL_TYPE CreateQuery(const QueryDesc& Desc, IQuery** ppQuery) override final; | |
85 | 93 | |
86 | 94 | /// Implementation of IRenderDeviceD3D12::GetD3D12Device(). |
87 | virtual ID3D12Device* GetD3D12Device() override final { return m_pd3d12Device; } | |
95 | virtual ID3D12Device* DILIGENT_CALL_TYPE GetD3D12Device() override final { return m_pd3d12Device; } | |
88 | 96 | |
89 | 97 | /// Implementation of IRenderDeviceD3D12::CreateTextureFromD3DResource(). |
90 | virtual void CreateTextureFromD3DResource(ID3D12Resource* pd3d12Texture, RESOURCE_STATE InitialState, ITexture** ppTexture) override final; | |
98 | virtual void DILIGENT_CALL_TYPE CreateTextureFromD3DResource(ID3D12Resource* pd3d12Texture, | |
99 | RESOURCE_STATE InitialState, | |
100 | ITexture** ppTexture) override final; | |
91 | 101 | |
92 | 102 | /// Implementation of IRenderDeviceD3D12::CreateBufferFromD3DResource(). |
93 | virtual void CreateBufferFromD3DResource(ID3D12Resource* pd3d12Buffer, const BufferDesc& BuffDesc, RESOURCE_STATE InitialState, IBuffer** ppBuffer) override final; | |
103 | virtual void DILIGENT_CALL_TYPE CreateBufferFromD3DResource(ID3D12Resource* pd3d12Buffer, | |
104 | const BufferDesc& BuffDesc, | |
105 | RESOURCE_STATE InitialState, | |
106 | IBuffer** ppBuffer) override final; | |
94 | 107 | |
95 | 108 | DescriptorHeapAllocation AllocateDescriptor(D3D12_DESCRIPTOR_HEAP_TYPE Type, UINT Count = 1); |
96 | 109 | DescriptorHeapAllocation AllocateGPUDescriptors(D3D12_DESCRIPTOR_HEAP_TYPE Type, UINT Count = 1); |
97 | 110 | |
98 | 111 | /// Implementation of IRenderDevice::IdleGPU() in Direct3D12 backend. |
99 | virtual void IdleGPU() override final; | |
112 | virtual void DILIGENT_CALL_TYPE IdleGPU() override final; | |
100 | 113 | |
101 | 114 | using PooledCommandContext = std::unique_ptr<CommandContext, STDDeleterRawMem<CommandContext>>; |
102 | 115 | PooledCommandContext AllocateCommandContext(const Char* ID = ""); |
116 | 129 | void FlushStaleResources(Uint32 CmdQueueIndex); |
117 | 130 | |
118 | 131 | /// Implementation of IRenderDevice::() in Direct3D12 backend. |
119 | virtual void ReleaseStaleResources(bool ForceRelease = false) override final; | |
132 | virtual void DILIGENT_CALL_TYPE ReleaseStaleResources(bool ForceRelease = false) override final; | |
120 | 133 | |
121 | 134 | D3D12DynamicMemoryManager& GetDynamicMemoryManager() { return m_DynamicMemoryManager; } |
122 | 135 |
51 | 51 | const SamplerDesc& SamplerDesc); |
52 | 52 | ~SamplerD3D12Impl(); |
53 | 53 | |
54 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
54 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
55 | 55 | |
56 | 56 | /// Implementation of ISamplerD3D12::GetCPUDescriptorHandle(). |
57 | virtual D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() override { return m_Descriptor.GetCpuHandle(); } | |
57 | virtual D3D12_CPU_DESCRIPTOR_HANDLE DILIGENT_CALL_TYPE GetCPUDescriptorHandle() override { return m_Descriptor.GetCpuHandle(); } | |
58 | 58 | |
59 | 59 | private: |
60 | 60 | friend class ShaderD3D12Impl; |
53 | 53 | const ShaderCreateInfo& ShaderCI); |
54 | 54 | ~ShaderD3D12Impl(); |
55 | 55 | |
56 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
56 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
57 | 57 | |
58 | 58 | /// Implementation of IShader::GetResourceCount() in Direct3D12 backend. |
59 | virtual Uint32 GetResourceCount() const override final | |
59 | virtual Uint32 DILIGENT_CALL_TYPE GetResourceCount() const override final | |
60 | 60 | { |
61 | 61 | return m_pShaderResources->GetTotalResources(); |
62 | 62 | } |
63 | 63 | |
64 | 64 | /// Implementation of IShader::GetResource() in Direct3D12 backend. |
65 | virtual void GetResourceDesc(Uint32 Index, ShaderResourceDesc& ResourceDesc) const override final | |
65 | virtual void DILIGENT_CALL_TYPE GetResourceDesc(Uint32 Index, ShaderResourceDesc& ResourceDesc) const override final | |
66 | 66 | { |
67 | 67 | ResourceDesc = m_pShaderResources->GetHLSLShaderResourceDesc(Index); |
68 | 68 | } |
69 | 69 | |
70 | 70 | /// Implementation of IShaderD3D::GetHLSLResource() in Direct3D12 backend. |
71 | virtual void GetHLSLResource(Uint32 Index, HLSLShaderResourceDesc& ResourceDesc) const override final | |
71 | virtual void DILIGENT_CALL_TYPE GetHLSLResource(Uint32 Index, HLSLShaderResourceDesc& ResourceDesc) const override final | |
72 | 72 | { |
73 | 73 | ResourceDesc = m_pShaderResources->GetHLSLShaderResourceDesc(Index); |
74 | 74 | } |
52 | 52 | bool IsPSOInternal); |
53 | 53 | ~ShaderResourceBindingD3D12Impl(); |
54 | 54 | |
55 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
55 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
56 | 56 | |
57 | virtual void BindResources(Uint32 ShaderFlags, IResourceMapping* pResMapping, Uint32 Flags) override; | |
57 | virtual void DILIGENT_CALL_TYPE BindResources(Uint32 ShaderFlags, IResourceMapping* pResMapping, Uint32 Flags) override; | |
58 | 58 | |
59 | virtual IShaderResourceVariable* GetVariableByName(SHADER_TYPE ShaderType, const char* Name) override; | |
59 | virtual IShaderResourceVariable* DILIGENT_CALL_TYPE GetVariableByName(SHADER_TYPE ShaderType, const char* Name) override; | |
60 | 60 | |
61 | virtual Uint32 GetVariableCount(SHADER_TYPE ShaderType) const override final; | |
61 | virtual Uint32 DILIGENT_CALL_TYPE GetVariableCount(SHADER_TYPE ShaderType) const override final; | |
62 | 62 | |
63 | virtual IShaderResourceVariable* GetVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; | |
63 | virtual IShaderResourceVariable* DILIGENT_CALL_TYPE GetVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; | |
64 | 64 | |
65 | virtual void InitializeStaticResources(const IPipelineState* pPipelineState) override final; | |
65 | virtual void DILIGENT_CALL_TYPE InitializeStaticResources(const IPipelineState* pPipelineState) override final; | |
66 | 66 | |
67 | 67 | ShaderResourceCacheD3D12& GetResourceCache() { return m_ShaderResourceCache; } |
68 | 68 |
141 | 141 | ShaderVariableD3D12Impl& operator= (ShaderVariableD3D12Impl&&) = delete; |
142 | 142 | // clang-format on |
143 | 143 | |
144 | virtual IReferenceCounters* GetReferenceCounters() const override final | |
144 | virtual IReferenceCounters* DILIGENT_CALL_TYPE GetReferenceCounters() const override final | |
145 | 145 | { |
146 | 146 | return m_ParentManager.m_Owner.GetReferenceCounters(); |
147 | 147 | } |
148 | 148 | |
149 | virtual Atomics::Long AddRef() override final | |
149 | virtual Atomics::Long DILIGENT_CALL_TYPE AddRef() override final | |
150 | 150 | { |
151 | 151 | return m_ParentManager.m_Owner.AddRef(); |
152 | 152 | } |
153 | 153 | |
154 | virtual Atomics::Long Release() override final | |
154 | virtual Atomics::Long DILIGENT_CALL_TYPE Release() override final | |
155 | 155 | { |
156 | 156 | return m_ParentManager.m_Owner.Release(); |
157 | 157 | } |
158 | 158 | |
159 | void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final | |
159 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final | |
160 | 160 | { |
161 | 161 | if (ppInterface == nullptr) |
162 | 162 | return; |
169 | 169 | } |
170 | 170 | } |
171 | 171 | |
172 | virtual SHADER_RESOURCE_VARIABLE_TYPE GetType() const override final | |
172 | virtual SHADER_RESOURCE_VARIABLE_TYPE DILIGENT_CALL_TYPE GetType() const override final | |
173 | 173 | { |
174 | 174 | return m_Resource.GetVariableType(); |
175 | 175 | } |
176 | 176 | |
177 | virtual void Set(IDeviceObject* pObject) override final | |
177 | virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final | |
178 | 178 | { |
179 | 179 | m_Resource.BindResource(pObject, 0, m_ParentManager.m_ResourceCache); |
180 | 180 | } |
181 | 181 | |
182 | virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
182 | virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
183 | 183 | { |
184 | 184 | VerifyAndCorrectSetArrayArguments(m_Resource.Attribs.Name, m_Resource.Attribs.BindCount, FirstElement, NumElements); |
185 | 185 | for (Uint32 Elem = 0; Elem < NumElements; ++Elem) |
186 | 186 | m_Resource.BindResource(ppObjects[Elem], FirstElement + Elem, m_ParentManager.m_ResourceCache); |
187 | 187 | } |
188 | 188 | |
189 | virtual void GetResourceDesc(ShaderResourceDesc& ResourceDesc) const override final | |
189 | virtual void DILIGENT_CALL_TYPE GetResourceDesc(ShaderResourceDesc& ResourceDesc) const override final | |
190 | 190 | { |
191 | 191 | ResourceDesc = GetHLSLResourceDesc(); |
192 | 192 | } |
193 | 193 | |
194 | virtual HLSLShaderResourceDesc GetHLSLResourceDesc() const override final | |
194 | virtual HLSLShaderResourceDesc DILIGENT_CALL_TYPE GetHLSLResourceDesc() const override final | |
195 | 195 | { |
196 | 196 | return m_Resource.Attribs.GetHLSLResourceDesc(); |
197 | 197 | } |
198 | 198 | |
199 | virtual Uint32 GetIndex() const override final | |
199 | virtual Uint32 DILIGENT_CALL_TYPE GetIndex() const override final | |
200 | 200 | { |
201 | 201 | return m_ParentManager.GetVariableIndex(*this); |
202 | 202 | } |
203 | 203 | |
204 | virtual bool IsBound(Uint32 ArrayIndex) const override final | |
204 | virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final | |
205 | 205 | { |
206 | 206 | return m_Resource.IsBound(ArrayIndex, m_ParentManager.m_ResourceCache); |
207 | 207 | } |
50 | 50 | void* pNativeWndHandle); |
51 | 51 | ~SwapChainD3D12Impl(); |
52 | 52 | |
53 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
53 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
54 | 54 | |
55 | 55 | /// Implementation of ISwapChain::Present() in Direct3D12 backend. |
56 | virtual void Present(Uint32 SyncInterval) override final; | |
56 | virtual void DILIGENT_CALL_TYPE Present(Uint32 SyncInterval) override final; | |
57 | 57 | |
58 | 58 | /// Implementation of ISwapChain::Resize() in Direct3D12 backend. |
59 | virtual void Resize(Uint32 NewWidth, Uint32 NewHeight) override final; | |
59 | virtual void DILIGENT_CALL_TYPE Resize(Uint32 NewWidth, Uint32 NewHeight) override final; | |
60 | 60 | |
61 | 61 | /// Implementation of ISwapChainD3D12::GetDXGISwapChain(). |
62 | virtual IDXGISwapChain* GetDXGISwapChain() override final { return m_pSwapChain; } | |
62 | virtual IDXGISwapChain* DILIGENT_CALL_TYPE GetDXGISwapChain() override final { return m_pSwapChain; } | |
63 | 63 | |
64 | 64 | /// Implementation of ISwapChain::GetCurrentBackBufferRTV() in Direct3D12 backend. |
65 | virtual ITextureViewD3D12* GetCurrentBackBufferRTV() override final | |
65 | virtual ITextureViewD3D12* DILIGENT_CALL_TYPE GetCurrentBackBufferRTV() override final | |
66 | 66 | { |
67 | 67 | auto CurrentBackBufferIndex = m_pSwapChain->GetCurrentBackBufferIndex(); |
68 | 68 | VERIFY_EXPR(CurrentBackBufferIndex >= 0 && CurrentBackBufferIndex < m_SwapChainDesc.BufferCount); |
70 | 70 | } |
71 | 71 | |
72 | 72 | /// Implementation of ISwapChain::GetDepthBufferDSV() in Direct3D12 backend. |
73 | virtual ITextureViewD3D12* GetDepthBufferDSV() override final { return m_pDepthBufferDSV; } | |
73 | virtual ITextureViewD3D12* DILIGENT_CALL_TYPE GetDepthBufferDSV() override final { return m_pDepthBufferDSV; } | |
74 | 74 | |
75 | 75 | private: |
76 | 76 | virtual void UpdateSwapChain(bool CreateNew) override final; |
64 | 64 | ID3D12Resource* pTexture); |
65 | 65 | ~TextureD3D12Impl(); |
66 | 66 | |
67 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
67 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
68 | 68 | |
69 | 69 | /// Implementation of ITextureD3D12::GetD3D12Texture(). |
70 | virtual ID3D12Resource* GetD3D12Texture() override final { return GetD3D12Resource(); } | |
70 | virtual ID3D12Resource* DILIGENT_CALL_TYPE GetD3D12Texture() override final { return GetD3D12Resource(); } | |
71 | 71 | |
72 | 72 | /// Implementation of ITexture::GetNativeHandle() in Direct3D12 backend. |
73 | virtual void* GetNativeHandle() override final { return GetD3D12Texture(); } | |
73 | virtual void* DILIGENT_CALL_TYPE GetNativeHandle() override final { return GetD3D12Texture(); } | |
74 | 74 | |
75 | 75 | /// Implementation of ITextureD3D12::SetD3D12ResourceState(). |
76 | virtual void SetD3D12ResourceState(D3D12_RESOURCE_STATES state) override final; | |
76 | virtual void DILIGENT_CALL_TYPE SetD3D12ResourceState(D3D12_RESOURCE_STATES state) override final; | |
77 | 77 | |
78 | 78 | /// Implementation of ITextureD3D12::GetD3D12ResourceState(). |
79 | virtual D3D12_RESOURCE_STATES GetD3D12ResourceState() const override final; | |
79 | virtual D3D12_RESOURCE_STATES DILIGENT_CALL_TYPE GetD3D12ResourceState() const override final; | |
80 | 80 | |
81 | 81 | D3D12_RESOURCE_DESC GetD3D12TextureDesc() const; |
82 | 82 |
56 | 56 | bool bIsDefaultView); |
57 | 57 | ~TextureViewD3D12Impl(); |
58 | 58 | |
59 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
59 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
60 | 60 | |
61 | 61 | /// Implementation of ITextureViewD3D12::GetCPUDescriptorHandle(). |
62 | virtual D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() override final | |
62 | virtual D3D12_CPU_DESCRIPTOR_HANDLE DILIGENT_CALL_TYPE GetCPUDescriptorHandle() override final | |
63 | 63 | { |
64 | 64 | return m_Descriptor.GetCpuHandle(); |
65 | 65 | } |
67 | 67 | TBase{IID_EngineFactoryD3D12} |
68 | 68 | {} |
69 | 69 | |
70 | bool LoadD3D12(const char* DllName) override final; | |
71 | ||
72 | void CreateDeviceAndContextsD3D12(const EngineD3D12CreateInfo& EngineCI, | |
73 | IRenderDevice** ppDevice, | |
74 | IDeviceContext** ppContexts) override final; | |
75 | ||
76 | void AttachToD3D12Device(void* pd3d12NativeDevice, | |
77 | size_t CommandQueueCount, | |
78 | ICommandQueueD3D12** ppCommandQueues, | |
79 | const EngineD3D12CreateInfo& EngineCI, | |
80 | IRenderDevice** ppDevice, | |
81 | IDeviceContext** ppContexts) override final; | |
82 | ||
83 | void CreateSwapChainD3D12(IRenderDevice* pDevice, | |
84 | IDeviceContext* pImmediateContext, | |
85 | const SwapChainDesc& SwapChainDesc, | |
86 | const FullScreenModeDesc& FSDesc, | |
87 | void* pNativeWndHandle, | |
88 | ISwapChain** ppSwapChain) override final; | |
89 | ||
90 | virtual void EnumerateAdapters(DIRECT3D_FEATURE_LEVEL MinFeatureLevel, | |
91 | Uint32& NumAdapters, | |
92 | AdapterAttribs* Adapters) override final; | |
93 | ||
94 | virtual void EnumerateDisplayModes(DIRECT3D_FEATURE_LEVEL MinFeatureLevel, | |
95 | Uint32 AdapterId, | |
96 | Uint32 OutputId, | |
97 | TEXTURE_FORMAT Format, | |
98 | Uint32& NumDisplayModes, | |
99 | DisplayModeAttribs* DisplayModes) override final; | |
70 | bool DILIGENT_CALL_TYPE LoadD3D12(const char* DllName) override final; | |
71 | ||
72 | virtual void DILIGENT_CALL_TYPE CreateDeviceAndContextsD3D12(const EngineD3D12CreateInfo& EngineCI, | |
73 | IRenderDevice** ppDevice, | |
74 | IDeviceContext** ppContexts) override final; | |
75 | ||
76 | virtual void DILIGENT_CALL_TYPE AttachToD3D12Device(void* pd3d12NativeDevice, | |
77 | size_t CommandQueueCount, | |
78 | ICommandQueueD3D12** ppCommandQueues, | |
79 | const EngineD3D12CreateInfo& EngineCI, | |
80 | IRenderDevice** ppDevice, | |
81 | IDeviceContext** ppContexts) override final; | |
82 | ||
83 | virtual void DILIGENT_CALL_TYPE CreateSwapChainD3D12(IRenderDevice* pDevice, | |
84 | IDeviceContext* pImmediateContext, | |
85 | const SwapChainDesc& SwapChainDesc, | |
86 | const FullScreenModeDesc& FSDesc, | |
87 | void* pNativeWndHandle, | |
88 | ISwapChain** ppSwapChain) override final; | |
89 | ||
90 | virtual void DILIGENT_CALL_TYPE EnumerateAdapters(DIRECT3D_FEATURE_LEVEL MinFeatureLevel, | |
91 | Uint32& NumAdapters, | |
92 | AdapterAttribs* Adapters) override final; | |
93 | ||
94 | virtual void DILIGENT_CALL_TYPE EnumerateDisplayModes(DIRECT3D_FEATURE_LEVEL MinFeatureLevel, | |
95 | Uint32 AdapterId, | |
96 | Uint32 OutputId, | |
97 | TEXTURE_FORMAT Format, | |
98 | Uint32& NumDisplayModes, | |
99 | DisplayModeAttribs* DisplayModes) override final; | |
100 | 100 | |
101 | 101 | |
102 | 102 | private: |
46 | 46 | {} |
47 | 47 | |
48 | 48 | |
49 | virtual void EnumerateAdapters(DIRECT3D_FEATURE_LEVEL MinFeatureLevel, | |
50 | Uint32& NumAdapters, | |
51 | AdapterAttribs* Adapters) override | |
49 | virtual void DILIGENT_CALL_TYPE EnumerateAdapters(DIRECT3D_FEATURE_LEVEL MinFeatureLevel, | |
50 | Uint32& NumAdapters, | |
51 | AdapterAttribs* Adapters) override | |
52 | 52 | { |
53 | 53 | auto DXGIAdapters = FindCompatibleAdapters(MinFeatureLevel); |
54 | 54 | |
85 | 85 | } |
86 | 86 | |
87 | 87 | |
88 | virtual void EnumerateDisplayModes(DIRECT3D_FEATURE_LEVEL MinFeatureLevel, | |
89 | Uint32 AdapterId, | |
90 | Uint32 OutputId, | |
91 | TEXTURE_FORMAT Format, | |
92 | Uint32& NumDisplayModes, | |
93 | DisplayModeAttribs* DisplayModes) override | |
88 | virtual void DILIGENT_CALL_TYPE EnumerateDisplayModes(DIRECT3D_FEATURE_LEVEL MinFeatureLevel, | |
89 | Uint32 AdapterId, | |
90 | Uint32 OutputId, | |
91 | TEXTURE_FORMAT Format, | |
92 | Uint32& NumDisplayModes, | |
93 | DisplayModeAttribs* DisplayModes) override | |
94 | 94 | { |
95 | 95 | auto DXGIAdapters = FindCompatibleAdapters(MinFeatureLevel); |
96 | 96 | if (AdapterId >= DXGIAdapters.size()) |
59 | 59 | { |
60 | 60 | } |
61 | 61 | |
62 | virtual SHADER_RESOURCE_VARIABLE_TYPE GetType() const override final | |
62 | virtual SHADER_RESOURCE_VARIABLE_TYPE DILIGENT_CALL_TYPE GetType() const override final | |
63 | 63 | { |
64 | 64 | return m_VariableType; |
65 | 65 | } |
66 | 66 | |
67 | virtual void GetResourceDesc(ShaderResourceDesc& ResourceDesc) const override final | |
67 | virtual void DILIGENT_CALL_TYPE GetResourceDesc(ShaderResourceDesc& ResourceDesc) const override final | |
68 | 68 | { |
69 | 69 | ResourceDesc = GetHLSLResourceDesc(); |
70 | 70 | } |
71 | 71 | |
72 | virtual HLSLShaderResourceDesc GetHLSLResourceDesc() const override final | |
72 | virtual HLSLShaderResourceDesc DILIGENT_CALL_TYPE GetHLSLResourceDesc() const override final | |
73 | 73 | { |
74 | 74 | return m_Attribs.GetHLSLResourceDesc(); |
75 | 75 | } |
76 | 76 | |
77 | virtual Uint32 GetIndex() const override final | |
77 | virtual Uint32 DILIGENT_CALL_TYPE GetIndex() const override final | |
78 | 78 | { |
79 | 79 | return m_ParentResLayout.GetVariableIndex(*this); |
80 | 80 | } |
208 | 208 | pSwapChain1->QueryInterface(__uuidof(m_pSwapChain), reinterpret_cast<void**>(static_cast<DXGISwapChainType**>(&m_pSwapChain))); |
209 | 209 | } |
210 | 210 | |
211 | virtual void SetFullscreenMode(const DisplayModeAttribs& DisplayMode) override final | |
211 | virtual void DILIGENT_CALL_TYPE SetFullscreenMode(const DisplayModeAttribs& DisplayMode) override final | |
212 | 212 | { |
213 | 213 | if (m_pSwapChain) |
214 | 214 | { |
230 | 230 | } |
231 | 231 | } |
232 | 232 | |
233 | virtual void SetWindowedMode() override final | |
233 | virtual void DILIGENT_CALL_TYPE SetWindowedMode() override final | |
234 | 234 | { |
235 | 235 | if (m_FSDesc.Fullscreen) |
236 | 236 | { |
41 | 41 | { |
42 | 42 | public: |
43 | 43 | /// Returns HLSL ShaderResourceVariable resource description |
44 | virtual HLSLShaderResourceDesc GetHLSLResourceDesc() const = 0; | |
44 | virtual HLSLShaderResourceDesc DILIGENT_CALL_TYPE GetHLSLResourceDesc() const = 0; | |
45 | 45 | }; |
46 | 46 | |
47 | 47 | } // namespace Diligent |
67 | 67 | { |
68 | 68 | } |
69 | 69 | |
70 | virtual ICommandQueueType* LockCommandQueue() override final | |
70 | virtual ICommandQueueType* DILIGENT_CALL_TYPE LockCommandQueue() override final | |
71 | 71 | { |
72 | 72 | if (this->m_bIsDeferred) |
73 | 73 | { |
77 | 77 | return this->m_pDevice->LockCommandQueue(m_CommandQueueId); |
78 | 78 | } |
79 | 79 | |
80 | virtual void UnlockCommandQueue() override final | |
80 | virtual void DILIGENT_CALL_TYPE UnlockCommandQueue() override final | |
81 | 81 | { |
82 | 82 | if (this->m_bIsDeferred) |
83 | 83 | { |
233 | 233 | return m_CommandQueues[QueueIndex].ReleaseQueue; |
234 | 234 | } |
235 | 235 | |
236 | const CommandQueueType& GetCommandQueue(Uint32 QueueIndex) const | |
236 | const CommandQueueType& DILIGENT_CALL_TYPE GetCommandQueue(Uint32 QueueIndex) const | |
237 | 237 | { |
238 | 238 | VERIFY_EXPR(QueueIndex < m_CmdQueueCount); |
239 | 239 | return *m_CommandQueues[QueueIndex].CmdQueue; |
240 | 240 | } |
241 | 241 | |
242 | virtual Uint64 GetCompletedFenceValue(Uint32 QueueIndex) override final | |
242 | virtual Uint64 DILIGENT_CALL_TYPE GetCompletedFenceValue(Uint32 QueueIndex) override final | |
243 | 243 | { |
244 | 244 | return m_CommandQueues[QueueIndex].CmdQueue->GetCompletedFenceValue(); |
245 | 245 | } |
246 | 246 | |
247 | virtual Uint64 GetNextFenceValue(Uint32 QueueIndex) override final | |
247 | virtual Uint64 DILIGENT_CALL_TYPE GetNextFenceValue(Uint32 QueueIndex) override final | |
248 | 248 | { |
249 | 249 | return m_CommandQueues[QueueIndex].CmdQueue->GetNextFenceValue(); |
250 | 250 | } |
251 | 251 | |
252 | virtual Bool IsFenceSignaled(Uint32 QueueIndex, Uint64 FenceValue) override final | |
252 | virtual Bool DILIGENT_CALL_TYPE IsFenceSignaled(Uint32 QueueIndex, Uint64 FenceValue) override final | |
253 | 253 | { |
254 | 254 | return FenceValue <= GetCompletedFenceValue(QueueIndex); |
255 | 255 | } |
65 | 65 | ~BufferGLImpl(); |
66 | 66 | |
67 | 67 | /// Queries the specific interface, see IObject::QueryInterface() for details |
68 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
68 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
69 | 69 | |
70 | 70 | void UpdateData(GLContextState& CtxState, Uint32 Offset, Uint32 Size, const void* pData); |
71 | 71 | void CopyData(GLContextState& CtxState, BufferGLImpl& SrcBufferGL, Uint32 SrcOffset, Uint32 DstOffset, Uint32 Size); |
78 | 78 | const GLObjectWrappers::GLBufferObj& GetGLHandle() { return m_GlBuffer; } |
79 | 79 | |
80 | 80 | /// Implementation of IBufferGL::GetGLBufferHandle(). |
81 | virtual GLuint GetGLBufferHandle() override final { return GetGLHandle(); } | |
81 | virtual GLuint DILIGENT_CALL_TYPE GetGLBufferHandle() override final { return GetGLHandle(); } | |
82 | 82 | |
83 | 83 | /// Implementation of IBuffer::GetNativeHandle() in OpenGL backend. |
84 | virtual void* GetNativeHandle() override final { return reinterpret_cast<void*>(static_cast<size_t>(GetGLBufferHandle())); } | |
84 | virtual void* DILIGENT_CALL_TYPE GetNativeHandle() override final | |
85 | { | |
86 | return reinterpret_cast<void*>(static_cast<size_t>(GetGLBufferHandle())); | |
87 | } | |
85 | 88 | |
86 | 89 | private: |
87 | 90 | virtual void CreateViewInternal(const struct BufferViewDesc& ViewDesc, IBufferView** ppView, bool bIsDefaultView) override; |
50 | 50 | bool bIsDefaultView); |
51 | 51 | |
52 | 52 | /// Queries the specific interface, see IObject::QueryInterface() for details |
53 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
53 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
54 | 54 | |
55 | 55 | const GLObjectWrappers::GLTextureObj& GetTexBufferHandle() { return m_GLTexBuffer; } |
56 | 56 |
57 | 57 | DeviceContextGLImpl(IReferenceCounters* pRefCounters, RenderDeviceGLImpl* pDeviceGL, bool bIsDeferred); |
58 | 58 | |
59 | 59 | /// Queries the specific interface, see IObject::QueryInterface() for details. |
60 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
60 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
61 | 61 | |
62 | 62 | /// Implementation of IDeviceContext::SetPipelineState() in OpenGL backend. |
63 | virtual void SetPipelineState(IPipelineState* pPipelineState) override final; | |
63 | virtual void DILIGENT_CALL_TYPE SetPipelineState(IPipelineState* pPipelineState) override final; | |
64 | 64 | |
65 | 65 | /// Implementation of IDeviceContext::TransitionShaderResources() in OpenGL backend. |
66 | virtual void TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding) override final; | |
66 | virtual void DILIGENT_CALL_TYPE TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding) override final; | |
67 | 67 | |
68 | 68 | /// Implementation of IDeviceContext::CommitShaderResources() in OpenGL backend. |
69 | virtual void CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
69 | virtual void DILIGENT_CALL_TYPE CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, | |
70 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
70 | 71 | |
71 | 72 | /// Implementation of IDeviceContext::SetStencilRef() in OpenGL backend. |
72 | virtual void SetStencilRef(Uint32 StencilRef) override final; | |
73 | virtual void DILIGENT_CALL_TYPE SetStencilRef(Uint32 StencilRef) override final; | |
73 | 74 | |
74 | 75 | /// Implementation of IDeviceContext::SetBlendFactors() in OpenGL backend. |
75 | virtual void SetBlendFactors(const float* pBlendFactors = nullptr) override final; | |
76 | virtual void DILIGENT_CALL_TYPE SetBlendFactors(const float* pBlendFactors = nullptr) override final; | |
76 | 77 | |
77 | 78 | /// Implementation of IDeviceContext::SetVertexBuffers() in OpenGL backend. |
78 | virtual void SetVertexBuffers(Uint32 StartSlot, | |
79 | Uint32 NumBuffersSet, | |
80 | IBuffer** ppBuffers, | |
81 | Uint32* pOffsets, | |
82 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, | |
83 | SET_VERTEX_BUFFERS_FLAGS Flags) override final; | |
79 | virtual void DILIGENT_CALL_TYPE SetVertexBuffers(Uint32 StartSlot, | |
80 | Uint32 NumBuffersSet, | |
81 | IBuffer** ppBuffers, | |
82 | Uint32* pOffsets, | |
83 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, | |
84 | SET_VERTEX_BUFFERS_FLAGS Flags) override final; | |
84 | 85 | |
85 | 86 | /// Implementation of IDeviceContext::InvalidateState() in OpenGL backend. |
86 | virtual void InvalidateState() override final; | |
87 | virtual void DILIGENT_CALL_TYPE InvalidateState() override final; | |
87 | 88 | |
88 | 89 | /// Implementation of IDeviceContext::SetIndexBuffer() in OpenGL backend. |
89 | virtual void SetIndexBuffer(IBuffer* pIndexBuffer, Uint32 ByteOffset, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
90 | virtual void DILIGENT_CALL_TYPE SetIndexBuffer(IBuffer* pIndexBuffer, | |
91 | Uint32 ByteOffset, | |
92 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
90 | 93 | |
91 | 94 | /// Implementation of IDeviceContext::SetViewports() in OpenGL backend. |
92 | virtual void SetViewports(Uint32 NumViewports, const Viewport* pViewports, Uint32 RTWidth, Uint32 RTHeight) override final; | |
95 | virtual void DILIGENT_CALL_TYPE SetViewports(Uint32 NumViewports, | |
96 | const Viewport* pViewports, | |
97 | Uint32 RTWidth, | |
98 | Uint32 RTHeight) override final; | |
93 | 99 | |
94 | 100 | /// Implementation of IDeviceContext::SetScissorRects() in OpenGL backend. |
95 | virtual void SetScissorRects(Uint32 NumRects, const Rect* pRects, Uint32 RTWidth, Uint32 RTHeight) override final; | |
101 | virtual void DILIGENT_CALL_TYPE SetScissorRects(Uint32 NumRects, | |
102 | const Rect* pRects, | |
103 | Uint32 RTWidth, | |
104 | Uint32 RTHeight) override final; | |
96 | 105 | |
97 | 106 | /// Implementation of IDeviceContext::SetRenderTargets() in OpenGL backend. |
98 | virtual void SetRenderTargets(Uint32 NumRenderTargets, | |
99 | ITextureView* ppRenderTargets[], | |
100 | ITextureView* pDepthStencil, | |
101 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
107 | virtual void DILIGENT_CALL_TYPE SetRenderTargets(Uint32 NumRenderTargets, | |
108 | ITextureView* ppRenderTargets[], | |
109 | ITextureView* pDepthStencil, | |
110 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
102 | 111 | |
103 | 112 | // clang-format off |
104 | 113 | |
105 | 114 | /// Implementation of IDeviceContext::Draw() in OpenGL backend. |
106 | virtual void Draw (const DrawAttribs& Attribs) override final; | |
115 | virtual void DILIGENT_CALL_TYPE Draw (const DrawAttribs& Attribs) override final; | |
107 | 116 | /// Implementation of IDeviceContext::DrawIndexed() in OpenGL backend. |
108 | virtual void DrawIndexed (const DrawIndexedAttribs& Attribs) override final; | |
117 | virtual void DILIGENT_CALL_TYPE DrawIndexed (const DrawIndexedAttribs& Attribs) override final; | |
109 | 118 | /// Implementation of IDeviceContext::DrawIndirect() in OpenGL backend. |
110 | virtual void DrawIndirect (const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
119 | virtual void DILIGENT_CALL_TYPE DrawIndirect (const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
111 | 120 | /// Implementation of IDeviceContext::DrawIndexedIndirect() in OpenGL backend. |
112 | virtual void DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
121 | virtual void DILIGENT_CALL_TYPE DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
113 | 122 | |
114 | 123 | /// Implementation of IDeviceContext::DispatchCompute() in OpenGL backend. |
115 | virtual void DispatchCompute (const DispatchComputeAttribs& Attribs) override final; | |
124 | virtual void DILIGENT_CALL_TYPE DispatchCompute (const DispatchComputeAttribs& Attribs) override final; | |
116 | 125 | /// Implementation of IDeviceContext::DispatchComputeIndirect() in OpenGL backend. |
117 | virtual void DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
126 | virtual void DILIGENT_CALL_TYPE DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final; | |
118 | 127 | |
119 | 128 | // clang-format on |
120 | 129 | |
121 | 130 | /// Implementation of IDeviceContext::ClearDepthStencil() in OpenGL backend. |
122 | virtual void ClearDepthStencil(ITextureView* pView, | |
123 | CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, | |
124 | float fDepth, | |
125 | Uint8 Stencil, | |
126 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
131 | virtual void DILIGENT_CALL_TYPE ClearDepthStencil(ITextureView* pView, | |
132 | CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, | |
133 | float fDepth, | |
134 | Uint8 Stencil, | |
135 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
127 | 136 | |
128 | 137 | /// Implementation of IDeviceContext::ClearRenderTarget() in OpenGL backend. |
129 | virtual void ClearRenderTarget(ITextureView* pView, const float* RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
138 | virtual void DILIGENT_CALL_TYPE ClearRenderTarget(ITextureView* pView, | |
139 | const float* RGBA, | |
140 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
130 | 141 | |
131 | 142 | /// Implementation of IDeviceContext::UpdateBuffer() in OpenGL backend. |
132 | virtual void UpdateBuffer(IBuffer* pBuffer, | |
133 | Uint32 Offset, | |
134 | Uint32 Size, | |
135 | const void* pData, | |
136 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
143 | virtual void DILIGENT_CALL_TYPE UpdateBuffer(IBuffer* pBuffer, | |
144 | Uint32 Offset, | |
145 | Uint32 Size, | |
146 | const void* pData, | |
147 | RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final; | |
137 | 148 | |
138 | 149 | /// Implementation of IDeviceContext::CopyBuffer() in OpenGL backend. |
139 | virtual void CopyBuffer(IBuffer* pSrcBuffer, | |
140 | Uint32 SrcOffset, | |
141 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
142 | IBuffer* pDstBuffer, | |
143 | Uint32 DstOffset, | |
144 | Uint32 Size, | |
145 | RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode) override final; | |
150 | virtual void DILIGENT_CALL_TYPE CopyBuffer(IBuffer* pSrcBuffer, | |
151 | Uint32 SrcOffset, | |
152 | RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, | |
153 | IBuffer* pDstBuffer, | |
154 | Uint32 DstOffset, | |
155 | Uint32 Size, | |
156 | RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode) override final; | |
146 | 157 | |
147 | 158 | /// Implementation of IDeviceContext::MapBuffer() in OpenGL backend. |
148 | virtual void MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData) override final; | |
159 | virtual void DILIGENT_CALL_TYPE MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData) override final; | |
149 | 160 | |
150 | 161 | /// Implementation of IDeviceContext::UnmapBuffer() in OpenGL backend. |
151 | virtual void UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType) override final; | |
162 | virtual void DILIGENT_CALL_TYPE UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType) override final; | |
152 | 163 | |
153 | 164 | /// Implementation of IDeviceContext::UpdateTexture() in OpenGL backend. |
154 | virtual void UpdateTexture(ITexture* pTexture, | |
155 | Uint32 MipLevel, | |
156 | Uint32 Slice, | |
157 | const Box& DstBox, | |
158 | const TextureSubResData& SubresData, | |
159 | RESOURCE_STATE_TRANSITION_MODE SrcBufferStateTransitionMode, | |
160 | RESOURCE_STATE_TRANSITION_MODE TextureStateTransitionMode) override final; | |
165 | virtual void DILIGENT_CALL_TYPE UpdateTexture(ITexture* pTexture, | |
166 | Uint32 MipLevel, | |
167 | Uint32 Slice, | |
168 | const Box& DstBox, | |
169 | const TextureSubResData& SubresData, | |
170 | RESOURCE_STATE_TRANSITION_MODE SrcBufferStateTransitionMode, | |
171 | RESOURCE_STATE_TRANSITION_MODE TextureStateTransitionMode) override final; | |
161 | 172 | |
162 | 173 | /// Implementation of IDeviceContext::CopyTexture() in OpenGL backend. |
163 | virtual void CopyTexture(const CopyTextureAttribs& CopyAttribs) override final; | |
174 | virtual void DILIGENT_CALL_TYPE CopyTexture(const CopyTextureAttribs& CopyAttribs) override final; | |
164 | 175 | |
165 | 176 | /// Implementation of IDeviceContext::MapTextureSubresource() in OpenGL backend. |
166 | virtual void MapTextureSubresource(ITexture* pTexture, | |
167 | Uint32 MipLevel, | |
168 | Uint32 ArraySlice, | |
169 | MAP_TYPE MapType, | |
170 | MAP_FLAGS MapFlags, | |
171 | const Box* pMapRegion, | |
172 | MappedTextureSubresource& MappedData) override final; | |
177 | virtual void DILIGENT_CALL_TYPE MapTextureSubresource(ITexture* pTexture, | |
178 | Uint32 MipLevel, | |
179 | Uint32 ArraySlice, | |
180 | MAP_TYPE MapType, | |
181 | MAP_FLAGS MapFlags, | |
182 | const Box* pMapRegion, | |
183 | MappedTextureSubresource& MappedData) override final; | |
173 | 184 | |
174 | 185 | /// Implementation of IDeviceContext::UnmapTextureSubresource() in OpenGL backend. |
175 | virtual void UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice) override final; | |
186 | virtual void DILIGENT_CALL_TYPE UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice) override final; | |
176 | 187 | |
177 | 188 | /// Implementation of IDeviceContext::GenerateMips() in OpenGL backend. |
178 | virtual void GenerateMips(ITextureView* pTexView) override; | |
189 | virtual void DILIGENT_CALL_TYPE GenerateMips(ITextureView* pTexView) override; | |
179 | 190 | |
180 | 191 | /// Implementation of IDeviceContext::FinishFrame() in OpenGL backend. |
181 | virtual void FinishFrame() override final; | |
192 | virtual void DILIGENT_CALL_TYPE FinishFrame() override final; | |
182 | 193 | |
183 | 194 | /// Implementation of IDeviceContext::TransitionResourceStates() in OpenGL backend. |
184 | virtual void TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers) override final; | |
195 | virtual void DILIGENT_CALL_TYPE TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers) override final; | |
185 | 196 | |
186 | 197 | /// Implementation of IDeviceContext::ResolveTextureSubresource() in OpenGL backend. |
187 | virtual void ResolveTextureSubresource(ITexture* pSrcTexture, | |
188 | ITexture* pDstTexture, | |
189 | const ResolveTextureSubresourceAttribs& ResolveAttribs) override final; | |
198 | virtual void DILIGENT_CALL_TYPE ResolveTextureSubresource(ITexture* pSrcTexture, | |
199 | ITexture* pDstTexture, | |
200 | const ResolveTextureSubresourceAttribs& ResolveAttribs) override final; | |
190 | 201 | |
191 | 202 | /// Implementation of IDeviceContext::FinishCommandList() in OpenGL backend. |
192 | virtual void FinishCommandList(class ICommandList** ppCommandList) override final; | |
203 | virtual void DILIGENT_CALL_TYPE FinishCommandList(class ICommandList** ppCommandList) override final; | |
193 | 204 | |
194 | 205 | /// Implementation of IDeviceContext::ExecuteCommandList() in OpenGL backend. |
195 | virtual void ExecuteCommandList(class ICommandList* pCommandList) override final; | |
206 | virtual void DILIGENT_CALL_TYPE ExecuteCommandList(class ICommandList* pCommandList) override final; | |
196 | 207 | |
197 | 208 | /// Implementation of IDeviceContext::SignalFence() in OpenGL backend. |
198 | virtual void SignalFence(IFence* pFence, Uint64 Value) override final; | |
209 | virtual void DILIGENT_CALL_TYPE SignalFence(IFence* pFence, Uint64 Value) override final; | |
199 | 210 | |
200 | 211 | /// Implementation of IDeviceContext::WaitForFence() in OpenGL backend. |
201 | virtual void WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext) override final; | |
212 | virtual void DILIGENT_CALL_TYPE WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext) override final; | |
202 | 213 | |
203 | 214 | /// Implementation of IDeviceContext::WaitForIdle() in OpenGL backend. |
204 | virtual void WaitForIdle() override final; | |
215 | virtual void DILIGENT_CALL_TYPE WaitForIdle() override final; | |
205 | 216 | |
206 | 217 | /// Implementation of IDeviceContext::BeginQuery() in OpenGL backend. |
207 | virtual void BeginQuery(IQuery* pQuery) override final; | |
218 | virtual void DILIGENT_CALL_TYPE BeginQuery(IQuery* pQuery) override final; | |
208 | 219 | |
209 | 220 | /// Implementation of IDeviceContext::EndQuery() in OpenGL backend. |
210 | virtual void EndQuery(IQuery* pQuery) override final; | |
221 | virtual void DILIGENT_CALL_TYPE EndQuery(IQuery* pQuery) override final; | |
211 | 222 | |
212 | 223 | /// Implementation of IDeviceContext::Flush() in OpenGL backend. |
213 | virtual void Flush() override final; | |
224 | virtual void DILIGENT_CALL_TYPE Flush() override final; | |
214 | 225 | |
215 | 226 | /// Implementation of IDeviceContextGL::UpdateCurrentGLContext(). |
216 | virtual bool UpdateCurrentGLContext() override final; | |
227 | virtual bool DILIGENT_CALL_TYPE UpdateCurrentGLContext() override final; | |
217 | 228 | |
218 | 229 | void BindProgramResources(Uint32& NewMemoryBarriers, IShaderResourceBinding* pResBinding); |
219 | 230 | |
221 | 232 | |
222 | 233 | void CommitRenderTargets(); |
223 | 234 | |
224 | virtual void SetSwapChain(ISwapChainGL* pSwapChain) override final; | |
235 | virtual void DILIGENT_CALL_TYPE SetSwapChain(ISwapChainGL* pSwapChain) override final; | |
225 | 236 | |
226 | 237 | virtual void ResetRenderTargets() override final; |
227 | 238 |
55 | 55 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_FenceGL, TFenceBase); |
56 | 56 | |
57 | 57 | /// Implementation of IFence::GetCompletedValue() in OpenGL backend. |
58 | virtual Uint64 GetCompletedValue() override final; | |
58 | virtual Uint64 DILIGENT_CALL_TYPE GetCompletedValue() override final; | |
59 | 59 | |
60 | 60 | /// Implementation of IFence::Reset() in OpenGL backend. |
61 | virtual void Reset(Uint64 Value) override final; | |
61 | virtual void DILIGENT_CALL_TYPE Reset(Uint64 Value) override final; | |
62 | 62 | |
63 | 63 | void AddPendingFence(GLObjectWrappers::GLSyncObj&& Fence, Uint64 Value) |
64 | 64 | { |
124 | 124 | VERIFY_EXPR(StaticSamplerIdx < 0 || ResourceAttribs.ResourceType == SHADER_RESOURCE_TYPE_TEXTURE_SRV); |
125 | 125 | } |
126 | 126 | |
127 | virtual SHADER_RESOURCE_VARIABLE_TYPE GetType() const override final | |
127 | virtual SHADER_RESOURCE_VARIABLE_TYPE DILIGENT_CALL_TYPE GetType() const override final | |
128 | 128 | { |
129 | 129 | return m_VariableType; |
130 | 130 | } |
131 | 131 | |
132 | virtual void GetResourceDesc(ShaderResourceDesc& ResourceDesc) const override final | |
132 | virtual void DILIGENT_CALL_TYPE GetResourceDesc(ShaderResourceDesc& ResourceDesc) const override final | |
133 | 133 | { |
134 | 134 | ResourceDesc = m_Attribs.GetResourceDesc(); |
135 | 135 | } |
136 | 136 | |
137 | virtual Uint32 GetIndex() const override final | |
137 | virtual Uint32 DILIGENT_CALL_TYPE GetIndex() const override final | |
138 | 138 | { |
139 | 139 | return m_ParentResLayout.GetVariableIndex(*this); |
140 | 140 | } |
156 | 156 | // Non-virtual function |
157 | 157 | void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex); |
158 | 158 | |
159 | virtual void Set(IDeviceObject* pObject) override final | |
159 | virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final | |
160 | 160 | { |
161 | 161 | BindResource(pObject, 0); |
162 | 162 | } |
163 | 163 | |
164 | virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
164 | virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, | |
165 | Uint32 FirstElement, | |
166 | Uint32 NumElements) override final | |
165 | 167 | { |
166 | 168 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.ArraySize, FirstElement, NumElements); |
167 | 169 | for (Uint32 elem = 0; elem < NumElements; ++elem) |
168 | 170 | BindResource(ppObjects[elem], FirstElement + elem); |
169 | 171 | } |
170 | 172 | |
171 | virtual bool IsBound(Uint32 ArrayIndex) const override final | |
173 | virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final | |
172 | 174 | { |
173 | 175 | VERIFY_EXPR(ArrayIndex < m_Attribs.ArraySize); |
174 | 176 | return m_ParentResLayout.m_pResourceCache->IsUBBound(m_Attribs.Binding + ArrayIndex); |
188 | 190 | // Non-virtual function |
189 | 191 | void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex); |
190 | 192 | |
191 | virtual void Set(IDeviceObject* pObject) override final | |
193 | virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final | |
192 | 194 | { |
193 | 195 | BindResource(pObject, 0); |
194 | 196 | } |
195 | 197 | |
196 | virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
198 | virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, | |
199 | Uint32 FirstElement, | |
200 | Uint32 NumElements) override final | |
197 | 201 | { |
198 | 202 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.ArraySize, FirstElement, NumElements); |
199 | 203 | for (Uint32 elem = 0; elem < NumElements; ++elem) |
200 | 204 | BindResource(ppObjects[elem], FirstElement + elem); |
201 | 205 | } |
202 | 206 | |
203 | virtual bool IsBound(Uint32 ArrayIndex) const override final | |
207 | virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final | |
204 | 208 | { |
205 | 209 | VERIFY_EXPR(ArrayIndex < m_Attribs.ArraySize); |
206 | 210 | return m_ParentResLayout.m_pResourceCache->IsSamplerBound(m_Attribs.Binding + ArrayIndex, m_Attribs.ResourceType == SHADER_RESOURCE_TYPE_TEXTURE_SRV); |
219 | 223 | // Provide non-virtual function |
220 | 224 | void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex); |
221 | 225 | |
222 | virtual void Set(IDeviceObject* pObject) override final | |
226 | virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final | |
223 | 227 | { |
224 | 228 | BindResource(pObject, 0); |
225 | 229 | } |
226 | 230 | |
227 | virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
231 | virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, | |
232 | Uint32 FirstElement, | |
233 | Uint32 NumElements) override final | |
228 | 234 | { |
229 | 235 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.ArraySize, FirstElement, NumElements); |
230 | 236 | for (Uint32 elem = 0; elem < NumElements; ++elem) |
231 | 237 | BindResource(ppObjects[elem], FirstElement + elem); |
232 | 238 | } |
233 | 239 | |
234 | virtual bool IsBound(Uint32 ArrayIndex) const override final | |
240 | virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final | |
235 | 241 | { |
236 | 242 | VERIFY_EXPR(ArrayIndex < m_Attribs.ArraySize); |
237 | 243 | return m_ParentResLayout.m_pResourceCache->IsImageBound(m_Attribs.Binding + ArrayIndex, m_Attribs.ResourceType == SHADER_RESOURCE_TYPE_TEXTURE_UAV); |
250 | 256 | // Non-virtual function |
251 | 257 | void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex); |
252 | 258 | |
253 | virtual void Set(IDeviceObject* pObject) override final | |
259 | virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final | |
254 | 260 | { |
255 | 261 | BindResource(pObject, 0); |
256 | 262 | } |
257 | 263 | |
258 | virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final | |
264 | virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, | |
265 | Uint32 FirstElement, | |
266 | Uint32 NumElements) override final | |
259 | 267 | { |
260 | 268 | VerifyAndCorrectSetArrayArguments(m_Attribs.Name, m_Attribs.ArraySize, FirstElement, NumElements); |
261 | 269 | for (Uint32 elem = 0; elem < NumElements; ++elem) |
262 | 270 | BindResource(ppObjects[elem], FirstElement + elem); |
263 | 271 | } |
264 | 272 | |
265 | virtual bool IsBound(Uint32 ArrayIndex) const override final | |
273 | virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final | |
266 | 274 | { |
267 | 275 | VERIFY_EXPR(ArrayIndex < m_Attribs.ArraySize); |
268 | 276 | return m_ParentResLayout.m_pResourceCache->IsSSBOBound(m_Attribs.Binding + ArrayIndex); |
55 | 55 | ~PipelineStateGLImpl(); |
56 | 56 | |
57 | 57 | /// Queries the specific interface, see IObject::QueryInterface() for details |
58 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
58 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
59 | 59 | |
60 | 60 | /// Implementation of IPipelineState::BindStaticResources() in OpenGL backend. |
61 | virtual void BindStaticResources(Uint32 ShaderFlags, IResourceMapping* pResourceMapping, Uint32 Flags) override final; | |
61 | virtual void DILIGENT_CALL_TYPE BindStaticResources(Uint32 ShaderFlags, | |
62 | IResourceMapping* pResourceMapping, | |
63 | Uint32 Flags) override final; | |
62 | 64 | |
63 | 65 | /// Implementation of IPipelineState::GetStaticVariableCount() in OpenGL backend. |
64 | virtual Uint32 GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; | |
66 | virtual Uint32 DILIGENT_CALL_TYPE GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; | |
65 | 67 | |
66 | 68 | /// Implementation of IPipelineState::GetStaticVariableByName() in OpenGL backend. |
67 | virtual IShaderResourceVariable* GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) override final; | |
69 | virtual IShaderResourceVariable* DILIGENT_CALL_TYPE GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) override final; | |
68 | 70 | |
69 | 71 | /// Implementation of IPipelineState::GetStaticVariableByIndex() in OpenGL backend. |
70 | virtual IShaderResourceVariable* GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; | |
72 | virtual IShaderResourceVariable* DILIGENT_CALL_TYPE GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; | |
71 | 73 | |
72 | 74 | /// Implementation of IPipelineState::CreateShaderResourceBinding() in OpenGL backend. |
73 | virtual void CreateShaderResourceBinding(IShaderResourceBinding** ppShaderResourceBinding, bool InitStaticResources) override final; | |
75 | virtual void DILIGENT_CALL_TYPE CreateShaderResourceBinding(IShaderResourceBinding** ppShaderResourceBinding, | |
76 | bool InitStaticResources) override final; | |
74 | 77 | |
75 | 78 | /// Implementation of IPipelineState::IsCompatibleWith() in OpenGL backend. |
76 | virtual bool IsCompatibleWith(const IPipelineState* pPSO) const override final; | |
79 | virtual bool DILIGENT_CALL_TYPE IsCompatibleWith(const IPipelineState* pPSO) const override final; | |
77 | 80 | |
78 | 81 | void CommitProgram(GLContextState& State); |
79 | 82 |
54 | 54 | IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_QueryGL, TQueryBase); |
55 | 55 | |
56 | 56 | /// Implementation of IQuery::GetData() in OpenGL backend. |
57 | virtual bool GetData(void* pData, Uint32 DataSize, bool AutoInvalidate) override final; | |
57 | virtual bool DILIGENT_CALL_TYPE GetData(void* pData, Uint32 DataSize, bool AutoInvalidate) override final; | |
58 | 58 | |
59 | 59 | |
60 | 60 | /// Implementation of IQueryGL::GetGlQueryHandle(). |
61 | virtual GLuint GetGlQueryHandle() const override final | |
61 | virtual GLuint DILIGENT_CALL_TYPE GetGlQueryHandle() const override final | |
62 | 62 | { |
63 | 63 | return m_GlQuery; |
64 | 64 | } |
64 | 64 | const EngineGLCreateInfo& InitAttribs, |
65 | 65 | const SwapChainDesc* pSCDesc = nullptr); |
66 | 66 | ~RenderDeviceGLImpl(); |
67 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
67 | ||
68 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override; | |
68 | 69 | |
69 | 70 | /// Implementation of IRenderDevice::CreateBuffer() in OpenGL backend. |
70 | void CreateBuffer(const BufferDesc& BuffDesc, const BufferData* pBuffData, IBuffer** ppBuffer, bool bIsDeviceInternal); | |
71 | virtual void CreateBuffer(const BufferDesc& BuffDesc, const BufferData* BuffData, IBuffer** ppBuffer) override final; | |
71 | void CreateBuffer(const BufferDesc& BuffDesc, | |
72 | const BufferData* pBuffData, | |
73 | IBuffer** ppBuffer, | |
74 | bool bIsDeviceInternal); | |
75 | virtual void DILIGENT_CALL_TYPE CreateBuffer(const BufferDesc& BuffDesc, | |
76 | const BufferData* BuffData, | |
77 | IBuffer** ppBuffer) override final; | |
72 | 78 | |
73 | 79 | /// Implementation of IRenderDevice::CreateShader() in OpenGL backend. |
74 | void CreateShader(const ShaderCreateInfo& ShaderCreateInfo, IShader** ppShader, bool bIsDeviceInternal); | |
75 | virtual void CreateShader(const ShaderCreateInfo& ShaderCreateInfo, IShader** ppShader) override final; | |
80 | void CreateShader(const ShaderCreateInfo& ShaderCreateInfo, | |
81 | IShader** ppShader, | |
82 | bool bIsDeviceInternal); | |
83 | virtual void DILIGENT_CALL_TYPE CreateShader(const ShaderCreateInfo& ShaderCreateInfo, | |
84 | IShader** ppShader) override final; | |
76 | 85 | |
77 | 86 | /// Implementation of IRenderDevice::CreateTexture() in OpenGL backend. |
78 | void CreateTexture(const TextureDesc& TexDesc, const TextureData* pData, ITexture** ppTexture, bool bIsDeviceInternal); | |
79 | virtual void CreateTexture(const TextureDesc& TexDesc, const TextureData* Data, ITexture** ppTexture) override final; | |
87 | void CreateTexture(const TextureDesc& TexDesc, | |
88 | const TextureData* pData, | |
89 | ITexture** ppTexture, | |
90 | bool bIsDeviceInternal); | |
91 | virtual void DILIGENT_CALL_TYPE CreateTexture(const TextureDesc& TexDesc, | |
92 | const TextureData* Data, | |
93 | ITexture** ppTexture) override final; | |
80 | 94 | |
81 | 95 | /// Implementation of IRenderDevice::CreateSampler() in OpenGL backend. |
82 | void CreateSampler(const SamplerDesc& SamplerDesc, ISampler** ppSampler, bool bIsDeviceInternal); | |
83 | virtual void CreateSampler(const SamplerDesc& SamplerDesc, ISampler** ppSampler) override final; | |
96 | void CreateSampler(const SamplerDesc& SamplerDesc, | |
97 | ISampler** ppSampler, | |
98 | bool bIsDeviceInternal); | |
99 | virtual void DILIGENT_CALL_TYPE CreateSampler(const SamplerDesc& SamplerDesc, | |
100 | ISampler** ppSampler) override final; | |
84 | 101 | |
85 | 102 | /// Implementation of IRenderDevice::CreatePipelineState() in OpenGL backend. |
86 | void CreatePipelineState(const PipelineStateDesc& PipelineDesc, IPipelineState** ppPipelineState, bool bIsDeviceInternal); | |
87 | virtual void CreatePipelineState(const PipelineStateDesc& PipelineDesc, IPipelineState** ppPipelineState) override final; | |
103 | void CreatePipelineState(const PipelineStateDesc& PipelineDesc, | |
104 | IPipelineState** ppPipelineState, | |
105 | bool bIsDeviceInternal); | |
106 | virtual void DILIGENT_CALL_TYPE CreatePipelineState(const PipelineStateDesc& PipelineDesc, | |
107 | IPipelineState** ppPipelineState) override final; | |
88 | 108 | |
89 | 109 | /// Implementation of IRenderDevice::CreateFence() in OpenGL backend. |
90 | virtual void CreateFence(const FenceDesc& Desc, IFence** ppFence) override final; | |
110 | virtual void DILIGENT_CALL_TYPE CreateFence(const FenceDesc& Desc, IFence** ppFence) override final; | |
91 | 111 | |
92 | 112 | /// Implementation of IRenderDevice::CreateQuery() in OpenGL backend. |
93 | virtual void CreateQuery(const QueryDesc& Desc, IQuery** ppQuery) override final; | |
113 | virtual void DILIGENT_CALL_TYPE CreateQuery(const QueryDesc& Desc, IQuery** ppQuery) override final; | |
94 | 114 | |
95 | 115 | /// Implementation of IRenderDeviceGL::CreateTextureFromGLHandle(). |
96 | virtual void CreateTextureFromGLHandle(Uint32 GLHandle, const TextureDesc& TexDesc, RESOURCE_STATE InitialState, ITexture** ppTexture) override final; | |
116 | virtual void DILIGENT_CALL_TYPE CreateTextureFromGLHandle(Uint32 GLHandle, | |
117 | const TextureDesc& TexDesc, | |
118 | RESOURCE_STATE InitialState, | |
119 | ITexture** ppTexture) override final; | |
97 | 120 | |
98 | 121 | /// Implementation of IRenderDeviceGL::CreateBufferFromGLHandle(). |
99 | virtual void CreateBufferFromGLHandle(Uint32 GLHandle, const BufferDesc& BuffDesc, RESOURCE_STATE InitialState, IBuffer** ppBuffer) override final; | |
122 | virtual void DILIGENT_CALL_TYPE CreateBufferFromGLHandle(Uint32 GLHandle, | |
123 | const BufferDesc& BuffDesc, | |
124 | RESOURCE_STATE InitialState, | |
125 | IBuffer** ppBuffer) override final; | |
100 | 126 | |
101 | 127 | /// Implementation of IRenderDeviceGL::CreateDummyTexture(). |
102 | virtual void CreateDummyTexture(const TextureDesc& TexDesc, RESOURCE_STATE InitialState, ITexture** ppTexture) override final; | |
128 | virtual void DILIGENT_CALL_TYPE CreateDummyTexture(const TextureDesc& TexDesc, | |
129 | RESOURCE_STATE InitialState, | |
130 | ITexture** ppTexture) override final; | |
103 | 131 | |
104 | 132 | /// Implementation of IRenderDevice::ReleaseStaleResources() in OpenGL backend. |
105 | virtual void ReleaseStaleResources(bool ForceRelease = false) override final {} | |
133 | virtual void DILIGENT_CALL_TYPE ReleaseStaleResources(bool ForceRelease = false) override final {} | |
106 | 134 | |
107 | 135 | /// Implementation of IRenderDevice::IdleGPU() in OpenGL backend. |
108 | virtual void IdleGPU() override final; | |
136 | virtual void DILIGENT_CALL_TYPE IdleGPU() override final; | |
109 | 137 | |
110 | 138 | const GPUInfo& GetGPUInfo() { return m_GPUInfo; } |
111 | 139 |
47 | 47 | SamplerGLImpl(IReferenceCounters* pRefCounters, RenderDeviceGLImpl* pDeviceGL, const SamplerDesc& SamplerDesc, bool bIsDeviceInternal = false); |
48 | 48 | ~SamplerGLImpl(); |
49 | 49 | |
50 | virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
50 | virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; | |
51 | 51 | |
52 | 52 |