Example #1
0
static void gs_flush(struct draw_geometry_shader *shader,
                     unsigned input_primitives)
{
   unsigned out_prim_count;
   struct tgsi_exec_machine *machine = shader->machine;

   debug_assert(input_primitives > 0 &&
                input_primitives < 4);

   tgsi_set_exec_mask(machine,
                      1,
                      input_primitives > 1,
                      input_primitives > 2,
                      input_primitives > 3);

   /* run interpreter */
   tgsi_exec_machine_run(machine);

   out_prim_count =
      machine->Temps[TGSI_EXEC_TEMP_PRIMITIVE_I].xyzw[TGSI_EXEC_TEMP_PRIMITIVE_C].u[0];

#if 0
   debug_printf("PRIM emitted prims = %d (verts=%d), cur prim count = %d\n",
                shader->emitted_primitives, shader->emitted_vertices,
                out_prim_count);
#endif
   draw_geometry_fetch_outputs(shader, out_prim_count,
                               &shader->tmp_output);
}
Example #2
0
File: draw_gs.c Project: notaz/mesa
static unsigned tgsi_gs_run(struct draw_geometry_shader *shader,
                            unsigned input_primitives)
{
   struct tgsi_exec_machine *machine = shader->machine;

   /* run interpreter */
   tgsi_exec_machine_run(machine);

   return
      machine->Temps[TGSI_EXEC_TEMP_PRIMITIVE_I].xyzw[TGSI_EXEC_TEMP_PRIMITIVE_C].u[0];
}
Example #3
0
static bool
cs_run(const struct sp_compute_shader *cs,
       int g_w, int g_h, int g_d,
       struct tgsi_exec_machine *machine, bool restart)
{
   if (!restart) {
      if (machine->SysSemanticToIndex[TGSI_SEMANTIC_BLOCK_ID] != -1) {
         unsigned i = machine->SysSemanticToIndex[TGSI_SEMANTIC_BLOCK_ID];
         int j;
         for (j = 0; j < TGSI_QUAD_SIZE; j++) {
            machine->SystemValue[i].xyzw[0].i[j] = g_w;
            machine->SystemValue[i].xyzw[1].i[j] = g_h;
            machine->SystemValue[i].xyzw[2].i[j] = g_d;
         }
      }
      machine->NonHelperMask = (1 << 1) - 1;
   }

   tgsi_exec_machine_run(machine, restart ? machine->pc : 0);

   if (machine->pc != -1)
      return true;
   return false;
}