From 46f46298199a1241a8e760e0ca6f69644e1cb319 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 5 May 2019 21:30:52 -0700 Subject: Added AddShaderMacro<> specialization for uints --- Graphics/GraphicsTools/include/ShaderMacroHelper.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Graphics/GraphicsTools') 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( 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( Name, ss.str().c_str() ); +} + } -- cgit v1.2.3