cell: clean-up, comments
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 11 Sep 2008 16:33:24 +0000 (10:33 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 11 Sep 2008 16:39:30 +0000 (10:39 -0600)
src/gallium/drivers/cell/spu/spu_main.c

index 29686964d2f3a3ea08dced446b21b7576348678f..2a7cb75f5925ce372d1c9b75d11ec644a5a5784b 100644 (file)
@@ -429,16 +429,14 @@ cmd_batch(uint opcode)
       printf("SPU %u: release batch buf %u\n", spu.init.id, buf);
    release_buffer(buf);
 
+   /*
+    * Loop over commands in the batch buffer
+    */
    for (pos = 0; pos < usize; /* no incr */) {
       switch (buffer[pos]) {
-      case CELL_CMD_STATE_FRAMEBUFFER:
-         {
-            struct cell_command_framebuffer *fb
-               = (struct cell_command_framebuffer *) &buffer[pos];
-            cmd_state_framebuffer(fb);
-            pos += sizeof(*fb) / 8;
-         }
-         break;
+      /*
+       * rendering commands
+       */
       case CELL_CMD_CLEAR_SURFACE:
          {
             struct cell_command_clear_surface *clr
@@ -456,6 +454,17 @@ cmd_batch(uint opcode)
             pos += pos_incr;
          }
          break;
+      /*
+       * state-update commands
+       */
+      case CELL_CMD_STATE_FRAMEBUFFER:
+         {
+            struct cell_command_framebuffer *fb
+               = (struct cell_command_framebuffer *) &buffer[pos];
+            cmd_state_framebuffer(fb);
+            pos += sizeof(*fb) / 8;
+         }
+         break;
       case CELL_CMD_STATE_FRAGMENT_OPS:
          {
             struct cell_command_fragment_ops *fops
@@ -464,18 +473,6 @@ cmd_batch(uint opcode)
             pos += sizeof(*fops) / 8;
          }
          break;
-      case CELL_CMD_RELEASE_VERTS:
-         {
-            struct cell_command_release_verts *release
-               = (struct cell_command_release_verts *) &buffer[pos];
-            cmd_release_verts(release);
-            pos += sizeof(*release) / 8;
-         }
-         break;
-      case CELL_CMD_FINISH:
-         cmd_finish();
-         pos += 1;
-         break;
       case CELL_CMD_STATE_SAMPLER:
          {
             struct cell_command_sampler *sampler
@@ -521,6 +518,21 @@ cmd_batch(uint opcode)
                                 &buffer[pos+1]);
          pos += (1 + ROUNDUP8(sizeof(struct cell_attribute_fetch_code)) / 8);
          break;
+      /*
+       * misc commands
+       */
+      case CELL_CMD_FINISH:
+         cmd_finish();
+         pos += 1;
+         break;
+      case CELL_CMD_RELEASE_VERTS:
+         {
+            struct cell_command_release_verts *release
+               = (struct cell_command_release_verts *) &buffer[pos];
+            cmd_release_verts(release);
+            pos += sizeof(*release) / 8;
+         }
+         break;
       case CELL_CMD_FLUSH_BUFFER_RANGE: {
         struct cell_buffer_range *br = (struct cell_buffer_range *)
             &buffer[pos+1];