diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index fc7996af580..f17b9e3ee33 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -53,6 +53,14 @@ radeon_winsys(struct pipe_screen *screen) { return r300_screen(screen)->rws; } +static inline unsigned +r300_hyperz_pipe_count(const struct r300_screen *screen) +{ + if (screen->caps.family == CHIP_RV530) + return screen->info.r300_num_z_pipes; + return screen->info.r300_num_gb_pipes; +} + /* Debug functionality. */ /** diff --git a/src/gallium/drivers/r300/r300_texture_desc.c b/src/gallium/drivers/r300/r300_texture_desc.c index 58b3f8a0f99..bec95837950 100644 --- a/src/gallium/drivers/r300/r300_texture_desc.c +++ b/src/gallium/drivers/r300/r300_texture_desc.c @@ -366,11 +366,7 @@ static void r300_setup_hyperz_properties(struct r300_screen *screen, tex->tex.microtile) { unsigned i, pipes; - if (screen->caps.family == CHIP_RV530) { - pipes = screen->info.r300_num_z_pipes; - } else { - pipes = screen->info.r300_num_gb_pipes; - } + pipes = r300_hyperz_pipe_count(screen); for (i = 0; i <= tex->b.last_level; i++) { unsigned zcomp_numdw, zcompsize, hiz_numdw, stride, height;