diff options
author | Paul Berry <[email protected]> | 2012-05-08 13:39:10 -0700 |
---|---|---|
committer | Paul Berry <[email protected]> | 2012-05-25 08:45:11 -0700 |
commit | 455ac562722f60ac9fb0c3d3c697fa339fa011ad (patch) | |
tree | 726a4d7e3668f1e07f6bc6e671ccb707ebf3d726 /src/mesa/drivers/dri/intel/intel_mipmap_tree.h | |
parent | 0e11b2c5afca456e19b1c29889dde449a4072ede (diff) |
i965/msaa: Properly handle sliced layout for Gen7.
Starting in Gen7, there are two possible layouts for MSAA surfaces:
- Interleaved, in which additional samples are accommodated by scaling
up the width and height of the surface. This is the only layout
available in Gen6. On Gen7 it is used for depth and stencil
surfaces only.
- Sliced, in which the surface is stored as a 2D array, with array
slice n containing all pixel data for sample n. On Gen7 this layout
is used for color surfaces.
The "Sliced" layout has an additional requirement: it must be used in
ARYSPC_LOD0 mode, which means that the surface doesn't leave any extra
room between array slices for miplevels other than 0.
This patch modifies the surface allocation functions to use the
correct layout when allocating MSAA surfaces in Gen7, and to set the
array offsets properly when using ARYSPC_LOD0 mode. It also modifies
the code that populates SURFACE_STATE structures to ensure that
ARYSPC_LOD0 mode is selected in the appropriate circumstances.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_mipmap_tree.h')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_mipmap_tree.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h index 7536065f227..5c57e02f031 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h @@ -172,6 +172,26 @@ struct intel_mipmap_tree GLuint num_samples; bool compressed; + /** + * For 1D array, 2D array, cube, and 2D multisampled surfaces on Gen7: true + * if the surface only contains LOD 0, and hence no space is for LOD's + * other than 0 in between array slices. + * + * Corresponds to the surface_array_spacing bit in gen7_surface_state. + */ + bool array_spacing_lod0; + + /** + * For MSAA buffers, there are two possible layouts: + * - Interleaved, in which the additional samples are accommodated + * by scaling up the width and height of the surface. + * - Sliced, in which the surface is stored as a 2D array, with + * array slice n containing all pixel data for sample n. + * + * This value is true if num_samples > 0 and the format is interleaved. + */ + bool msaa_is_interleaved; + /* Derived from the above: */ GLuint total_width; @@ -238,7 +258,8 @@ struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel, GLuint height0, GLuint depth0, bool expect_accelerated_upload, - GLuint num_samples); + GLuint num_samples, + bool msaa_is_interleaved); struct intel_mipmap_tree * intel_miptree_create_for_region(struct intel_context *intel, |