diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-05-06 04:30:52 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-05-06 04:30:52 +0000 |
| commit | 46f46298199a1241a8e760e0ca6f69644e1cb319 (patch) | |
| tree | 0def7cae5ebf06a764c54f88e96eddceef249687 /Graphics/GraphicsTools | |
| parent | Minor change (diff) | |
| download | DiligentCore-46f46298199a1241a8e760e0ca6f69644e1cb319.tar.gz DiligentCore-46f46298199a1241a8e760e0ca6f69644e1cb319.zip | |
Added AddShaderMacro<> specialization for uints
Diffstat (limited to 'Graphics/GraphicsTools')
| -rw-r--r-- | Graphics/GraphicsTools/include/ShaderMacroHelper.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Graphics/GraphicsTools/include/ShaderMacroHelper.h b/Graphics/GraphicsTools/include/ShaderMacroHelper.h index e07a1d6f..811f1886 100644 --- a/Graphics/GraphicsTools/include/ShaderMacroHelper.h +++ b/Graphics/GraphicsTools/include/ShaderMacroHelper.h @@ -130,4 +130,13 @@ inline void ShaderMacroHelper::AddShaderMacro( const Diligent::Char* Name, float AddShaderMacro<const Diligent::Char*>( Name, ss.str().c_str() ); } +template<> +inline void ShaderMacroHelper::AddShaderMacro( const Diligent::Char* Name, Uint32 Definition ) +{ + // Make sure that uint constants have the 'u' suffix to avoid problems in GLES. + std::ostringstream ss; + ss << Definition << 'u'; + AddShaderMacro<const Diligent::Char*>( Name, ss.str().c_str() ); +} + } |
