aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-08-09 11:31:48 -0700
committerEmil Velikov <[email protected]>2017-08-11 20:59:28 +0100
commit1c1653d7b0234395493872ff11206743ce40eb6c (patch)
treea277e0d000fa5dc0ede336365708887d38720895 /src/intel
parentd4100b0d0950d87632e8f65f0583c639c89b7747 (diff)
isl: Validate row pitch of stencil surfaces.
Also, silence an obnoxious finishme that started occurring for all GL applications which use stencil after the i965 ISL conversion. v2: Check against 3DSTATE_STENCIL_BUFFER's pitch bits when using separate stencil, and 3DSTATE_DEPTH_BUFFER's bits when using combined depth-stencil. Cc: "17.2" <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> (cherry picked from commit 5563872dbfbf733ed56e1b367bc8944ca59b1c3e)
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/isl/isl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 6b4203d79d2..133986782b7 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -1367,8 +1367,13 @@ isl_calc_row_pitch(const struct isl_device *dev,
!pitch_in_range(row_pitch, _3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_bits(dev->info)))
return false;
- if (surf_info->usage & ISL_SURF_USAGE_STENCIL_BIT)
- isl_finishme("validate row pitch of stencil surfaces");
+ const uint32_t stencil_pitch_bits = dev->use_separate_stencil ?
+ _3DSTATE_STENCIL_BUFFER_SurfacePitch_bits(dev->info) :
+ _3DSTATE_DEPTH_BUFFER_SurfacePitch_bits(dev->info);
+
+ if ((surf_info->usage & ISL_SURF_USAGE_STENCIL_BIT) &&
+ !pitch_in_range(row_pitch, stencil_pitch_bits))
+ return false;
done:
*out_row_pitch = row_pitch;