Exemple #1
0
void
draw_set_samplers(struct draw_context *draw,
                  unsigned shader_stage,
                  struct pipe_sampler_state **samplers,
                  unsigned num)
{
   unsigned i;

   debug_assert(shader_stage < PIPE_SHADER_TYPES);
   debug_assert(num <= PIPE_MAX_SAMPLERS);

   draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );

   for (i = 0; i < num; ++i)
      draw->samplers[shader_stage][i] = samplers[i];
   for (i = num; i < PIPE_MAX_SAMPLERS; ++i)
      draw->samplers[shader_stage][i] = NULL;

   draw->num_samplers[shader_stage] = num;

#ifdef HAVE_LLVM
   if (draw->llvm && shader_stage == PIPE_SHADER_VERTEX)
      draw_llvm_set_sampler_state(draw);
#endif
}
Exemple #2
0
void
draw_set_samplers(struct draw_context *draw,
                  struct pipe_sampler_state **samplers,
                  unsigned num)
{
   unsigned i;

   debug_assert(num <= PIPE_MAX_VERTEX_SAMPLERS);

   for (i = 0; i < num; ++i)
      draw->samplers[i] = samplers[i];
   for (i = num; i < PIPE_MAX_VERTEX_SAMPLERS; ++i)
      draw->samplers[i] = NULL;

   draw->num_samplers = num;

#ifdef HAVE_LLVM
   if (draw->llvm)
      draw_llvm_set_sampler_state(draw);
#endif
}