Diligent Engine API Reference
RenderDeviceD3D11Impl.h
1 /* Copyright 2015-2018 Egor Yusov
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
12  *
13  * In no event and under no legal theory, whether in tort (including negligence),
14  * contract, or otherwise, unless required by applicable law (such as deliberate
15  * and grossly negligent acts) or agreed to in writing, shall any Contributor be
16  * liable for any damages, including any direct, indirect, special, incidental,
17  * or consequential damages of any character arising as a result of this License or
18  * out of the use or inability to use the software (including but not limited to damages
19  * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
20  * all other commercial damages or losses), even if such Contributor has been advised
21  * of the possibility of such damages.
22  */
23 
24 #pragma once
25 
28 
29 #include "RenderDeviceD3D11.h"
30 #include "RenderDeviceD3DBase.h"
31 #include "DeviceContextD3D11.h"
32 #include "EngineD3D11Attribs.h"
33 
34 namespace Diligent
35 {
36 
38 class RenderDeviceD3D11Impl : public RenderDeviceD3DBase<IRenderDeviceD3D11>
39 {
40 public:
41  typedef RenderDeviceD3DBase<IRenderDeviceD3D11> TRenderDeviceBase;
42 
43  RenderDeviceD3D11Impl( IReferenceCounters *pRefCounters, IMemoryAllocator &RawMemAllocator, const EngineD3D11Attribs& EngineAttribs, ID3D11Device *pd3d11Device, Uint32 NumDeferredContexts );
44  virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final;
45 
46  virtual void CreateBuffer(const BufferDesc& BuffDesc, const BufferData &BuffData, IBuffer **ppBuffer)override final;
47 
48  virtual void CreateShader(const ShaderCreationAttribs &ShaderCreationAttribs, IShader **ppShader)override final;
49 
50  virtual void CreateTexture(const TextureDesc& TexDesc, const TextureData &Data, ITexture **ppTexture)override final;
51 
52  virtual void CreateSampler(const SamplerDesc& SamplerDesc, ISampler **ppSampler)override final;
53 
54  virtual void CreatePipelineState( const PipelineStateDesc &PipelineDesc, IPipelineState **ppPipelineState )override final;
55 
56  ID3D11Device* GetD3D11Device()override final{return m_pd3d11Device;}
57 
58  virtual void CreateBufferFromD3DResource(ID3D11Buffer *pd3d11Buffer, const BufferDesc& BuffDesc, IBuffer **ppBuffer)override final;
59  virtual void CreateTextureFromD3DResource(ID3D11Texture1D *pd3d11Texture, ITexture **ppTexture)override final;
60  virtual void CreateTextureFromD3DResource(ID3D11Texture2D *pd3d11Texture, ITexture **ppTexture)override final;
61  virtual void CreateTextureFromD3DResource(ID3D11Texture3D *pd3d11Texture, ITexture **ppTexture)override final;
62 
63 private:
64  virtual void TestTextureFormat( TEXTURE_FORMAT TexFormat );
65 
66  EngineD3D11Attribs m_EngineAttribs;
67 
69  CComPtr<ID3D11Device> m_pd3d11Device;
70 };
71 
72 }
TEXTURE_FORMAT
Texture formats.
Definition: GraphicsTypes.h:244
Texture description.
Definition: Texture.h:82
Shader interface.
Definition: Shader.h:288
Describes the buffer initial data.
Definition: Buffer.h:176
Namespace for the OpenGL implementation of the graphics engine.
Definition: BufferD3D11Impl.h:34
Describes the initial data to store in the texture.
Definition: Texture.h:243
Sampler description.
Definition: Sampler.h:52
Buffer interface.
Definition: Buffer.h:200
Buffer description.
Definition: Buffer.h:57
Implementation of the Diligent::IRenderDeviceD3D11 interface.
Definition: RenderDeviceD3D11Impl.h:38
Definition: PipelineState.h:209
Texture sampler interface.
Definition: Sampler.h:180
Attributes of the Direct3D11-based engine implementation.
Definition: EngineD3D11Attribs.h:51
Pipeline state description.
Definition: PipelineState.h:179
Shader creation attributes.
Definition: Shader.h:204
Texture inteface.
Definition: Texture.h:276