Squashed commit of the following:
[mesa.git] / src / gallium / drivers / cell / ppu / cell_state_emit.c
index ac5fafec1ad0be45620abdada0c2e73f62b831f1..bb11c68fa2467f0c9f42431378ff4a825fd05e55 100644 (file)
  * 
  **************************************************************************/
 
-#include "pipe/p_inlines.h"
+#include "util/u_inlines.h"
 #include "util/u_memory.h"
 #include "util/u_math.h"
+#include "util/u_format.h"
 #include "cell_context.h"
 #include "cell_gen_fragment.h"
 #include "cell_state.h"
@@ -207,8 +208,8 @@ cell_emit_state(struct cell_context *cell)
       fb->width = cell->framebuffer.width;
       fb->height = cell->framebuffer.height;
 #if 0
-      printf("EMIT color format %s\n", pf_name(fb->color_format));
-      printf("EMIT depth format %s\n", pf_name(fb->depth_format));
+      printf("EMIT color format %s\n", util_format_name(fb->color_format));
+      printf("EMIT depth format %s\n", util_format_name(fb->depth_format));
 #endif
    }
 
@@ -240,20 +241,17 @@ cell_emit_state(struct cell_context *cell)
 
    if (cell->dirty & (CELL_NEW_FS_CONSTANTS)) {
       const uint shader = PIPE_SHADER_FRAGMENT;
-      const uint num_const = cell->constants[shader].buffer->size / sizeof(float);
+      const uint num_const = cell->constants[shader]->width0 / sizeof(float);
       uint i, j;
       float *buf = cell_batch_alloc16(cell, ROUNDUP16(32 + num_const * sizeof(float)));
       uint32_t *ibuf = (uint32_t *) buf;
-      const float *constants = pipe_buffer_map(cell->pipe.screen,
-                                               cell->constants[shader].buffer,
-                                               PIPE_BUFFER_USAGE_CPU_READ);
+      const float *constants = cell->mapped_constants[shader];
       ibuf[0] = CELL_CMD_STATE_FS_CONSTANTS;
       ibuf[4] = num_const;
       j = 8;
       for (i = 0; i < num_const; i++) {
          buf[j++] = constants[i];
       }
-      pipe_buffer_unmap(cell->pipe.screen, cell->constants[shader].buffer);
    }
 
    if (cell->dirty & (CELL_NEW_FRAMEBUFFER |
@@ -295,7 +293,7 @@ cell_emit_state(struct cell_context *cell)
             texture->opcode[0] = CELL_CMD_STATE_TEXTURE;
             texture->unit = i;
             if (cell->texture[i]) {
-               struct cell_texture *ct = cell->texture[i];
+               struct cell_resource *ct = cell->texture[i];
                uint level;
                for (level = 0; level < CELL_MAX_TEXTURE_LEVELS; level++) {
                   texture->start[level] = (ct->mapped +
@@ -331,7 +329,7 @@ cell_emit_state(struct cell_context *cell)
       const struct draw_context *const draw = cell->draw;
       struct cell_shader_info info;
 
-      info.num_outputs = draw_num_vs_outputs(draw);
+      info.num_outputs = draw_num_shader_outputs(draw);
       info.declarations = (uintptr_t) draw->vs.machine.Declarations;
       info.num_declarations = draw->vs.machine.NumDeclarations;
       info.instructions = (uintptr_t) draw->vs.machine.Instructions;