19 class DX11GeometryShader;
20 class DX11GraphicsObject;
21 class DX11PixelShader;
24 class DX11VertexShader;
40 DX11Engine(D3D_FEATURE_LEVEL minFeatureLevel = D3D_FEATURE_LEVEL_11_0);
41 DX11Engine(IDXGIAdapter* adapter, D3D_DRIVER_TYPE driverType,
43 D3D_FEATURE_LEVEL minFeatureLevel);
53 D3D_FEATURE_LEVEL minFeatureLevel = D3D_FEATURE_LEVEL_11_0);
55 D3D_DRIVER_TYPE driverType, HMODULE softwareModule,
UINT flags,
56 D3D_FEATURE_LEVEL minFeatureLevel);
59 inline IDXGIAdapter* GetAdapter()
const;
60 inline D3D_DRIVER_TYPE GetDriverType()
const;
61 inline HMODULE GetSoftwareModule()
const;
62 inline UINT GetFlags()
const;
63 inline D3D_FEATURE_LEVEL GetMinFeatureLevel()
const;
64 inline ID3D11Device* GetDevice()
const;
65 inline ID3D11DeviceContext* GetImmediate()
const;
66 inline D3D_FEATURE_LEVEL GetFeatureLevel()
const;
77 D3D11_MAPPED_SUBRESOURCE MapForWrite(std::shared_ptr<Resource>
const& resource,
unsigned int sri);
78 void Unmap(std::shared_ptr<Resource>
const& resource,
unsigned int sri);
82 bool IsFullscreen(
DXGIOutput const& output)
const;
83 bool SetFullscreen(
DXGIOutput const& output,
bool fullscreen);
84 void ExitFullscreen();
94 void Initialize(IDXGIAdapter* adapter, D3D_DRIVER_TYPE driverType,
95 HMODULE softwareModule,
UINT flags, D3D_FEATURE_LEVEL minFeatureLevel);
97 bool CreateBestMatchingDevice();
98 bool CreateSwapChain(HWND handle,
UINT xSize,
UINT ySize);
99 bool CreateBackBuffer(
UINT xSize,
UINT ySize);
100 void CreateDefaultObjects();
101 void DestroyDefaultObjects();
102 bool DestroyDevice();
103 bool DestroySwapChain();
104 bool DestroyBackBuffer();
108 ID3D11Query* BeginOcclusionQuery();
109 uint64_t EndOcclusionQuery(ID3D11Query* occlusionQuery);
112 bool EnableShaders(std::shared_ptr<VisualEffect>
const& effect,
114 void DisableShaders(std::shared_ptr<VisualEffect>
const& effect,
155 std::array<ID3D11RenderTargetView*, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT>
mActiveRT;
158 std::array<ID3D11RenderTargetView*, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT>
mSaveRT;
182 virtual void SetViewport(
int x,
int y,
int w,
int h)
override;
183 virtual void GetViewport(
int&
x,
int&
y,
int&
w,
int&
h)
const override;
184 virtual void SetDepthRange(
float zmin,
float zmax)
override;
185 virtual void GetDepthRange(
float& zmin,
float&
zmax)
const override;
188 virtual bool Resize(
unsigned int w,
unsigned int h)
override;
191 virtual void ClearColorBuffer()
override;
192 virtual void ClearDepthBuffer()
override;
193 virtual void ClearStencilBuffer()
override;
194 virtual void ClearBuffers()
override;
195 virtual void DisplayColorBuffer(
unsigned int syncInterval)
override;
199 virtual void SetBlendState(std::shared_ptr<BlendState>
const& state)
override;
200 virtual void SetDepthStencilState(std::shared_ptr<DepthStencilState>
const& state)
override;
201 virtual void SetRasterizerState(std::shared_ptr<RasterizerState>
const& state)
override;
206 virtual void Enable(std::shared_ptr<DrawTarget>
const&
target)
override;
207 virtual void Disable(std::shared_ptr<DrawTarget>
const&
target)
override;
210 DX11Texture2* BindTexture(std::shared_ptr<Texture2>
const& texture,
211 ID3D11Texture2D* dxTexture, ID3D11ShaderResourceView* dxSRView);
214 virtual bool Update(std::shared_ptr<Buffer>
const&
buffer)
override;
215 virtual bool Update(std::shared_ptr<TextureSingle>
const& texture)
override;
216 virtual bool Update(std::shared_ptr<TextureSingle>
const& texture,
unsigned int level)
override;
217 virtual bool Update(std::shared_ptr<TextureArray>
const& textureArray)
override;
218 virtual bool Update(std::shared_ptr<TextureArray>
const& textureArray,
unsigned int item,
unsigned int level)
override;
221 virtual bool CopyCpuToGpu(std::shared_ptr<Buffer>
const&
buffer)
override;
222 virtual bool CopyCpuToGpu(std::shared_ptr<TextureSingle>
const& texture)
override;
223 virtual bool CopyCpuToGpu(std::shared_ptr<TextureSingle>
const& texture,
unsigned int level)
override;
224 virtual bool CopyCpuToGpu(std::shared_ptr<TextureArray>
const& textureArray)
override;
225 virtual bool CopyCpuToGpu(std::shared_ptr<TextureArray>
const& textureArray,
unsigned int item,
unsigned int level)
override;
228 virtual bool CopyGpuToCpu(std::shared_ptr<Buffer>
const&
buffer)
override;
229 virtual bool CopyGpuToCpu(std::shared_ptr<TextureSingle>
const& texture)
override;
230 virtual bool CopyGpuToCpu(std::shared_ptr<TextureSingle>
const& texture,
unsigned int level)
override;
231 virtual bool CopyGpuToCpu(std::shared_ptr<TextureArray>
const& textureArray)
override;
232 virtual bool CopyGpuToCpu(std::shared_ptr<TextureArray>
const& textureArray,
unsigned int item,
unsigned int level)
override;
238 virtual void CopyGpuToGpu(
239 std::shared_ptr<Buffer>
const& buffer0,
240 std::shared_ptr<Buffer>
const& buffer1)
override;
242 virtual void CopyGpuToGpu(
243 std::shared_ptr<TextureSingle>
const& texture0,
244 std::shared_ptr<TextureSingle>
const& texture1)
override;
246 virtual void CopyGpuToGpu(
247 std::shared_ptr<TextureSingle>
const& texture0,
248 std::shared_ptr<TextureSingle>
const& texture1,
249 unsigned int level)
override;
251 virtual void CopyGpuToGpu(
252 std::shared_ptr<TextureArray>
const& textureArray0,
253 std::shared_ptr<TextureArray>
const& textureArray1)
override;
255 virtual void CopyGpuToGpu(
256 std::shared_ptr<TextureArray>
const& textureArray0,
257 std::shared_ptr<TextureArray>
const& textureArray1,
258 unsigned int item,
unsigned int level)
override;
261 virtual bool GetNumActiveElements(std::shared_ptr<StructuredBuffer>
const&
buffer)
override;
268 virtual bool BindProgram(std::shared_ptr<ComputeProgram>
const&
program)
override;
269 virtual void Execute(std::shared_ptr<ComputeProgram>
const&
program,
270 unsigned int numXGroups,
unsigned int numYGroups,
unsigned int numZGroups)
override;
273 virtual void WaitForFinish()
override;
276 virtual void Flush()
override;
283 virtual uint64_t DrawPrimitive(
284 std::shared_ptr<VertexBuffer>
const& vbuffer,
285 std::shared_ptr<IndexBuffer>
const& ibuffer,
286 std::shared_ptr<VisualEffect>
const& effect)
override;
301 return mSoftwareModule;
311 return mMinFeatureLevel;
326 return mFeatureLevel;
ID3D11DepthStencilView * mDepthStencilView
ID3D11DeviceContext * GetImmediate() const
D3D_DRIVER_TYPE GetDriverType() const
std::array< ID3D11RenderTargetView *, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT > mActiveRT
GLbitfield GLuint program
ID3D11Device * GetDevice() const
D3D_FEATURE_LEVEL mFeatureLevel
D3D11_VIEWPORT mSaveViewport
D3D_FEATURE_LEVEL GetFeatureLevel() const
ID3D11Texture2D * mDepthStencilBuffer
GLubyte GLubyte GLubyte GLubyte w
HMODULE GetSoftwareModule() const
IDXGIAdapter * GetAdapter() const
D3D_DRIVER_TYPE mDriverType
ID3D11RenderTargetView * mColorView
IDXGISwapChain * mSwapChain
ID3D11DeviceContext * mImmediate
std::map< std::wstring, bool > mFullscreenState
GLfloat GLfloat GLfloat GLfloat h
ID3D11DepthStencilView * mSaveDS
ID3D11DepthStencilView * mActiveDS
ID3D11Texture2D * mColorBuffer
unsigned int mNumActiveRTs
typedef UINT(WINAPI *PFNWGLGETGPUIDSAMDPROC)(UINT maxCount
std::array< ID3D11RenderTargetView *, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT > mSaveRT
D3D_FEATURE_LEVEL GetMinFeatureLevel() const
D3D_FEATURE_LEVEL mMinFeatureLevel