ac: add has_msaa_sample_loc_bug to ac_gpu_info
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 23 Aug 2019 06:50:06 +0000 (08:50 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 27 Aug 2019 06:04:44 +0000 (08:04 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_gpu_info.c
src/amd/common/ac_gpu_info.h
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state.c

index 49ad93407ec68dd164c009ef06d7bbca9582c230..b366dc6be19fb04ffa7bdf42fe7a3e8048de7c4f 100644 (file)
@@ -483,6 +483,11 @@ bool ac_query_gpu_info(int fd, void *dev_p,
        info->has_tc_compat_zrange_bug = info->chip_class >= GFX8 &&
                                         info->chip_class <= GFX9;
 
+       info->has_msaa_sample_loc_bug = (info->family >= CHIP_POLARIS10 &&
+                                        info->family <= CHIP_POLARIS12) ||
+                                       info->family == CHIP_VEGA10 ||
+                                       info->family == CHIP_RAVEN;
+
        /* Get the number of good compute units. */
        info->num_good_compute_units = 0;
        for (i = 0; i < info->max_se; i++)
index f676600e5b98ba1f4658bfc28065f4020eb18824..ba09f38edb872e7161926da8b37f1eacaef5c374 100644 (file)
@@ -161,6 +161,7 @@ struct radeon_info {
        /* Hardware bugs. */
        bool                        has_gfx9_scissor_bug;
        bool                        has_tc_compat_zrange_bug;
+       bool                        has_msaa_sample_loc_bug;
 };
 
 bool ac_query_gpu_info(int fd, void *dev_p,
index abb182369560796c290327f0f61e64f7c2ea794c..d3dcab3cccea4f9ea675a110e101fae1c005cb97 100644 (file)
@@ -1135,10 +1135,6 @@ radeonsi_screen_create_impl(struct radeon_winsys *ws,
 #include "si_debug_options.h"
        }
 
-       sscreen->has_msaa_sample_loc_bug = (sscreen->info.family >= CHIP_POLARIS10 &&
-                                           sscreen->info.family <= CHIP_POLARIS12) ||
-                                          sscreen->info.family == CHIP_VEGA10 ||
-                                          sscreen->info.family == CHIP_RAVEN;
        sscreen->has_ls_vgpr_init_bug = sscreen->info.family == CHIP_VEGA10 ||
                                        sscreen->info.family == CHIP_RAVEN;
        sscreen->use_ngg = sscreen->info.chip_class >= GFX10;
index 6e69f1717f6ad6cbcf8f110e2fbe0201dfd31ffe..2d0b83fcf333d923b818e8f44cfa561a932d25d9 100644 (file)
@@ -495,7 +495,6 @@ struct si_screen {
        bool                            has_out_of_order_rast;
        bool                            assume_no_z_fights;
        bool                            commutative_blend_add;
-       bool                            has_msaa_sample_loc_bug;
        bool                            has_ls_vgpr_init_bug;
        bool                            dpbb_allowed;
        bool                            dfsm_allowed;
index d957e76c26d2e7a79ffdbf3ab8fbef83bc7176ff..566954b1887d5b4700f2002f69c09faf0f3c3668 100644 (file)
@@ -1034,7 +1034,7 @@ static void si_bind_rs_state(struct pipe_context *ctx, void *state)
                si_mark_atom_dirty(sctx, &sctx->atoms.s.db_render_state);
 
                /* Update the small primitive filter workaround if necessary. */
-               if (sctx->screen->has_msaa_sample_loc_bug &&
+               if (sctx->screen->info.has_msaa_sample_loc_bug &&
                    sctx->framebuffer.nr_samples > 1)
                        si_mark_atom_dirty(sctx, &sctx->atoms.s.msaa_sample_locs);
        }
@@ -3466,7 +3466,7 @@ static void si_emit_msaa_sample_locs(struct si_context *sctx)
        struct radeon_cmdbuf *cs = sctx->gfx_cs;
        struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
        unsigned nr_samples = sctx->framebuffer.nr_samples;
-       bool has_msaa_sample_loc_bug = sctx->screen->has_msaa_sample_loc_bug;
+       bool has_msaa_sample_loc_bug = sctx->screen->info.has_msaa_sample_loc_bug;
 
        /* Smoothing (only possible with nr_samples == 1) uses the same
         * sample locations as the MSAA it simulates.