示例#1
0
boolean
svga_shader_emit_samplers_decl( struct svga_shader_emitter *emit )
{
   unsigned i;

   for (i = 0; i < emit->num_samplers; i++) {
      if (!ps30_sampler(emit, i))
         return FALSE;
   }
   return TRUE;
}
示例#2
0
boolean
svga_translate_decl_sm30( struct svga_shader_emitter *emit,
                          const struct tgsi_full_declaration *decl )
{
   unsigned first = decl->Range.First;
   unsigned last = decl->Range.Last;
   unsigned idx;

   for( idx = first; idx <= last; idx++ ) {
      boolean ok;

      switch (decl->Declaration.File) {
      case TGSI_FILE_SAMPLER:
         assert (emit->unit == PIPE_SHADER_FRAGMENT);
         ok = ps30_sampler( emit, decl->Semantic, idx );
         break;

      case TGSI_FILE_INPUT:
         if (emit->unit == PIPE_SHADER_VERTEX)
            ok = vs30_input( emit, decl->Semantic, idx );
         else
            ok = ps30_input( emit, decl->Semantic, idx );
         break;

      case TGSI_FILE_OUTPUT:
         if (emit->unit == PIPE_SHADER_VERTEX)
            ok = vs30_output( emit, decl->Semantic, idx );
         else
            ok = ps30_output( emit, decl->Semantic, idx );
         break;

      default:
         /* don't need to declare other vars */
         ok = TRUE;
      }

      if (!ok)
         return FALSE;
   }

   return TRUE;
}