r600g: move around variables to share depth uncompression code
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
This commit is contained in:
parent
16baa465a2
commit
4ca1a92b7f
|
@ -180,10 +180,8 @@ void r600_init_blit_functions(struct r600_context *rctx)
|
|||
int r600_blit_uncompress_depth(struct pipe_context *ctx, struct r600_resource_texture *texture)
|
||||
{
|
||||
struct r600_context *rctx = r600_context(ctx);
|
||||
struct r600_screen *rscreen = rctx->screen;
|
||||
struct pipe_framebuffer_state *fb = &rctx->framebuffer->state.framebuffer;
|
||||
struct pipe_framebuffer_state *fb = rctx->pframebuffer;
|
||||
struct pipe_surface *zsurf, *cbsurf;
|
||||
enum radeon_family family;
|
||||
int level = 0;
|
||||
float depth = 1.0f;
|
||||
|
||||
|
@ -196,11 +194,10 @@ int r600_blit_uncompress_depth(struct pipe_context *ctx, struct r600_resource_te
|
|||
r600_blitter_save_states(ctx);
|
||||
util_blitter_save_framebuffer(rctx->blitter, fb);
|
||||
|
||||
family = radeon_get_family(rscreen->rw);
|
||||
if (family == CHIP_RV610 || family == CHIP_RV630 || family == CHIP_RV620 ||
|
||||
family == CHIP_RV635)
|
||||
if (rctx->family == CHIP_RV610 || rctx->family == CHIP_RV630 ||
|
||||
rctx->family == CHIP_RV620 || rctx->family == CHIP_RV635)
|
||||
depth = 0.0f;
|
||||
|
||||
|
||||
util_blitter_custom_depth_stencil(rctx->blitter, zsurf, cbsurf, rctx->custom_dsa_flush, depth);
|
||||
|
||||
/* resume queries */
|
||||
|
|
|
@ -198,10 +198,14 @@ extern struct r600_context_hw_state_vtbl eg_hw_state_vtbl;
|
|||
|
||||
struct r600_context {
|
||||
struct pipe_context context;
|
||||
struct blitter_context *blitter;
|
||||
struct pipe_framebuffer_state *pframebuffer;
|
||||
unsigned family;
|
||||
void *custom_dsa_flush;
|
||||
struct list_head query_list;
|
||||
struct r600_screen *screen;
|
||||
struct radeon *rw;
|
||||
struct radeon_ctx *ctx;
|
||||
struct blitter_context *blitter;
|
||||
struct radeon_draw draw;
|
||||
struct r600_context_hw_state_vtbl *vtbl;
|
||||
struct radeon_state config;
|
||||
|
@ -238,14 +242,11 @@ struct r600_context {
|
|||
struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
|
||||
struct pipe_index_buffer index_buffer;
|
||||
struct pipe_blend_color blend_color;
|
||||
struct list_head query_list;
|
||||
|
||||
/* upload managers */
|
||||
struct u_upload_mgr *upload_vb;
|
||||
struct u_upload_mgr *upload_ib;
|
||||
bool any_user_vbs;
|
||||
|
||||
void *custom_dsa_flush;
|
||||
};
|
||||
|
||||
/* Convenience cast wrapper. */
|
||||
|
|
|
@ -389,7 +389,7 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx,
|
|||
}
|
||||
clean_flush(rctx, &rctx->hw_states.cb_flush);
|
||||
clean_flush(rctx, &rctx->hw_states.db_flush);
|
||||
|
||||
rctx->pframebuffer = NULL;
|
||||
r600_context_state_decref(rctx->framebuffer);
|
||||
|
||||
rstate = r600_new_context_state(pipe_framebuffer_type);
|
||||
|
@ -399,6 +399,7 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx,
|
|||
}
|
||||
pipe_reference(NULL, &state->zsbuf->reference);
|
||||
rctx->framebuffer = rstate;
|
||||
rctx->pframebuffer = &rstate->state.framebuffer;
|
||||
for (i = 0; i < state->nr_cbufs; i++) {
|
||||
rctx->vtbl->cb(rctx, &rstate->rstate[i+1], state, i);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue