28 #ifndef __D3D11HLSLProgram_H__ 29 #define __D3D11HLSLProgram_H__ 159 #define INVALID_IDX (unsigned int)-1 171 : mIdx(index), mName(name)
180 , mUniformBuffer(info.mUniformBuffer)
181 , mShaderVars(info.mShaderVars)
189 this->mIdx = info.
mIdx;
190 this->mName = info.
mName;
204 return mName == other.
mName && mIdx == other.
mIdx;
210 return mName < other.
mName;
212 else if (mName ==
"" || other.
mName ==
"")
214 return mIdx < other.
mIdx;
218 if (mName == other.
mName)
220 return mIdx < other.
mIdx;
224 return mName < other.
mName;
237 typedef std::map<std::string, unsigned int>
SlotMap;
238 typedef std::map<std::string, unsigned int>::const_iterator
SlotIterator;
336 ID3D11ClassInstance** classes,
unsigned int& numInstances,
363 const D3D11_SIGNATURE_PARAMETER_DESC &
getInputParamDesc(
unsigned int index)
const;
void CreateDomainShader()
const String & getCompatibleTarget(void) const
Gets the shader target promoted to the first compatible, e.g.
void populateParameterNames(GpuProgramParametersSharedPtr params)
Populate the passed parameters with name->index map, must be overridden.
ID3D11Buffer * getConstantBuffer(GpuProgramParametersSharedPtr params, uint16 variabilityMask)
void getMicrocodeFromCache(void)
ShaderVars::iterator ShaderVarsIter
String getNameForMicrocodeCache()
const String & getEntryPoint(void) const
Gets the entry point defined for this program.
void CreateGeometryShader()
void CreateComputeShader()
InterfaceSlots mInterfaceSlots
const String & getLanguage(void) const
Overridden from GpuProgram.
D3d11ShaderVariables::iterator D3d11ShaderVariablesIter
void getConstantBuffers(ID3D11Buffer **buffers, unsigned int &numBuffers, ID3D11ClassInstance **classes, unsigned int &numInstances, GpuProgramParametersSharedPtr params, uint16 variabilityMask)
Command object for setting macro defines.
void reinterpretGSForStreamOut(void)
void setTarget(const String &target)
Sets the shader target to compile down to, e.g.
bool mColumnMajorMatrices
D3d11ShaderTypeDescs mMemberTypeDesc
void fixVariableNameFromCg(const ShaderVarWithPosInBuf &newVar)
void CreateVertexShader()
vector< UINT >::type InterfaceSlots
ID3D11Buffer * mConstantBuffer
String mPreprocessorDefines
void populateDef(D3D11_SHADER_TYPE_DESC &d3dDesc, GpuConstantDefinition &def) const
Command object for setting entry point.
void setEnableBackwardsCompatibility(bool enableBackwardsCompatibility)
Sets whether backwards compatibility is enabled.
vector< MemberTypeName >::type MemberTypeNames
static CmdEnableBackwardsCompatibility msCmdEnableBackwardsCompatibility
D3D11HLSLProgram(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader, D3D11Device &device)
const String & getPreprocessorDefines(void) const
Sets the preprocessor defines use to compile the program.
ID3D11DomainShader * mDomainShader
void setShaderMacros(D3D_SHADER_MACRO *shaderMacros)
Sets shader macros created manually.
Abstract base class representing a high-level program (a vertex or fragment program).
vector< D3D11_SHADER_TYPE_DESC >::type D3d11ShaderTypeDescs
Interface describing a manual resource loader.
void setColumnMajorMatrices(bool columnMajor)
Sets whether matrix packing in column-major order.
BufferInfo(unsigned int index)
Command object for setting target assembler.
ID3D11DomainShader * getDomainShader(void) const
stdext::hash_compare< _StringBase, std::less< _StringBase > > _StringHash
unsigned long long int ResourceHandle
void setPreprocessorDefines(const String &defines)
Sets the preprocessor defines use to compile the program.
D3d11ShaderBufferDescs mD3d11ShaderBufferDescs
D3d11ShaderParameters mD3d11ShaderInputParameters
ID3D11VertexShader * mVertexShader
Command object for setting backwards compatibility.
static CmdTarget msCmdTarget
unsigned int getSubroutineSlot(const String &subroutineSlotName) const
const D3D11_SIGNATURE_PARAMETER_DESC & getInputParamDesc(unsigned int index) const
void processParamElement(String prefix, LPCSTR pName, ID3D11ShaderReflectionType *varRefType)
HardwareUniformBufferSharedPtr mUniformBuffer
bool getEnableBackwardsCompatibility(void) const
Gets whether backwards compatibility is enabled.
vector< ShaderVarWithPosInBuf >::type ShaderVars
Specialisation of VertexDeclaration for D3D11.
D3d11ShaderVariables mVarDescBuffer
std::map< std::string, unsigned int > SlotMap
void createLowLevelImpl(void)
Internal method for creating an appropriate low-level program from this high-level program...
MemberTypeNames mMemberTypeName
std::map< std::string, unsigned int >::const_iterator SlotIterator
bool operator==(const BufferInfo &other) const
void unloadHighLevelImpl(void)
Internal unload implementation, must be implemented by subclasses.
BufferInfo(unsigned int index, const String &name)
static CmdPreprocessorDefines msCmdPreprocessorDefines
static CmdEntryPoint msCmdEntryPoint
BufferInfo(const String &name)
Specialization of HighLevelGpuProgram to provide support for D3D11 High-Level Shader Language (HLSL)...
Command object for setting matrix packing in column-major order.
void setEntryPoint(const String &entryPoint)
Sets the entry point for this program ie the first method called.
void compileMicrocode(void)
const MicroCode & getMicroCode(void) const
ID3D11VertexShader * getVertexShader(void) const
D3d11ShaderParameters mD3d11ShaderOutputParameters
static CmdColumnMajorMatrices msCmdColumnMajorMatrices
unsigned int getNumOutputs(void) const
BufferInfo & operator=(unsigned int index)
ID3D11GeometryShader * mGeometryShader
unsigned int getNumInputs(void) const
BufferInfo & operator=(const String &name)
D3d11ShaderVariables mD3d11ShaderVariables
D3D11VertexDeclaration mInputVertexDeclaration
String doGet(const void *target) const
D3d11ShaderVariableSubparts mD3d11ShaderVariableSubparts
D3d11ShaderParameters::iterator D3d11ShaderParametersIter
vector< D3D11_SHADER_BUFFER_DESC >::type D3d11ShaderBufferDescs
D3d11ShaderVariableSubparts::iterator D3d11ShaderVariableSubpartsIter
D3d11ShaderTypeDescs mD3d11ShaderTypeDescs
ID3D11ComputeShader * mComputeShader
void createConstantBuffer(const UINT ByteWidth)
void loadFromSource(void)
Internal load implementation, must be implemented by subclasses.
Defines a generic resource handler.
vector< GpuConstantDefinitionWithName >::type D3d11ShaderVariableSubparts
ID3D11HullShader * mHullShader
ID3D11ComputeShader * getComputeShader(void) const
This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info...
bool mEnableBackwardsCompatibility
ShaderVarWithPosInBuf & operator=(const ShaderVarWithPosInBuf &var)
D3d11ShaderVariables mVarDescPointer
ID3D11PixelShader * mPixelShader
ID3D11HullShader * getHullShader(void) const
BufferInfo(const BufferInfo &info)
vector< byte >::type MicroCode
ID3D11GeometryShader * getGeometryShader(void) const
bool isSupported(void) const
Overridden from GpuProgram.
ID3D11PixelShader * getPixelShader(void) const
bool getColumnMajorMatrices(void) const
Gets whether matrix packed in column-major order.
const D3D11_SIGNATURE_PARAMETER_DESC & getOutputParamDesc(unsigned int index) const
const String & getTarget(void) const
Gets the shader target to compile down to, e.g.
GpuProgramParametersSharedPtr createParameters(void)
Overridden from GpuProgram.
Abstract class which is command object which gets/sets parameters.
ShaderVars::const_iterator ShaderVarsConstIter
Information about predefined program constants.
D3D11VertexDeclaration & getInputVertexDeclaration()
vector< String * >::type mSerStrings
void doSet(void *target, const String &val)
vector< D3D11_SHADER_VARIABLE_DESC >::type D3d11ShaderVariables
BufferInfo & operator=(const BufferInfo &info)
bool operator<(const BufferInfo &other) const
vector< D3D11_SIGNATURE_PARAMETER_DESC >::type D3d11ShaderParameters
std::set< BufferInfo >::iterator BufferInfoIterator
BufferInfoMap mBufferInfoMap
virtual void buildConstantDefinitions() const
Build the constant definition map, must be overridden.
std::set< BufferInfo > BufferInfoMap
D3D_SHADER_MACRO * mShaderMacros