broadcom/vc5: Fix cpp of MSAA surfaces on 4.x.
authorEric Anholt <eric@anholt.net>
Tue, 24 Apr 2018 21:56:23 +0000 (14:56 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 25 Apr 2018 16:21:54 +0000 (09:21 -0700)
The internal-type-bpp path is for surfaces that get stored in the raw TLB
format.  For 4.x, we're storing MSAA as just 2x width/height at the
original format.

src/gallium/drivers/vc5/vc5_resource.c
src/gallium/drivers/vc5/vc5_state.c

index eb5fa4e908d66a77cf3b6dddf6569532e842569b..3c2ed2707704254eb6187765a5fe1994d8b0ea90 100644 (file)
@@ -566,9 +566,11 @@ vc5_resource_setup(struct pipe_screen *pscreen,
         prsc->screen = pscreen;
 
         if (prsc->nr_samples <= 1 ||
+            screen->devinfo.ver >= 40 ||
             util_format_is_depth_or_stencil(prsc->format)) {
-                rsc->cpp = util_format_get_blocksize(prsc->format) *
-                        MAX2(prsc->nr_samples, 1);
+                rsc->cpp = util_format_get_blocksize(prsc->format);
+                if (screen->devinfo.ver < 40 && prsc->nr_samples > 1)
+                        rsc->cpp *= prsc->nr_samples;
         } else {
                 assert(vc5_rt_format_supported(&screen->devinfo, prsc->format));
                 uint32_t output_image_format =
index 350bd6a4ed3107144412f36924224a932c75be62..42ae64157c4a40ecccd357369df32495eeb424c7 100644 (file)
@@ -752,7 +752,7 @@ vc5_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc,
 #endif
                 tex.array_stride_64_byte_aligned = rsc->cube_map_stride / 64;
 
-                if (prsc->nr_samples > 1) {
+                if (prsc->nr_samples > 1 && V3D_VERSION < 40) {
                         /* Using texture views to reinterpret formats on our
                          * MSAA textures won't work, because we don't lay out
                          * the bits in memory as it's expected -- for example,