radeonsi: enable distributed tess on multi-SE parts only
authorMarek Olšák <marek.olsak@amd.com>
Tue, 28 Jun 2016 12:19:04 +0000 (14:19 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 29 Jun 2016 14:34:22 +0000 (16:34 +0200)
ported from Vulkan

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state_draw.c
src/gallium/drivers/radeonsi/si_state_shaders.c

index f38ecc15ab4d65820d328a514106e5f0f71fdbc6..633d4bb7a5292ed9b695e75938a4456d6903f8be 100644 (file)
@@ -712,6 +712,10 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws)
        sscreen->tess_offchip_block_dw_size =
                sscreen->b.family == CHIP_HAWAII ? 4096 : 8192;
 
+       sscreen->has_distributed_tess =
+               sscreen->b.chip_class >= VI &&
+               sscreen->b.info.max_se >= 2;
+
        sscreen->b.has_cp_dma = true;
        sscreen->b.has_streamout = true;
        pipe_mutex_init(sscreen->shader_parts_mutex);
index ee64ecc6fd11a7fc0e89947d5b36b2dbf111f6da..3aff0ac8c056186beb83fca71ef74d428ac3e17f 100644 (file)
@@ -83,6 +83,7 @@ struct si_screen {
        struct r600_common_screen       b;
        unsigned                        gs_table_depth;
        unsigned                        tess_offchip_block_dw_size;
+       bool                            has_distributed_tess;
 
        /* Whether shaders are monolithic (1-part) or separate (3-part). */
        bool                            use_monolithic_shaders;
index 35585107cd3809832060008ace66471e68c36056..ce8def4665964ba051ede7ac6bab66da89f6afa0 100644 (file)
@@ -274,7 +274,7 @@ static unsigned si_get_ia_multi_vgt_param(struct si_context *sctx,
                        partial_vs_wave = true;
 
                /* Needed for 028B6C_DISTRIBUTION_MODE != 0 */
-               if (sctx->b.chip_class >= VI) {
+               if (sctx->screen->has_distributed_tess) {
                        if (sctx->gs_shader.cso)
                                partial_es_wave = true;
                        else
index 9aa4a7c82334b3a30021dba6480e67277e8a644c..4bcdeb6a27109d9de1fffe45f83dc237c79e2ef0 100644 (file)
@@ -300,7 +300,7 @@ static void si_set_tesseval_regs(struct si_screen *sscreen,
        else
                topology = V_028B6C_OUTPUT_TRIANGLE_CW;
 
-       if (sscreen->b.chip_class >= VI) {
+       if (sscreen->has_distributed_tess) {
                if (sscreen->b.family == CHIP_FIJI ||
                    sscreen->b.family >= CHIP_POLARIS10)
                        distribution_mode = V_028B6C_DISTRIBUTION_MODE_TRAPEZOIDS;