Add a new path for querying active attributes from the shader translator, for use with layout qualifier support.
TRAC #23269
Signed-off-by: Geoff Lang
Signed-off-by: Nicolas Capens
Author: Jamie Madill
diff --git a/src/compiler/OutputHLSL.cpp b/src/compiler/OutputHLSL.cpp
index b36d456..d117a30 100644
--- a/src/compiler/OutputHLSL.cpp
+++ b/src/compiler/OutputHLSL.cpp
@@ -161,6 +161,11 @@
return mActiveOutputVariables;
}
+const ActiveShaderVariables &OutputHLSL::getAttributes() const
+{
+ return mActiveAttributes;
+}
+
int OutputHLSL::vectorSize(const TType &type) const
{
int elementSize = type.isMatrix() ? type.getCols() : 1;
@@ -389,6 +394,10 @@
const TString &name = attribute->second->getSymbol();
attributes += "static " + typeString(type) + " " + decorate(name) + arrayString(type) + " = " + initializer(type) + ";\n";
+
+ ShaderVariable shaderVar(glVariableType(type), glVariablePrecision(type), name.c_str(),
+ (unsigned int)type.getArraySize(), type.getLayoutQualifier().location);
+ mActiveAttributes.push_back(shaderVar);
}
if (shaderType == SH_FRAGMENT_SHADER)