From 9520802e72b9b84f5b70dc6cd87701a4309ffed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 18 Jan 2019 23:28:37 -0800 Subject: [PATCH] Cleanup. --- tools/shaderc/shaderc_spirv.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/shaderc/shaderc_spirv.cpp b/tools/shaderc/shaderc_spirv.cpp index a42cb9cb9..0463cbbb2 100644 --- a/tools/shaderc/shaderc_spirv.cpp +++ b/tools/shaderc/shaderc_spirv.cpp @@ -680,8 +680,6 @@ namespace bgfx { namespace spirv if (_firstPass) { - const size_t strLength = bx::strLen("uniform"); - // first time through, we just find unused uniforms and get rid of them std::string output; bx::Error err; @@ -699,13 +697,12 @@ namespace bgfx { namespace spirv { bool found = false; - if (!bx::findIdentifierMatch(strLine.c_str(), "SamplerState").isEmpty()) + if (!bx::findIdentifierMatch(strLine.c_str(), "SamplerState").isEmpty() ) { found = true; - } + } else { - for (int32_t ii = 0, num = program->getNumLiveUniformVariables(); ii < num; ++ii) { // matching lines like: uniform u_name; @@ -723,7 +720,7 @@ namespace bgfx { namespace spirv if (!found) { - strLine = strLine.replace(index, strLength, "static"); + strLine = strLine.replace(index, 7 /* uniform */, "static"); } }