OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreD3D11GpuProgram.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __D3D11GpuProgram_H_
29 #define __D3D11GpuProgram_H_
30 
31 // Precompiler options
32 #include "OgreD3D11Prerequisites.h"
33 #include "OgreGpuProgram.h"
34 
35 namespace Ogre {
36 
38  class D3D11GpuProgram : public GpuProgram
39  {
40  protected:
42  public:
43  D3D11GpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
44  const String& group, bool isManual, ManualResourceLoader* loader, D3D11Device & device);
45 
46  protected:
48  void loadImpl(void);
50  void loadFromSource(void);
52  virtual void loadFromMicrocode(ID3D10Blob * microcode) = 0;
53 
54 
55  };
56 
59  {
60  protected:
61  ID3D11VertexShader * mVertexShader;
62  public:
63  D3D11GpuVertexProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
64  const String& group, bool isManual, ManualResourceLoader* loader, D3D11Device & device);
67  ID3D11VertexShader * getVertexShader(void) const;
68  protected:
70  void unloadImpl(void);
71  void loadFromMicrocode(ID3D10Blob * microcode);
72  };
73 
76  {
77  protected:
78  ID3D11PixelShader * mPixelShader;
79  public:
80  D3D11GpuFragmentProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
81  const String& group, bool isManual, ManualResourceLoader* loader, D3D11Device & device);
84  ID3D11PixelShader * getPixelShader(void) const;
85  protected:
87  void unloadImpl(void);
88  void loadFromMicrocode(ID3D10Blob * microcode);
89  };
90 
93  {
94  protected:
95  ID3D11DomainShader * mDomainShader;
96  public:
97  D3D11GpuDomainProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
98  const String& group, bool isManual, ManualResourceLoader* loader, D3D11Device & device);
101  ID3D11DomainShader * getDomainShader(void) const;
102  protected:
104  void unloadImpl(void);
105  void loadFromMicrocode(ID3D10Blob * microcode);
106  };
107 
110  {
111  protected:
112  ID3D11HullShader * mHullShader;
113  public:
114  D3D11GpuHullProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
115  const String& group, bool isManual, ManualResourceLoader* loader, D3D11Device & device);
118  ID3D11HullShader * getHullShader() const;
119  protected:
121  void unloadImpl(void);
122  void loadFromMicrocode(ID3D10Blob * microcode);
123  };
124 
125 
131  {
132  protected:
133  ID3D11GeometryShader * mGeometryShader;
134  public:
135  D3D11GpuGeometryProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
136  const String& group, bool isManual, ManualResourceLoader* loader, D3D11Device & device);
139  ID3D11GeometryShader * getGeometryShader(void) const;
140  protected:
142  void unloadImpl(void);
143  void loadFromMicrocode(ID3D10Blob * microcode);
144  };
145 }
146 
147 
148 #endif
D3D11GpuDomainProgram(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader, D3D11Device &device)
ID3D11PixelShader * getPixelShader(void) const
Gets the pixel shader.
void loadImpl(void)
Internal implementation of the meat of the 'load' action, only called if this resource is not being l...
virtual void loadFromMicrocode(ID3D10Blob *microcode)=0
Internal method to load from microcode, must be overridden by subclasses.
void loadFromMicrocode(ID3D10Blob *microcode)
Internal method to load from microcode, must be overridden by subclasses.
ID3D11HullShader * mHullShader
D3D11GpuProgram(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader, D3D11Device &device)
Defines a program which runs on the GPU such as a vertex or fragment program.
Direct3D implementation of low-level vertex programs.
D3D11GpuGeometryProgram(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader, D3D11Device &device)
Interface describing a manual resource loader.
Definition: OgreResource.h:498
D3D11GpuHullProgram(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader, D3D11Device &device)
void loadFromMicrocode(ID3D10Blob *microcode)
Internal method to load from microcode, must be overridden by subclasses.
ID3D11HullShader * getHullShader() const
Gets the vertex shader.
void unloadImpl(void)
Internal implementation of the 'unload' action; called regardless of whether this resource is being l...
D3D11GpuFragmentProgram(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader, D3D11Device &device)
void unloadImpl(void)
Internal implementation of the 'unload' action; called regardless of whether this resource is being l...
Direct3D implementation of low-level fragment programs.
void loadFromMicrocode(ID3D10Blob *microcode)
Internal method to load from microcode, must be overridden by subclasses.
ID3D11VertexShader * mVertexShader
void loadFromMicrocode(ID3D10Blob *microcode)
Internal method to load from microcode, must be overridden by subclasses.
ID3D11GeometryShader * mGeometryShader
void unloadImpl(void)
Internal implementation of the 'unload' action; called regardless of whether this resource is being l...
void unloadImpl(void)
Internal implementation of the 'unload' action; called regardless of whether this resource is being l...
void unloadImpl(void)
Internal implementation of the 'unload' action; called regardless of whether this resource is being l...
ID3D11VertexShader * getVertexShader(void) const
Gets the vertex shader.
Direct3D implementation of low-level vertex programs.
void loadFromSource(void)
Overridden from GpuProgram.
Direct3D implementation of low-level geometry programs.
unsigned long long int ResourceHandle
Definition: OgreResource.h:39
ID3D11DomainShader * mDomainShader
Direct3D implementation of low-level vertex programs.
Defines a generic resource handler.
ID3D11DomainShader * getDomainShader(void) const
Gets the vertex shader.
D3D11GpuVertexProgram(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader, D3D11Device &device)
_StringBase String
Definition: OgreCommon.h:53
void loadFromMicrocode(ID3D10Blob *microcode)
Internal method to load from microcode, must be overridden by subclasses.
Direct3D implementation of a few things common to low-level vertex & fragment programs.
ID3D11GeometryShader * getGeometryShader(void) const
Gets the geometry shader.