}
break;
default:
- printf("Cell: untwiddle unsupported texture format\n");
- ;
+ {
+ ct->untiled_data[level] = NULL;
+ printf("Cell: untwiddle unsupported texture format\n");
+ }
}
pipe_buffer_unmap(screen, surface->buffer);
struct cell_texture *ct = cell_texture((*s)->texture);
const uint level = (*s)->level;
- if ((*s)->usage & PIPE_BUFFER_USAGE_CPU_READ) {
+ if (((*s)->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level]))
+ {
align_free(ct->untiled_data[level]);
ct->untiled_data[level] = NULL;
}
return NULL;
else
{
- if (surface->usage & PIPE_BUFFER_USAGE_CPU_READ) {
+ if ((surface->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level])) {
return (void *) ((ubyte *) ct->untiled_data[level] + surface->offset);
}
else {