*
* @return true if verification is positive, false otherwise
**/
-bool checkVarying(Program& program, const Variable& variable, std::stringstream& stream, bool is_input)
+bool checkVarying(Program& program, Shader::STAGES stage, const Variable& variable, std::stringstream& stream, bool is_input)
{
bool result = true;
Utils::Interface* interface = variable.m_descriptor.m_interface;
const size_t n_members = interface->m_members.size();
std::string structVariable = variable.m_descriptor.m_name;
+
+ switch (Variable::GetFlavour(stage, is_input ? Variable::INPUT : Variable::OUTPUT))
+ {
+ case Variable::ARRAY:
+ case Variable::INDEXED_BY_INVOCATION_ID:
+ structVariable.append("[0]");
+ break;
+ default:
+ break;
+ }
+
// If struct variable is an array
if (0 != variable.m_descriptor.m_n_array_elements)
{
for (const_iterator it = inputs.begin(); it != inputs.end(); ++it)
{
- if (false == checkVarying(program, **it, stream, true))
+ if (false == checkVarying(program, stage, **it, stream, true))
{
result = false;
}
for (const_iterator it = outputs.begin(); it != outputs.end(); ++it)
{
- if (false == checkVarying(program, **it, stream, false))
+ if (false == checkVarying(program, stage, **it, stream, false))
{
result = false;
}