summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-09-08 10:23:47 -0700
committerJason Ekstrand <[email protected]>2016-09-13 12:40:12 -0700
commit00e79cec995b8c654783860613bc36b90d3d33dc (patch)
treef19f200b9dde52d95ece76249d45887ffc6f0789 /src/intel
parentcb780c9ccf7b7c68943b3e3f4850a60cd4f703e1 (diff)
isl/state: Don't set QPitch for GEN4_3D surfaces
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/isl/isl_surface_state.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index da1544b7921..cd7a0845c78 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -172,7 +172,6 @@ get_qpitch(const struct isl_surf *surf)
default:
unreachable("Bad isl_surf_dim");
case ISL_DIM_LAYOUT_GEN4_2D:
- case ISL_DIM_LAYOUT_GEN4_3D:
if (GEN_GEN >= 9) {
return isl_surf_get_array_pitch_el_rows(surf);
} else {
@@ -199,6 +198,22 @@ get_qpitch(const struct isl_surf *surf)
* slices.
*/
return isl_surf_get_array_pitch_el(surf);
+ case ISL_DIM_LAYOUT_GEN4_3D:
+ /* QPitch doesn't make sense for ISL_DIM_LAYOUT_GEN4_3D since it uses a
+ * different pitch at each LOD. Also, the QPitch field is ignored for
+ * these surfaces. From the Broadwell PRM documentation for QPitch:
+ *
+ * This field specifies the distance in rows between array slices. It
+ * is used only in the following cases:
+ * - Surface Array is enabled OR
+ * - Number of Mulitsamples is not NUMSAMPLES_1 and Multisampled
+ * Surface Storage Format set to MSFMT_MSS OR
+ * - Surface Type is SURFTYPE_CUBE
+ *
+ * None of the three conditions above can possibly apply to a 3D surface
+ * so it is safe to just set QPitch to 0.
+ */
+ return 0;
}
}
#endif /* GEN_GEN >= 8 */