r600g: rename r600_resource_texture::depth to bool is_depth

It's used as a boolean.
This commit is contained in:
Marek Olšák 2012-02-24 17:13:19 +01:00
parent 04e3240087
commit d334d591a7
5 changed files with 16 additions and 16 deletions

View File

@ -948,7 +948,7 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte
format = 0; format = 0;
} }
if (tmp->depth && !tmp->is_flushing_texture) { if (tmp->is_depth && !tmp->is_flushing_texture) {
r600_texture_depth_flush(ctx, texture, TRUE); r600_texture_depth_flush(ctx, texture, TRUE);
tmp = tmp->flushed_depth_texture; tmp = tmp->flushed_depth_texture;
} }
@ -1078,7 +1078,7 @@ static void evergreen_set_ps_sampler_view(struct pipe_context *ctx, unsigned cou
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (&rctx->ps_samplers.views[i]->base != views[i]) { if (&rctx->ps_samplers.views[i]->base != views[i]) {
if (resource[i]) { if (resource[i]) {
if (((struct r600_resource_texture *)resource[i]->base.texture)->depth) if (((struct r600_resource_texture *)resource[i]->base.texture)->is_depth)
has_depth = 1; has_depth = 1;
r600_context_pipe_state_set_ps_resource(rctx, &resource[i]->state, r600_context_pipe_state_set_ps_resource(rctx, &resource[i]->state,
i + R600_MAX_CONST_BUFFERS); i + R600_MAX_CONST_BUFFERS);
@ -1091,7 +1091,7 @@ static void evergreen_set_ps_sampler_view(struct pipe_context *ctx, unsigned cou
views[i]); views[i]);
} else { } else {
if (resource[i]) { if (resource[i]) {
if (((struct r600_resource_texture *)resource[i]->base.texture)->depth) if (((struct r600_resource_texture *)resource[i]->base.texture)->is_depth)
has_depth = 1; has_depth = 1;
} }
} }
@ -1269,10 +1269,10 @@ static void evergreen_cb(struct r600_context *rctx, struct r600_pipe_state *rsta
surf = (struct r600_surface *)state->cbufs[cb]; surf = (struct r600_surface *)state->cbufs[cb];
rtex = (struct r600_resource_texture*)state->cbufs[cb]->texture; rtex = (struct r600_resource_texture*)state->cbufs[cb]->texture;
if (rtex->depth) if (rtex->is_depth)
rctx->have_depth_fb = TRUE; rctx->have_depth_fb = TRUE;
if (rtex->depth && !rtex->is_flushing_texture) { if (rtex->is_depth && !rtex->is_flushing_texture) {
r600_texture_depth_flush(&rctx->context, state->cbufs[cb]->texture, TRUE); r600_texture_depth_flush(&rctx->context, state->cbufs[cb]->texture, TRUE);
rtex = rtex->flushed_depth_texture; rtex = rtex->flushed_depth_texture;
} }

View File

@ -172,7 +172,7 @@ void r600_flush_depth_textures(struct r600_context *rctx)
if (!view) continue; if (!view) continue;
tex = (struct r600_resource_texture *)view->base.texture; tex = (struct r600_resource_texture *)view->base.texture;
if (!tex->depth) if (!tex->is_depth)
continue; continue;
if (tex->is_flushing_texture) if (tex->is_flushing_texture)
@ -186,7 +186,7 @@ void r600_flush_depth_textures(struct r600_context *rctx)
struct r600_resource_texture *tex; struct r600_resource_texture *tex;
tex = (struct r600_resource_texture *)rctx->framebuffer.cbufs[i]->texture; tex = (struct r600_resource_texture *)rctx->framebuffer.cbufs[i]->texture;
if (!tex->depth) if (!tex->is_depth)
continue; continue;
if (tex->is_flushing_texture) if (tex->is_flushing_texture)
@ -341,7 +341,7 @@ static void r600_resource_copy_region(struct pipe_context *ctx,
return; return;
} }
if (rsrc->depth && !rsrc->is_flushing_texture) if (rsrc->is_depth && !rsrc->is_flushing_texture)
r600_texture_depth_flush(ctx, src, FALSE); r600_texture_depth_flush(ctx, src, FALSE);
restore_orig[0] = restore_orig[1] = FALSE; restore_orig[0] = restore_orig[1] = FALSE;

View File

@ -55,7 +55,7 @@ struct r600_resource_texture {
unsigned pitch_override; unsigned pitch_override;
unsigned size; unsigned size;
unsigned tile_type; unsigned tile_type;
unsigned depth; bool is_depth;
unsigned dirty_db; unsigned dirty_db;
struct r600_resource_texture *stencil; /* Stencil is in a separate buffer on Evergreen. */ struct r600_resource_texture *stencil; /* Stencil is in a separate buffer on Evergreen. */
struct r600_resource_texture *flushed_depth_texture; struct r600_resource_texture *flushed_depth_texture;

View File

@ -950,7 +950,7 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c
format = 0; format = 0;
} }
if (tmp->depth && !tmp->is_flushing_texture) { if (tmp->is_depth && !tmp->is_flushing_texture) {
r600_texture_depth_flush(ctx, texture, TRUE); r600_texture_depth_flush(ctx, texture, TRUE);
tmp = tmp->flushed_depth_texture; tmp = tmp->flushed_depth_texture;
} }
@ -1077,7 +1077,7 @@ static void r600_set_sampler_views(struct r600_context *rctx,
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (rviews[i]) { if (rviews[i]) {
if (((struct r600_resource_texture *)rviews[i]->base.texture)->depth) if (((struct r600_resource_texture *)rviews[i]->base.texture)->is_depth)
rctx->have_depth_texture = true; rctx->have_depth_texture = true;
/* Changing from array to non-arrays textures and vice versa requires updating TEX_ARRAY_OVERRIDE. */ /* Changing from array to non-arrays textures and vice versa requires updating TEX_ARRAY_OVERRIDE. */
@ -1341,10 +1341,10 @@ static void r600_cb(struct r600_context *rctx, struct r600_pipe_state *rstate,
surf = (struct r600_surface *)state->cbufs[cb]; surf = (struct r600_surface *)state->cbufs[cb];
rtex = (struct r600_resource_texture*)state->cbufs[cb]->texture; rtex = (struct r600_resource_texture*)state->cbufs[cb]->texture;
if (rtex->depth) if (rtex->is_depth)
rctx->have_depth_fb = TRUE; rctx->have_depth_fb = TRUE;
if (rtex->depth && !rtex->is_flushing_texture) { if (rtex->is_depth && !rtex->is_flushing_texture) {
rtex = rtex->flushed_depth_texture; rtex = rtex->flushed_depth_texture;
} }

View File

@ -576,7 +576,7 @@ r600_texture_create_object(struct pipe_screen *screen,
/* only mark depth textures the HW can hit as depth textures */ /* only mark depth textures the HW can hit as depth textures */
if (util_format_is_depth_or_stencil(rtex->real_format) && permit_hardware_blit(screen, base)) if (util_format_is_depth_or_stencil(rtex->real_format) && permit_hardware_blit(screen, base))
rtex->depth = 1; rtex->is_depth = true;
r600_setup_miptree(screen, rtex, array_mode); r600_setup_miptree(screen, rtex, array_mode);
if (rscreen->use_surface) { if (rscreen->use_surface) {
@ -840,7 +840,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
trans->transfer.level = level; trans->transfer.level = level;
trans->transfer.usage = usage; trans->transfer.usage = usage;
trans->transfer.box = *box; trans->transfer.box = *box;
if (rtex->depth) { if (rtex->is_depth) {
/* XXX: only readback the rectangle which is being mapped? /* XXX: only readback the rectangle which is being mapped?
*/ */
/* XXX: when discard is true, no need to read back from depth texture /* XXX: when discard is true, no need to read back from depth texture
@ -915,7 +915,7 @@ void r600_texture_transfer_destroy(struct pipe_context *ctx,
pipe_resource_reference(&rtransfer->staging_texture, NULL); pipe_resource_reference(&rtransfer->staging_texture, NULL);
} }
if (rtex->depth && !rtex->is_flushing_texture) { if (rtex->is_depth && !rtex->is_flushing_texture) {
if ((transfer->usage & PIPE_TRANSFER_WRITE) && rtex->flushed_depth_texture) if ((transfer->usage & PIPE_TRANSFER_WRITE) && rtex->flushed_depth_texture)
r600_blit_push_depth(ctx, rtex); r600_blit_push_depth(ctx, rtex);
} }