Resubmit: Use ImmutableString for HLSL texture references
This fixes an issue in the original revision of this patch by adding
a operator<< to TInfoSinkBase that takes ImmutableString as a
parameter.
This also adds ImmutableStringBuilder class, which can be used to
build ImmutableStrings in place without extra allocations if the
maximum length is known in advance.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I52e984657a3aba3e6fe67a82b401c6b8de557d18
Reviewed-on: https://chromium-review.googlesource.com/890522
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/UtilsHLSL.cpp b/src/compiler/translator/UtilsHLSL.cpp
index 2b8c688..14ba353 100644
--- a/src/compiler/translator/UtilsHLSL.cpp
+++ b/src/compiler/translator/UtilsHLSL.cpp
@@ -218,7 +218,7 @@
return HLSL_TEXTURE_UNKNOWN;
}
-TString TextureString(const HLSLTextureGroup textureGroup)
+const char *TextureString(const HLSLTextureGroup textureGroup)
{
switch (textureGroup)
{
@@ -277,12 +277,12 @@
return "<unknown read texture type>";
}
-TString TextureString(const TBasicType type, TLayoutImageInternalFormat imageInternalFormat)
+const char *TextureString(const TBasicType type, TLayoutImageInternalFormat imageInternalFormat)
{
return TextureString(TextureGroup(type, imageInternalFormat));
}
-TString TextureGroupSuffix(const HLSLTextureGroup type)
+const char *TextureGroupSuffix(const HLSLTextureGroup type)
{
switch (type)
{
@@ -341,7 +341,8 @@
return "<unknown texture type>";
}
-TString TextureGroupSuffix(const TBasicType type, TLayoutImageInternalFormat imageInternalFormat)
+const char *TextureGroupSuffix(const TBasicType type,
+ TLayoutImageInternalFormat imageInternalFormat)
{
return TextureGroupSuffix(TextureGroup(type, imageInternalFormat));
}