extern "C" {
#endif
+enum intel_msaa_layout;
+
extern const struct brw_tracked_state brw_blend_constant_color;
extern const struct brw_tracked_state brw_cc_vp;
extern const struct brw_tracked_state brw_cc_unit;
/* gen7_wm_surface_state.c */
void gen7_set_surface_tiling(struct gen7_surface_state *surf, uint32_t tiling);
-void gen7_set_surface_num_multisamples(struct gen7_surface_state *surf,
- unsigned num_samples);
+void gen7_set_surface_msaa(struct gen7_surface_state *surf,
+ unsigned num_samples,
+ enum intel_msaa_layout layout);
void gen7_set_surface_mcs_info(struct brw_context *brw,
struct gen7_surface_state *surf,
uint32_t surf_offset,
pitch_bytes *= 2;
surf->ss3.pitch = pitch_bytes - 1;
- gen7_set_surface_num_multisamples(surf, surface->num_samples);
+ gen7_set_surface_msaa(surf, surface->num_samples, surface->msaa_layout);
if (surface->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {
gen7_set_surface_mcs_info(brw, surf, wm_surf_offset,
surface->mt->mcs_mt, is_render_target);
void
-gen7_set_surface_num_multisamples(struct gen7_surface_state *surf,
- unsigned num_samples)
+gen7_set_surface_msaa(struct gen7_surface_state *surf, unsigned num_samples,
+ enum intel_msaa_layout layout)
{
if (num_samples > 4)
surf->ss4.num_multisamples = GEN7_SURFACE_MULTISAMPLECOUNT_8;
surf->ss4.num_multisamples = GEN7_SURFACE_MULTISAMPLECOUNT_4;
else
surf->ss4.num_multisamples = GEN7_SURFACE_MULTISAMPLECOUNT_1;
+
+ surf->ss4.multisampled_surface_storage_format =
+ layout == INTEL_MSAA_LAYOUT_IMS ?
+ GEN7_SURFACE_MSFMT_DEPTH_STENCIL :
+ GEN7_SURFACE_MSFMT_MSS;
}
gen7_set_surface_tiling(surf, region->tiling);
surf->ss3.pitch = (region->pitch * region->cpp) - 1;
- gen7_set_surface_num_multisamples(surf, irb->mt->num_samples);
+ gen7_set_surface_msaa(surf, irb->mt->num_samples, irb->mt->msaa_layout);
if (irb->mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {
gen7_set_surface_mcs_info(brw, surf, brw->wm.surf_offset[unit],