GteDX11Texture.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #pragma once
9 
10 #include <Graphics/GteTexture.h>
12 
13 namespace gte
14 {
15 
17 {
18 public:
19  // Abstract base class.
20  virtual ~DX11Texture();
21 protected:
22  // No public construction. Derived classes use this constructor.
23  DX11Texture(Texture const* gtTexture);
24 
25 public:
26  // Member access.
27  inline Texture* GetTexture() const;
28  inline ID3D11ShaderResourceView* GetSRView() const;
29  inline ID3D11UnorderedAccessView* GetUAView() const;
30 
31  // Copy of data between CPU and GPU.
32  virtual bool Update(ID3D11DeviceContext* context, unsigned int sri) override;
33  virtual bool Update(ID3D11DeviceContext* context) override;
34  virtual bool CopyCpuToGpu(ID3D11DeviceContext* context, unsigned int sri) override;
35  virtual bool CopyCpuToGpu(ID3D11DeviceContext* context) override;
36  virtual bool CopyGpuToCpu(ID3D11DeviceContext* context, unsigned int sri) override;
37  virtual bool CopyGpuToCpu(ID3D11DeviceContext* context) override;
38  virtual void CopyGpuToGpu(ID3D11DeviceContext* context,
39  ID3D11Resource* target, unsigned int sri) override;
40  virtual void CopyGpuToGpu(ID3D11DeviceContext* context,
41  ID3D11Resource* target) override;
42 
43  // Support for the DX11 debug layer; see comments in the file
44  // GteDX11GraphicsObject.h about usage.
45  virtual void SetName(std::string const& name) override;
46 
47 protected:
48  // Support for copy of row-pitched and slice-pitched (noncontiguous)
49  // texture memory.
50  static void CopyPitched2(unsigned int numRows, unsigned int srcRowPitch,
51  void const* srcData, unsigned int trgRowPitch, void* trgData);
52 
53  static void CopyPitched3(unsigned int numRows, unsigned int numSlices,
54  unsigned int srcRowPitch, unsigned int srcSlicePitch,
55  void const* srcData, unsigned int trgRowPitch,
56  unsigned int trgSlicePitch, void* trgData);
57 
58  ID3D11ShaderResourceView* mSRView;
59  ID3D11UnorderedAccessView* mUAView;
60 };
61 
63 {
64  return static_cast<Texture*>(mGTObject);
65 }
66 
67 inline ID3D11ShaderResourceView* DX11Texture::GetSRView() const
68 {
69  return mSRView;
70 }
71 
72 inline ID3D11UnorderedAccessView* DX11Texture::GetUAView() const
73 {
74  return mUAView;
75 }
76 
77 }
ID3D11UnorderedAccessView * GetUAView() const
GLuint const GLchar * name
Definition: glcorearb.h:781
ID3D11UnorderedAccessView * mUAView
GLenum target
Definition: glcorearb.h:1662
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
ID3D11ShaderResourceView * GetSRView() const
Texture * GetTexture() const
ID3D11ShaderResourceView * mSRView
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:59