Move ShaderVariables to common shared source.
Also move the block layout encoding utilities to the common folder.
The combined changes allow us to include the shader and block code
into both libGLESv2 and the translator separately. This in turn
fixes the Chromium component build, where we were calling internal
translator functions directly from libGLESv2.
BUG=angle:568
Change-Id: Ibcfa2c936a7c737ad515c10bd24061ff39ee5747
Reviewed-on: https://chromium-review.googlesource.com/192891
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libGLESv2/Shader.cpp b/src/libGLESv2/Shader.cpp
index 10bcd74..baced15 100644
--- a/src/libGLESv2/Shader.cpp
+++ b/src/libGLESv2/Shader.cpp
@@ -115,17 +115,17 @@
getSourceImpl(mHlsl, bufSize, length, buffer);
}
-const std::vector<sh::Uniform> &Shader::getUniforms() const
+const std::vector<Uniform> &Shader::getUniforms() const
{
return mActiveUniforms;
}
-const sh::ActiveInterfaceBlocks &Shader::getInterfaceBlocks() const
+const std::vector<InterfaceBlock> &Shader::getInterfaceBlocks() const
{
return mActiveInterfaceBlocks;
}
-std::vector<sh::Varying> &Shader::getVaryings()
+std::vector<Varying> &Shader::getVaryings()
{
return mVaryings;
}
@@ -225,7 +225,7 @@
{
if (!mHlsl.empty())
{
- std::vector<sh::Varying> *activeVaryings;
+ std::vector<Varying> *activeVaryings;
ShGetInfoPointer(compiler, SH_ACTIVE_VARYINGS_ARRAY, reinterpret_cast<void**>(&activeVaryings));
mVaryings = *activeVaryings;
@@ -357,11 +357,11 @@
void *activeUniforms;
ShGetInfoPointer(compiler, SH_ACTIVE_UNIFORMS_ARRAY, &activeUniforms);
- mActiveUniforms = *(std::vector<sh::Uniform>*)activeUniforms;
+ mActiveUniforms = *(std::vector<Uniform>*)activeUniforms;
void *activeInterfaceBlocks;
ShGetInfoPointer(compiler, SH_ACTIVE_INTERFACE_BLOCKS_ARRAY, &activeInterfaceBlocks);
- mActiveInterfaceBlocks = *(sh::ActiveInterfaceBlocks*)activeInterfaceBlocks;
+ mActiveInterfaceBlocks = *(std::vector<InterfaceBlock>*)activeInterfaceBlocks;
}
else
{
@@ -440,7 +440,7 @@
};
// true if varying x has a higher priority in packing than y
-bool Shader::compareVarying(const sh::ShaderVariable &x, const sh::ShaderVariable &y)
+bool Shader::compareVarying(const ShaderVariable &x, const ShaderVariable &y)
{
if (x.type == y.type)
{
@@ -511,7 +511,7 @@
int semanticIndex = 0;
for (unsigned int attributeIndex = 0; attributeIndex < mActiveAttributes.size(); attributeIndex++)
{
- const sh::ShaderVariable &attribute = mActiveAttributes[attributeIndex];
+ const ShaderVariable &attribute = mActiveAttributes[attributeIndex];
if (attribute.name == attributeName)
{
@@ -532,7 +532,7 @@
{
void *activeAttributes;
ShGetInfoPointer(mVertexCompiler, SH_ACTIVE_ATTRIBUTES_ARRAY, &activeAttributes);
- mActiveAttributes = *(std::vector<sh::Attribute>*)activeAttributes;
+ mActiveAttributes = *(std::vector<Attribute>*)activeAttributes;
}
}
@@ -563,7 +563,7 @@
{
void *activeOutputVariables;
ShGetInfoPointer(mFragmentCompiler, SH_ACTIVE_OUTPUT_VARIABLES_ARRAY, &activeOutputVariables);
- mActiveOutputVariables = *(std::vector<sh::Attribute>*)activeOutputVariables;
+ mActiveOutputVariables = *(std::vector<Attribute>*)activeOutputVariables;
}
}
@@ -574,7 +574,7 @@
mActiveOutputVariables.clear();
}
-const std::vector<sh::Attribute> &FragmentShader::getOutputVariables() const
+const std::vector<Attribute> &FragmentShader::getOutputVariables() const
{
return mActiveOutputVariables;
}