r600g: rename r600_resource_texture::depth to bool is_depth
authorMarek Olšák <maraeo@gmail.com>
Fri, 24 Feb 2012 16:13:19 +0000 (17:13 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 27 Feb 2012 01:03:23 +0000 (02:03 +0100)
It's used as a boolean.

src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_blit.c
src/gallium/drivers/r600/r600_resource.h
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_texture.c

index 4eca42c22bee15221bcbd73c2713f2c8379abb50..7cf6038bf587036896692433370ce99b76ebdae4 100644 (file)
@@ -948,7 +948,7 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte
                format = 0;
        }
 
-       if (tmp->depth && !tmp->is_flushing_texture) {
+       if (tmp->is_depth && !tmp->is_flushing_texture) {
                r600_texture_depth_flush(ctx, texture, TRUE);
                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++) {
                if (&rctx->ps_samplers.views[i]->base != views[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;
                                r600_context_pipe_state_set_ps_resource(rctx, &resource[i]->state,
                                                                        i + R600_MAX_CONST_BUFFERS);
@@ -1091,7 +1091,7 @@ static void evergreen_set_ps_sampler_view(struct pipe_context *ctx, unsigned cou
                                views[i]);
                } else {
                        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;
                        }
                }
@@ -1269,10 +1269,10 @@ static void evergreen_cb(struct r600_context *rctx, struct r600_pipe_state *rsta
        surf = (struct r600_surface *)state->cbufs[cb];
        rtex = (struct r600_resource_texture*)state->cbufs[cb]->texture;
 
-       if (rtex->depth)
+       if (rtex->is_depth)
                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);
                rtex = rtex->flushed_depth_texture;
        }
index 2ec39e8c89acb1aa7a25597b4c33372403b41cb7..7913a1add9efbf97a587d2d542d0b26c65d3f748 100644 (file)
@@ -172,7 +172,7 @@ void r600_flush_depth_textures(struct r600_context *rctx)
                if (!view) continue;
 
                tex = (struct r600_resource_texture *)view->base.texture;
-               if (!tex->depth)
+               if (!tex->is_depth)
                        continue;
 
                if (tex->is_flushing_texture)
@@ -186,7 +186,7 @@ void r600_flush_depth_textures(struct r600_context *rctx)
                struct r600_resource_texture *tex;
                tex = (struct r600_resource_texture *)rctx->framebuffer.cbufs[i]->texture;
 
-               if (!tex->depth)
+               if (!tex->is_depth)
                        continue;
 
                if (tex->is_flushing_texture)
@@ -341,7 +341,7 @@ static void r600_resource_copy_region(struct pipe_context *ctx,
                return;
        }
 
-       if (rsrc->depth && !rsrc->is_flushing_texture)
+       if (rsrc->is_depth && !rsrc->is_flushing_texture)
                r600_texture_depth_flush(ctx, src, FALSE);
 
        restore_orig[0] = restore_orig[1] = FALSE;
index 8b90b12e9575a52324f808b6798b8c93f55e542e..a53ecb8d37d25755e588d490e6ee154dd2c26858 100644 (file)
@@ -55,7 +55,7 @@ struct r600_resource_texture {
        unsigned                        pitch_override;
        unsigned                        size;
        unsigned                        tile_type;
-       unsigned                        depth;
+       bool                            is_depth;
        unsigned                        dirty_db;
        struct r600_resource_texture    *stencil; /* Stencil is in a separate buffer on Evergreen. */
        struct r600_resource_texture    *flushed_depth_texture;
index b5fa45124c1a1152a71167eb4cba2d9683c96195..dee6dc19d688651892e0319592e3b6de88a0feed 100644 (file)
@@ -950,7 +950,7 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c
                format = 0;
        }
 
-       if (tmp->depth && !tmp->is_flushing_texture) {
+       if (tmp->is_depth && !tmp->is_flushing_texture) {
                r600_texture_depth_flush(ctx, texture, TRUE);
                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++) {
                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;
 
                        /* 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];
        rtex = (struct r600_resource_texture*)state->cbufs[cb]->texture;
 
-       if (rtex->depth)
+       if (rtex->is_depth)
                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;
        }
 
index 7d5f8c8609d1226246798128d7b4524e75ba3cdf..75cceb2db0a1ad239f3a8f81541dac0d174ef8e1 100644 (file)
@@ -576,7 +576,7 @@ r600_texture_create_object(struct pipe_screen *screen,
 
        /* 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))
-               rtex->depth = 1;
+               rtex->is_depth = true;
 
        r600_setup_miptree(screen, rtex, array_mode);
        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.usage = usage;
        trans->transfer.box = *box;
-       if (rtex->depth) {
+       if (rtex->is_depth) {
                /* XXX: only readback the rectangle which is being mapped?
                */
                /* 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);
        }
 
-       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)
                        r600_blit_push_depth(ctx, rtex);
        }