}
if (tmp->is_depth && !tmp->is_flushing_texture) {
- r600_init_flushed_depth_texture(ctx, texture, NULL);
- tmp = tmp->flushed_depth_texture;
- if (!tmp) {
+ if (!r600_init_flushed_depth_texture(ctx, texture, NULL)) {
FREE(view);
return NULL;
}
+ tmp = tmp->flushed_depth_texture;
}
endian = r600_colorformat_endian_swap(format);
return (struct r600_resource*)r;
}
-void r600_init_flushed_depth_texture(struct pipe_context *ctx,
+bool r600_init_flushed_depth_texture(struct pipe_context *ctx,
struct pipe_resource *texture,
struct r600_resource_texture **staging);
void r600_texture_depth_flush(struct pipe_context *ctx,
}
if (tmp->is_depth && !tmp->is_flushing_texture) {
- r600_init_flushed_depth_texture(ctx, texture, NULL);
- tmp = tmp->flushed_depth_texture;
- if (!tmp) {
+ if (!r600_init_flushed_depth_texture(ctx, texture, NULL)) {
FREE(view);
return NULL;
}
+ tmp = tmp->flushed_depth_texture;
}
endian = r600_colorformat_endian_swap(format);
stride, 0, buf, FALSE, &surface);
}
-void r600_init_flushed_depth_texture(struct pipe_context *ctx,
+bool r600_init_flushed_depth_texture(struct pipe_context *ctx,
struct pipe_resource *texture,
struct r600_resource_texture **staging)
{
staging : &rtex->flushed_depth_texture;
if (!staging && rtex->flushed_depth_texture)
- return; /* it's ready */
+ return true; /* it's ready */
resource.target = texture->target;
resource.format = texture->format;
*flushed_depth_texture = (struct r600_resource_texture *)ctx->screen->resource_create(ctx->screen, &resource);
if (*flushed_depth_texture == NULL) {
R600_ERR("failed to create temporary texture to hold flushed depth\n");
- return;
+ return false;
}
(*flushed_depth_texture)->is_flushing_texture = TRUE;
-
+ return true;
}
void r600_texture_depth_flush(struct pipe_context *ctx,
{
struct r600_resource_texture *rtex = (struct r600_resource_texture*)texture;
- r600_init_flushed_depth_texture(ctx, texture, staging);
+ if (!r600_init_flushed_depth_texture(ctx, texture, staging))
+ return;
if (staging) {
- if (!*staging)
- return; /* error */
-
r600_blit_uncompress_depth(ctx, rtex, *staging,
first_level, last_level,
first_layer, last_layer);
} else {
- if (!rtex->flushed_depth_texture)
- return; /* error */
-
r600_blit_uncompress_depth(ctx, rtex, NULL,
first_level, last_level,
first_layer, last_layer);