mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 07:18:17 +02:00
Cell: update surface map code to match recent changes in pipe_surface struct
This commit is contained in:
parent
2014e0bacb
commit
eff70f67c5
4 changed files with 18 additions and 15 deletions
|
|
@ -78,6 +78,8 @@ struct cell_context
|
|||
struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
|
||||
struct pipe_vertex_element vertex_element[PIPE_ATTRIB_MAX];
|
||||
|
||||
ubyte *cbuf_map[PIPE_MAX_COLOR_BUFS];
|
||||
ubyte *zbuf_map;
|
||||
|
||||
uint dirty;
|
||||
|
||||
|
|
|
|||
|
|
@ -168,8 +168,8 @@ test_spus(struct cell_context *cell)
|
|||
sleep(2);
|
||||
|
||||
for (i = 0; i < cell->num_spus; i++) {
|
||||
cell_global.command[i].fb.color_start = csurf->map;
|
||||
cell_global.command[i].fb.depth_start = zsurf ? zsurf->map : NULL;
|
||||
cell_global.command[i].fb.color_start = cell->cbuf_map[0];
|
||||
cell_global.command[i].fb.depth_start = cell->zbuf_map;
|
||||
cell_global.command[i].fb.width = csurf->width;
|
||||
cell_global.command[i].fb.height = csurf->height;
|
||||
cell_global.command[i].fb.color_format = PIPE_FORMAT_A8R8G8B8_UNORM;
|
||||
|
|
@ -186,7 +186,7 @@ test_spus(struct cell_context *cell)
|
|||
finish_all(cell->num_spus);
|
||||
|
||||
{
|
||||
uint *b = (uint*) csurf->map;
|
||||
uint *b = (uint*) cell->cbuf_map[0];
|
||||
printf("PPU: Clear results: 0x%x 0x%x 0x%x 0x%x\n",
|
||||
b[0], b[1000], b[2000], b[3000]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ cell_set_framebuffer_state(struct pipe_context *pipe,
|
|||
{
|
||||
struct cell_context *cell = cell_context(pipe);
|
||||
|
||||
/* XXX revisit this memcmp! */
|
||||
if (memcmp(&cell->framebuffer, fb, sizeof(*fb))) {
|
||||
struct pipe_surface *csurf = fb->cbufs[0];
|
||||
struct pipe_surface *zsurf = fb->zbuf;
|
||||
|
|
@ -48,26 +49,26 @@ cell_set_framebuffer_state(struct pipe_context *pipe,
|
|||
|
||||
/* unmap old surfaces */
|
||||
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
|
||||
if (cell->framebuffer.cbufs[i] &&
|
||||
cell->framebuffer.cbufs[i]->map) {
|
||||
if (cell->framebuffer.cbufs[i] && cell->cbuf_map[i]) {
|
||||
pipe_surface_unmap(cell->framebuffer.cbufs[i]);
|
||||
cell->cbuf_map[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (cell->framebuffer.zbuf &&
|
||||
cell->framebuffer.zbuf->map) {
|
||||
if (cell->framebuffer.zbuf && cell->zbuf_map) {
|
||||
pipe_surface_unmap(cell->framebuffer.zbuf);
|
||||
cell->zbuf_map = NULL;
|
||||
}
|
||||
|
||||
/* update my state */
|
||||
cell->framebuffer = *fb;
|
||||
|
||||
/* map new surfaces */
|
||||
if (csurf && !csurf->map)
|
||||
pipe_surface_map(csurf);
|
||||
if (csurf)
|
||||
cell->cbuf_map[0] = pipe_surface_map(csurf);
|
||||
|
||||
if (zsurf && !zsurf->map)
|
||||
pipe_surface_map(zsurf);
|
||||
if (zsurf)
|
||||
cell->zbuf_map = pipe_surface_map(zsurf);
|
||||
|
||||
#if 0
|
||||
for (i = 0; i < cell->num_spus; i++) {
|
||||
|
|
@ -87,9 +88,9 @@ cell_set_framebuffer_state(struct pipe_context *pipe,
|
|||
struct cell_command_framebuffer *fb
|
||||
= cell_batch_alloc(cell, sizeof(*fb));
|
||||
fb->opcode = CELL_CMD_FRAMEBUFFER;
|
||||
fb->color_start = csurf->map;
|
||||
fb->color_start = cell->cbuf_map[0];
|
||||
fb->color_format = csurf->format;
|
||||
fb->depth_start = zsurf ? zsurf->map : NULL;
|
||||
fb->depth_start = cell->zbuf_map;
|
||||
fb->depth_format = zsurf ? zsurf->format : PIPE_FORMAT_NONE;
|
||||
fb->width = csurf->width;
|
||||
fb->height = csurf->height;
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ cell_clear_surface(struct pipe_context *pipe, struct pipe_surface *ps,
|
|||
uint i;
|
||||
uint surfIndex;
|
||||
|
||||
if (!ps->map)
|
||||
pipe_surface_map(ps);
|
||||
if (!cell->cbuf_map[0])
|
||||
cell->cbuf_map[0] = pipe_surface_map(ps);
|
||||
|
||||
if (ps == cell->framebuffer.zbuf) {
|
||||
surfIndex = 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue