mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 23:24:41 +00:00
Add sampler names to ShaderData for use on old versions of OpenGL and Opengl ES2 that not support explicit sampler location on shader files.
This commit is contained in:
parent
c354f59b72
commit
79e158d528
6 changed files with 156 additions and 3 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue