Share ArrayString and Str helper methods.
Placing these string helper methods allows us to re-use them in
the relevant place of the shader translator.
BUG=angle:466
Change-Id: Idd638542027d3b1035bc79fc941e80bf436c82af
Reviewed-on: https://chromium-review.googlesource.com/206567
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libGLESv2/DynamicHLSL.cpp b/src/libGLESv2/DynamicHLSL.cpp
index c32b407..78cbf15 100644
--- a/src/libGLESv2/DynamicHLSL.cpp
+++ b/src/libGLESv2/DynamicHLSL.cpp
@@ -17,12 +17,8 @@
#include "libGLESv2/formatutils.h"
#include "common/blocklayout.h"
-static std::string Str(int i)
-{
- char buffer[20];
- snprintf(buffer, sizeof(buffer), "%d", i);
- return buffer;
-}
+// For use with ArrayString, see angleutils.h
+META_ASSERT(GL_INVALID_INDEX == UINT_MAX);
namespace gl_d3d
{
@@ -77,11 +73,6 @@
namespace gl
{
-std::string ArrayString(unsigned int i)
-{
- return (i == GL_INVALID_INDEX ? "" : "[" + Str(i) + "]");
-}
-
const std::string VERTEX_ATTRIBUTE_STUB_STRING = "@@ VERTEX ATTRIBUTES @@";
const std::string PIXEL_OUTPUT_STUB_STRING = "@@ PIXEL OUTPUT @@";