示例#1
0
void
softpipe_reset_sampler_varients(struct softpipe_context *softpipe)
{
   int i;

   /* It's a bit hard to build these samplers ahead of time -- don't
    * really know which samplers are going to be used for vertex and
    * fragment programs.
    */
   for (i = 0; i <= softpipe->vs->max_sampler; i++) {
      if (softpipe->vertex_samplers[i]) {
         softpipe->tgsi.vert_samplers_list[i] = 
            get_sampler_varient( i,
                                sp_sampler(softpipe->vertex_samplers[i]),
                                softpipe->vertex_textures[i],
                                 TGSI_PROCESSOR_VERTEX );

         sp_sampler_varient_bind_texture( softpipe->tgsi.vert_samplers_list[i], 
                                         softpipe->vertex_tex_cache[i],
                                         softpipe->vertex_textures[i] );
      }
   }

   for (i = 0; i <= softpipe->fs->info.file_max[TGSI_FILE_SAMPLER]; i++) {
      if (softpipe->sampler[i]) {
         softpipe->tgsi.frag_samplers_list[i] =
            get_sampler_varient( i,
                                 sp_sampler(softpipe->sampler[i]),
                                 softpipe->texture[i],
                                 TGSI_PROCESSOR_FRAGMENT );

         sp_sampler_varient_bind_texture( softpipe->tgsi.frag_samplers_list[i], 
                                          softpipe->tex_cache[i],
                                          softpipe->texture[i] );
      }
   }
}
示例#2
0
/**
 * Reset the sampler variants for a shader stage (vert, frag, geom).
 */
static void
reset_sampler_variants(struct softpipe_context *softpipe,
                       unsigned shader,
                       unsigned tgsi_shader,
                       int max_sampler)
{
    int i;

    for (i = 0; i <= max_sampler; i++) {
        if (softpipe->samplers[shader][i]) {
            softpipe->tgsi.sampler[shader]->sp_sampler[i] =
                get_sampler_variant(i,
                                    sp_sampler(softpipe->samplers[shader][i]),
                                    softpipe->sampler_views[shader][i],
                                    tgsi_shader);

            sp_sampler_variant_bind_view(softpipe->tgsi.sampler[shader]->sp_sampler[i],
                                         softpipe->tex_cache[shader][i],
                                         softpipe->sampler_views[shader][i]);
        }
    }
}