Example #1
0
 bool UniformGenerator::bufferAllowed( const dp::fx::ParameterGroupSpecSharedPtr& spec )
 {
   bool blockBuffer = false;
   for ( ParameterGroupSpec::iterator it = spec->beginParameterSpecs(); !blockBuffer && it != spec->endParameterSpecs(); ++it )
   {
     unsigned int parameterType = it->first.getType();
     blockBuffer |= !!(parameterType & PT_SAMPLER_TYPE_MASK);
     blockBuffer |= !!(parameterType & PT_BUFFER_PTR);
   }
   return !blockBuffer;
 }
 std::string UniformGeneratorGLSLStandard::generateUniforms( const dp::fx::ParameterGroupSpecSharedPtr& spec )
 {
   std::ostringstream oss;
   oss << "// ParameterGroup: " << spec->getName() << "\n";
   for ( ParameterGroupSpec::iterator it = spec->beginParameterSpecs(); it != spec->endParameterSpecs(); ++it )
   {
     oss << "uniform " << getGLSLTypename( it->first ) << " " << it->first.getName();
     if ( it->first.getArraySize() )
     {
       oss << "[" << it->first.getArraySize() << "]";
     }
     oss << ";\n";
   }
   oss << "\n";
   return( oss.str() );
 }