示例#1
0
/*
 * If the function encouters any errors it will return the
 * last one. Done to always try to set as many samplers
 * as possible.
 */
enum pipe_error
cso_set_samplers(struct cso_context *ctx,
                 unsigned shader_stage,
                 unsigned nr,
                 const struct pipe_sampler_state **templates)
{
   struct sampler_info *info = &ctx->samplers[shader_stage];
   unsigned i;
   enum pipe_error temp, error = PIPE_OK;

   /* TODO: fastpath
    */

   for (i = 0; i < nr; i++) {
      temp = single_sampler(ctx, info, i, templates[i]);
      if (temp != PIPE_OK)
         error = temp;
   }

   for ( ; i < info->nr_samplers; i++) {
      temp = single_sampler(ctx, info, i, NULL);
      if (temp != PIPE_OK)
         error = temp;
   }

   single_sampler_done(ctx, shader_stage);

   return error;
}
示例#2
0
文件: cso_context.c 项目: UIKit0/mesa
static void
restore_samplers(struct cso_context *ctx, struct sampler_info *info)
{
   info->nr_samplers = info->nr_samplers_saved;
   memcpy(info->samplers, info->samplers_saved, sizeof(info->samplers));
   single_sampler_done(ctx, info);
}
示例#3
0
void
cso_restore_samplers(struct cso_context *ctx, unsigned shader_stage)
{
   struct sampler_info *info = &ctx->samplers[shader_stage];
   info->nr_samplers = info->nr_samplers_saved;
   memcpy(info->samplers, info->samplers_saved, sizeof(info->samplers));
   single_sampler_done(ctx, shader_stage);
}
示例#4
0
void
cso_single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
{
   single_sampler_done(ctx, shader_stage);
}
示例#5
0
文件: cso_context.c 项目: UIKit0/mesa
void
cso_single_vertex_sampler_done(struct cso_context *ctx)
{
   single_sampler_done(ctx, &ctx->vertex_samplers);
}
示例#6
0
文件: cso_context.c 项目: UIKit0/mesa
void
cso_single_sampler_done( struct cso_context *ctx )
{
   single_sampler_done(ctx, &ctx->fragment_samplers);
}