Rename the GLSL shader compiler namespace to glsl.
Bug 18962347
Change-Id: I28d001045cf43eed2d92cb0007330dffa620025b
Reviewed-on: https://swiftshader-review.googlesource.com/1760
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/compiler/OutputASM.cpp b/src/OpenGL/compiler/OutputASM.cpp
index ba70fc0..64fb951 100644
--- a/src/OpenGL/compiler/OutputASM.cpp
+++ b/src/OpenGL/compiler/OutputASM.cpp
@@ -20,7 +20,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-namespace sh
+namespace glsl
{
// Integer to TString conversion
TString str(int i)
@@ -2074,7 +2074,7 @@
}
}
- activeVaryings.push_back(sh::Varying(glVariableType(type), name, varying->getArraySize(), reg, 0));
+ activeVaryings.push_back(glsl::Varying(glVariableType(type), name, varying->getArraySize(), reg, 0));
}
}
diff --git a/src/OpenGL/compiler/OutputASM.h b/src/OpenGL/compiler/OutputASM.h
index 54af409..e0413b3 100644
--- a/src/OpenGL/compiler/OutputASM.h
+++ b/src/OpenGL/compiler/OutputASM.h
@@ -29,7 +29,7 @@
class Shader;
}
-namespace sh
+namespace glsl
{
struct Uniform
{
diff --git a/src/OpenGL/compiler/TranslatorASM.cpp b/src/OpenGL/compiler/TranslatorASM.cpp
index 0cf13d4..c041e05 100644
--- a/src/OpenGL/compiler/TranslatorASM.cpp
+++ b/src/OpenGL/compiler/TranslatorASM.cpp
@@ -13,14 +13,14 @@
#include "InitializeParseContext.h"
-TranslatorASM::TranslatorASM(sh::Shader *shaderObject, ShShaderType type, ShShaderSpec spec) : TCompiler(type, spec), shaderObject(shaderObject)
+TranslatorASM::TranslatorASM(glsl::Shader *shaderObject, ShShaderType type, ShShaderSpec spec) : TCompiler(type, spec), shaderObject(shaderObject)
{
}
bool TranslatorASM::translate(TIntermNode* root)
{
TParseContext& parseContext = *GetGlobalParseContext();
- sh::OutputASM outputASM(parseContext, shaderObject);
+ glsl::OutputASM outputASM(parseContext, shaderObject);
outputASM.output();
diff --git a/src/OpenGL/compiler/TranslatorASM.h b/src/OpenGL/compiler/TranslatorASM.h
index 32739ec..47fcb10 100644
--- a/src/OpenGL/compiler/TranslatorASM.h
+++ b/src/OpenGL/compiler/TranslatorASM.h
@@ -15,7 +15,7 @@
#include "ShHandle.h"
#include "OutputASM.h"
-namespace sh
+namespace glsl
{
class Shader;
}
@@ -23,13 +23,13 @@
class TranslatorASM : public TCompiler
{
public:
- TranslatorASM(sh::Shader *shaderObject, ShShaderType type, ShShaderSpec spec);
+ TranslatorASM(glsl::Shader *shaderObject, ShShaderType type, ShShaderSpec spec);
protected:
virtual bool translate(TIntermNode* root);
private:
- sh::Shader *const shaderObject;
+ glsl::Shader *const shaderObject;
};
#endif // COMPILER_TRANSLATORASM_H_
diff --git a/src/OpenGL/libGL/Program.cpp b/src/OpenGL/libGL/Program.cpp
index 71573d5..3ffb06b 100644
--- a/src/OpenGL/libGL/Program.cpp
+++ b/src/OpenGL/libGL/Program.cpp
@@ -940,9 +940,9 @@
// Packs varyings into generic varying registers, using the algorithm from [OpenGL ES Shading Language 1.00 rev. 17] appendix A section 7 page 111
// Returns the number of used varying registers, or -1 if unsuccesful
- int Program::packVaryings(const sh::Varying *packing[][4])
+ int Program::packVaryings(const glsl::Varying *packing[][4])
{
- for(sh::VaryingList::iterator varying = fragmentShader->varyings.begin(); varying != fragmentShader->varyings.end(); varying++)
+ for(glsl::VaryingList::iterator varying = fragmentShader->varyings.begin(); varying != fragmentShader->varyings.end(); varying++)
{
int n = VariableRowCount(varying->type) * varying->size();
int m = VariableColumnCount(varying->type);
@@ -1087,11 +1087,11 @@
bool Program::linkVaryings()
{
- for(sh::VaryingList::iterator input = fragmentShader->varyings.begin(); input != fragmentShader->varyings.end(); input++)
+ for(glsl::VaryingList::iterator input = fragmentShader->varyings.begin(); input != fragmentShader->varyings.end(); input++)
{
bool matched = false;
- for(sh::VaryingList::iterator output = vertexShader->varyings.begin(); output != vertexShader->varyings.end(); output++)
+ for(glsl::VaryingList::iterator output = vertexShader->varyings.begin(); output != vertexShader->varyings.end(); output++)
{
if(output->name == input->name)
{
@@ -1115,12 +1115,12 @@
}
}
- sh::VaryingList &psVaryings = fragmentShader->varyings;
- sh::VaryingList &vsVaryings = vertexShader->varyings;
+ glsl::VaryingList &psVaryings = fragmentShader->varyings;
+ glsl::VaryingList &vsVaryings = vertexShader->varyings;
- for(sh::VaryingList::iterator output = vsVaryings.begin(); output != vsVaryings.end(); output++)
+ for(glsl::VaryingList::iterator output = vsVaryings.begin(); output != vsVaryings.end(); output++)
{
- for(sh::VaryingList::iterator input = psVaryings.begin(); input != psVaryings.end(); input++)
+ for(glsl::VaryingList::iterator input = psVaryings.begin(); input != psVaryings.end(); input++)
{
if(output->name == input->name)
{
@@ -1221,7 +1221,7 @@
unsigned int usedLocations = 0;
// Link attributes that have a binding location
- for(sh::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
+ for(glsl::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
{
int location = getAttributeBinding(attribute->name);
@@ -1250,7 +1250,7 @@
}
// Link attributes that don't have a binding location
- for(sh::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
+ for(glsl::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
{
int location = getAttributeBinding(attribute->name);
@@ -1298,11 +1298,11 @@
bool Program::linkUniforms(Shader *shader)
{
- const sh::ActiveUniforms &activeUniforms = shader->activeUniforms;
+ const glsl::ActiveUniforms &activeUniforms = shader->activeUniforms;
for(unsigned int uniformIndex = 0; uniformIndex < activeUniforms.size(); uniformIndex++)
{
- const sh::Uniform &uniform = activeUniforms[uniformIndex];
+ const glsl::Uniform &uniform = activeUniforms[uniformIndex];
if(!defineUniform(shader->getType(), uniform.type, uniform.precision, uniform.name, uniform.arraySize, uniform.registerIndex))
{
diff --git a/src/OpenGL/libGL/Program.h b/src/OpenGL/libGL/Program.h
index 4afb55b..844ccdf 100644
--- a/src/OpenGL/libGL/Program.h
+++ b/src/OpenGL/libGL/Program.h
@@ -133,7 +133,7 @@
private:
void unlink();
- int packVaryings(const sh::Varying *packing[][4]);
+ int packVaryings(const glsl::Varying *packing[][4]);
bool linkVaryings();
bool linkAttributes();
@@ -171,7 +171,7 @@
sw::VertexShader *vertexBinary;
std::set<std::string> attributeBinding[MAX_VERTEX_ATTRIBS];
- sh::Attribute linkedAttribute[MAX_VERTEX_ATTRIBS];
+ glsl::Attribute linkedAttribute[MAX_VERTEX_ATTRIBS];
int attributeStream[MAX_VERTEX_ATTRIBS];
struct Sampler
diff --git a/src/OpenGL/libGL/Shader.cpp b/src/OpenGL/libGL/Shader.cpp
index fd09672..e99806d 100644
--- a/src/OpenGL/libGL/Shader.cpp
+++ b/src/OpenGL/libGL/Shader.cpp
@@ -269,7 +269,7 @@
}
// true if varying x has a higher priority in packing than y
-bool Shader::compareVarying(const sh::Varying &x, const sh::Varying &y)
+bool Shader::compareVarying(const glsl::Varying &x, const glsl::Varying &y)
{
if(x.type == y.type)
{
@@ -415,7 +415,7 @@
{
if(!attributeName.empty())
{
- for(sh::ActiveAttributes::iterator attribute = activeAttributes.begin(); attribute != activeAttributes.end(); attribute++)
+ for(glsl::ActiveAttributes::iterator attribute = activeAttributes.begin(); attribute != activeAttributes.end(); attribute++)
{
if(attribute->name == attributeName)
{
diff --git a/src/OpenGL/libGL/Shader.h b/src/OpenGL/libGL/Shader.h
index 05535e3..7c009f2 100644
--- a/src/OpenGL/libGL/Shader.h
+++ b/src/OpenGL/libGL/Shader.h
@@ -27,7 +27,7 @@
#include <list>
#include <vector>
-namespace sh
+namespace glsl
{
class OutputASM;
}
@@ -35,7 +35,7 @@
namespace es2
{
-class Shader : public sh::Shader
+class Shader : public glsl::Shader
{
friend class Program;
@@ -71,7 +71,7 @@
void clear();
static GLenum parseType(const std::string &type);
- static bool compareVarying(const sh::Varying &x, const sh::Varying &y);
+ static bool compareVarying(const glsl::Varying &x, const glsl::Varying &y);
char *mSource;
char *mInfoLog;
diff --git a/src/OpenGL/libGLESv2/Program.cpp b/src/OpenGL/libGLESv2/Program.cpp
index 71573d5..3ffb06b 100644
--- a/src/OpenGL/libGLESv2/Program.cpp
+++ b/src/OpenGL/libGLESv2/Program.cpp
@@ -940,9 +940,9 @@
// Packs varyings into generic varying registers, using the algorithm from [OpenGL ES Shading Language 1.00 rev. 17] appendix A section 7 page 111
// Returns the number of used varying registers, or -1 if unsuccesful
- int Program::packVaryings(const sh::Varying *packing[][4])
+ int Program::packVaryings(const glsl::Varying *packing[][4])
{
- for(sh::VaryingList::iterator varying = fragmentShader->varyings.begin(); varying != fragmentShader->varyings.end(); varying++)
+ for(glsl::VaryingList::iterator varying = fragmentShader->varyings.begin(); varying != fragmentShader->varyings.end(); varying++)
{
int n = VariableRowCount(varying->type) * varying->size();
int m = VariableColumnCount(varying->type);
@@ -1087,11 +1087,11 @@
bool Program::linkVaryings()
{
- for(sh::VaryingList::iterator input = fragmentShader->varyings.begin(); input != fragmentShader->varyings.end(); input++)
+ for(glsl::VaryingList::iterator input = fragmentShader->varyings.begin(); input != fragmentShader->varyings.end(); input++)
{
bool matched = false;
- for(sh::VaryingList::iterator output = vertexShader->varyings.begin(); output != vertexShader->varyings.end(); output++)
+ for(glsl::VaryingList::iterator output = vertexShader->varyings.begin(); output != vertexShader->varyings.end(); output++)
{
if(output->name == input->name)
{
@@ -1115,12 +1115,12 @@
}
}
- sh::VaryingList &psVaryings = fragmentShader->varyings;
- sh::VaryingList &vsVaryings = vertexShader->varyings;
+ glsl::VaryingList &psVaryings = fragmentShader->varyings;
+ glsl::VaryingList &vsVaryings = vertexShader->varyings;
- for(sh::VaryingList::iterator output = vsVaryings.begin(); output != vsVaryings.end(); output++)
+ for(glsl::VaryingList::iterator output = vsVaryings.begin(); output != vsVaryings.end(); output++)
{
- for(sh::VaryingList::iterator input = psVaryings.begin(); input != psVaryings.end(); input++)
+ for(glsl::VaryingList::iterator input = psVaryings.begin(); input != psVaryings.end(); input++)
{
if(output->name == input->name)
{
@@ -1221,7 +1221,7 @@
unsigned int usedLocations = 0;
// Link attributes that have a binding location
- for(sh::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
+ for(glsl::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
{
int location = getAttributeBinding(attribute->name);
@@ -1250,7 +1250,7 @@
}
// Link attributes that don't have a binding location
- for(sh::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
+ for(glsl::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
{
int location = getAttributeBinding(attribute->name);
@@ -1298,11 +1298,11 @@
bool Program::linkUniforms(Shader *shader)
{
- const sh::ActiveUniforms &activeUniforms = shader->activeUniforms;
+ const glsl::ActiveUniforms &activeUniforms = shader->activeUniforms;
for(unsigned int uniformIndex = 0; uniformIndex < activeUniforms.size(); uniformIndex++)
{
- const sh::Uniform &uniform = activeUniforms[uniformIndex];
+ const glsl::Uniform &uniform = activeUniforms[uniformIndex];
if(!defineUniform(shader->getType(), uniform.type, uniform.precision, uniform.name, uniform.arraySize, uniform.registerIndex))
{
diff --git a/src/OpenGL/libGLESv2/Program.h b/src/OpenGL/libGLESv2/Program.h
index 8fedcce..92dedf8 100644
--- a/src/OpenGL/libGLESv2/Program.h
+++ b/src/OpenGL/libGLESv2/Program.h
@@ -133,7 +133,7 @@
private:
void unlink();
- int packVaryings(const sh::Varying *packing[][4]);
+ int packVaryings(const glsl::Varying *packing[][4]);
bool linkVaryings();
bool linkAttributes();
@@ -171,7 +171,7 @@
sw::VertexShader *vertexBinary;
std::set<std::string> attributeBinding[MAX_VERTEX_ATTRIBS];
- sh::Attribute linkedAttribute[MAX_VERTEX_ATTRIBS];
+ glsl::Attribute linkedAttribute[MAX_VERTEX_ATTRIBS];
int attributeStream[MAX_VERTEX_ATTRIBS];
struct Sampler
diff --git a/src/OpenGL/libGLESv2/Shader.cpp b/src/OpenGL/libGLESv2/Shader.cpp
index fd09672..e99806d 100644
--- a/src/OpenGL/libGLESv2/Shader.cpp
+++ b/src/OpenGL/libGLESv2/Shader.cpp
@@ -269,7 +269,7 @@
}
// true if varying x has a higher priority in packing than y
-bool Shader::compareVarying(const sh::Varying &x, const sh::Varying &y)
+bool Shader::compareVarying(const glsl::Varying &x, const glsl::Varying &y)
{
if(x.type == y.type)
{
@@ -415,7 +415,7 @@
{
if(!attributeName.empty())
{
- for(sh::ActiveAttributes::iterator attribute = activeAttributes.begin(); attribute != activeAttributes.end(); attribute++)
+ for(glsl::ActiveAttributes::iterator attribute = activeAttributes.begin(); attribute != activeAttributes.end(); attribute++)
{
if(attribute->name == attributeName)
{
diff --git a/src/OpenGL/libGLESv2/Shader.h b/src/OpenGL/libGLESv2/Shader.h
index ce0ce9a..f6a3feb 100644
--- a/src/OpenGL/libGLESv2/Shader.h
+++ b/src/OpenGL/libGLESv2/Shader.h
@@ -27,7 +27,7 @@
#include <list>
#include <vector>
-namespace sh
+namespace glsl
{
class OutputASM;
}
@@ -35,7 +35,7 @@
namespace es2
{
-class Shader : public sh::Shader
+class Shader : public glsl::Shader
{
friend class Program;
@@ -71,7 +71,7 @@
void clear();
static GLenum parseType(const std::string &type);
- static bool compareVarying(const sh::Varying &x, const sh::Varying &y);
+ static bool compareVarying(const glsl::Varying &x, const glsl::Varying &y);
char *mSource;
char *mInfoLog;
diff --git a/src/Radiance/libRAD/Program.cpp b/src/Radiance/libRAD/Program.cpp
index 18e8af1..859658e 100644
--- a/src/Radiance/libRAD/Program.cpp
+++ b/src/Radiance/libRAD/Program.cpp
@@ -940,9 +940,9 @@
// Packs varyings into generic varying registers, using the algorithm from [OpenGL ES Shading Language 1.00 rev. 17] appendix A section 7 page 111
// Returns the number of used varying registers, or -1 if unsuccesful
- int Program::packVaryings(const sh::Varying *packing[][4])
+ int Program::packVaryings(const glsl::Varying *packing[][4])
{
- for(sh::VaryingList::iterator varying = fragmentShader->varyings.begin(); varying != fragmentShader->varyings.end(); varying++)
+ for(glsl::VaryingList::iterator varying = fragmentShader->varyings.begin(); varying != fragmentShader->varyings.end(); varying++)
{
int n = VariableRowCount(varying->type) * varying->size();
int m = VariableColumnCount(varying->type);
@@ -1087,11 +1087,11 @@
bool Program::linkVaryings()
{
- for(sh::VaryingList::iterator input = fragmentShader->varyings.begin(); input != fragmentShader->varyings.end(); input++)
+ for(glsl::VaryingList::iterator input = fragmentShader->varyings.begin(); input != fragmentShader->varyings.end(); input++)
{
bool matched = false;
- for(sh::VaryingList::iterator output = vertexShader->varyings.begin(); output != vertexShader->varyings.end(); output++)
+ for(glsl::VaryingList::iterator output = vertexShader->varyings.begin(); output != vertexShader->varyings.end(); output++)
{
if(output->name == input->name)
{
@@ -1115,12 +1115,12 @@
}
}
- sh::VaryingList &psVaryings = fragmentShader->varyings;
- sh::VaryingList &vsVaryings = vertexShader->varyings;
+ glsl::VaryingList &psVaryings = fragmentShader->varyings;
+ glsl::VaryingList &vsVaryings = vertexShader->varyings;
- for(sh::VaryingList::iterator output = vsVaryings.begin(); output != vsVaryings.end(); output++)
+ for(glsl::VaryingList::iterator output = vsVaryings.begin(); output != vsVaryings.end(); output++)
{
- for(sh::VaryingList::iterator input = psVaryings.begin(); input != psVaryings.end(); input++)
+ for(glsl::VaryingList::iterator input = psVaryings.begin(); input != psVaryings.end(); input++)
{
if(output->name == input->name)
{
@@ -1221,7 +1221,7 @@
unsigned int usedLocations = 0;
// Link attributes that have a binding location
- for(sh::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
+ for(glsl::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
{
int location = getAttributeBinding(attribute->name);
@@ -1250,7 +1250,7 @@
}
// Link attributes that don't have a binding location
- for(sh::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
+ for(glsl::ActiveAttributes::iterator attribute = vertexShader->activeAttributes.begin(); attribute != vertexShader->activeAttributes.end(); attribute++)
{
int location = getAttributeBinding(attribute->name);
@@ -1298,11 +1298,11 @@
bool Program::linkUniforms(Shader *shader)
{
- const sh::ActiveUniforms &activeUniforms = shader->activeUniforms;
+ const glsl::ActiveUniforms &activeUniforms = shader->activeUniforms;
for(unsigned int uniformIndex = 0; uniformIndex < activeUniforms.size(); uniformIndex++)
{
- const sh::Uniform &uniform = activeUniforms[uniformIndex];
+ const glsl::Uniform &uniform = activeUniforms[uniformIndex];
if(!defineUniform(shader->getType(), uniform.type, uniform.precision, uniform.name, uniform.arraySize, uniform.registerIndex))
{
diff --git a/src/Radiance/libRAD/Program.h b/src/Radiance/libRAD/Program.h
index e07f275..4c1a2b9 100644
--- a/src/Radiance/libRAD/Program.h
+++ b/src/Radiance/libRAD/Program.h
@@ -142,7 +142,7 @@
private:
void unlink();
- int packVaryings(const sh::Varying *packing[][4]);
+ int packVaryings(const glsl::Varying *packing[][4]);
bool linkVaryings();
bool linkAttributes();
@@ -180,7 +180,7 @@
sw::VertexShader *vertexBinary;
std::set<std::string> attributeBinding[MAX_VERTEX_ATTRIBS];
- sh::Attribute linkedAttribute[MAX_VERTEX_ATTRIBS];
+ glsl::Attribute linkedAttribute[MAX_VERTEX_ATTRIBS];
int attributeStream[MAX_VERTEX_ATTRIBS];
struct Sampler
diff --git a/src/Radiance/libRAD/Shader.cpp b/src/Radiance/libRAD/Shader.cpp
index 50ae334..3bd5261 100644
--- a/src/Radiance/libRAD/Shader.cpp
+++ b/src/Radiance/libRAD/Shader.cpp
@@ -269,7 +269,7 @@
}
// true if varying x has a higher priority in packing than y
-bool Shader::compareVarying(const sh::Varying &x, const sh::Varying &y)
+bool Shader::compareVarying(const glsl::Varying &x, const glsl::Varying &y)
{
if(x.type == y.type)
{
@@ -415,7 +415,7 @@
{
if(!attributeName.empty())
{
- for(sh::ActiveAttributes::iterator attribute = activeAttributes.begin(); attribute != activeAttributes.end(); attribute++)
+ for(glsl::ActiveAttributes::iterator attribute = activeAttributes.begin(); attribute != activeAttributes.end(); attribute++)
{
if(attribute->name == attributeName)
{
diff --git a/src/Radiance/libRAD/Shader.h b/src/Radiance/libRAD/Shader.h
index 9f910ce..5b80970 100644
--- a/src/Radiance/libRAD/Shader.h
+++ b/src/Radiance/libRAD/Shader.h
@@ -25,7 +25,7 @@
#include <list>
#include <vector>
-namespace sh
+namespace glsl
{
class OutputASM;
}
@@ -33,7 +33,7 @@
namespace es2
{
-class Shader : public sh::Shader
+class Shader : public glsl::Shader
{
friend class Program;
@@ -69,7 +69,7 @@
void clear();
static GLenum parseType(const std::string &type);
- static bool compareVarying(const sh::Varying &x, const sh::Varying &y);
+ static bool compareVarying(const glsl::Varying &x, const glsl::Varying &y);
char *mSource;
char *mInfoLog;