mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 22:54:34 +00:00
Merge pull request #925 from BeamNG/shaderdata_samplernames
Add sampler names to ShaderData
This commit is contained in:
commit
03ffa1ddd3
17 changed files with 314 additions and 26 deletions
|
|
@ -1101,11 +1101,13 @@ void GFXD3D9Shader::_getShaderConstants( ID3DXConstantTable *table,
|
|||
desc.constType = GFXSCT_Sampler;
|
||||
desc.arraySize = constantDesc.RegisterIndex;
|
||||
samplerDescriptions.push_back( desc );
|
||||
mShaderConsts.push_back(desc);
|
||||
break;
|
||||
case D3DXPT_SAMPLERCUBE :
|
||||
desc.constType = GFXSCT_SamplerCube;
|
||||
desc.arraySize = constantDesc.RegisterIndex;
|
||||
samplerDescriptions.push_back( desc );
|
||||
mShaderConsts.push_back(desc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1371,7 +1373,7 @@ GFXShaderConstBufferRef GFXD3D9Shader::allocConstBuffer()
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns a shader constant handle for name, if the variable doesn't exist NULL is returned.
|
||||
/// Returns a shader constant handle for name
|
||||
GFXShaderConstHandle* GFXD3D9Shader::getShaderConstHandle(const String& name)
|
||||
{
|
||||
HandleMap::Iterator i = mHandles.find(name);
|
||||
|
|
@ -1390,6 +1392,20 @@ GFXShaderConstHandle* GFXD3D9Shader::getShaderConstHandle(const String& name)
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns a shader constant handle for name, if the variable doesn't exist NULL is returned.
|
||||
GFXShaderConstHandle* GFXD3D9Shader::findShaderConstHandle(const String& name)
|
||||
{
|
||||
HandleMap::Iterator i = mHandles.find(name);
|
||||
if ( i != mHandles.end() )
|
||||
{
|
||||
return i->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
const Vector<GFXShaderConstDesc>& GFXD3D9Shader::getShaderConstDesc() const
|
||||
{
|
||||
return mShaderConsts;
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ public:
|
|||
virtual GFXShaderConstBufferRef allocConstBuffer();
|
||||
virtual const Vector<GFXShaderConstDesc>& getShaderConstDesc() const;
|
||||
virtual GFXShaderConstHandle* getShaderConstHandle(const String& name);
|
||||
virtual GFXShaderConstHandle* findShaderConstHandle(const String& name);
|
||||
virtual U32 getAlignmentValue(const GFXShaderConstType constType) const;
|
||||
virtual bool getDisassembly( String &outStr ) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -1117,4 +1117,10 @@ inline void GFXDevice::setVertexFormat( const GFXVertexFormat *vertexFormat )
|
|||
}
|
||||
|
||||
|
||||
#if defined(TORQUE_DEBUG) && defined(TORQUE_DEBUG_GFX)
|
||||
#define GFXAssertFatal(x, error) AssertFatal(x, error)
|
||||
#else
|
||||
#define GFXAssertFatal(x, error)
|
||||
#endif
|
||||
|
||||
#endif // _GFXDEVICE_H_
|
||||
|
|
|
|||
|
|
@ -332,6 +332,9 @@ public:
|
|||
/// if the constant doesn't exist at this time.
|
||||
virtual GFXShaderConstHandle* getShaderConstHandle( const String& name ) = 0;
|
||||
|
||||
/// Returns a shader constant handle for the name constant, if the variable doesn't exist NULL is returned.
|
||||
virtual GFXShaderConstHandle* findShaderConstHandle( const String& name ) = 0;
|
||||
|
||||
/// Returns the alignment value for constType
|
||||
virtual U32 getAlignmentValue(const GFXShaderConstType constType) const = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue