anv/gen8: Set multisample surface state
authorChad Versace <chad.versace@intel.com>
Tue, 26 Jan 2016 17:55:05 +0000 (09:55 -0800)
committerChad Versace <chad.versace@intel.com>
Thu, 28 Jan 2016 00:48:20 +0000 (16:48 -0800)
src/vulkan/gen8_state.c

index 2da9c62e15398e4ec88d837683c2889cb667b2ac..c749cbfed0c6992ad5d9ab388a174a62b7a70be8 100644 (file)
 
 #include "genX_state_util.h"
 
+static const uint32_t
+isl_to_gen_multisample_layout[] = {
+   [ISL_MSAA_LAYOUT_NONE]           = MSS,
+   [ISL_MSAA_LAYOUT_INTERLEAVED]    = DEPTH_STENCIL,
+   [ISL_MSAA_LAYOUT_ARRAY]          = MSS,
+};
+
 void
 genX(fill_buffer_surface_state)(void *state, enum isl_format format,
                                 uint32_t offset, uint32_t range, uint32_t stride)
@@ -225,7 +232,10 @@ genX(fill_image_surface_state)(struct anv_device *device, void *state_map,
       .SurfacePitch = surface->isl.row_pitch - 1,
       .RenderTargetViewExtent = 0, /* TEMPLATE */
       .MinimumArrayElement = 0, /* TEMPLATE */
-      .NumberofMultisamples = MULTISAMPLECOUNT_1,
+      .MultisampledSurfaceStorageFormat =
+         isl_to_gen_multisample_layout[surface->isl.msaa_layout],
+      .NumberofMultisamples = ffs(surface->isl.samples) - 1,
+      .MultisamplePositionPaletteIndex = 0, /* UNUSED */
       .XOffset = 0,
       .YOffset = 0,