summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-11-29 17:06:25 -0800
committerEric Anholt <[email protected]>2018-12-14 17:48:01 -0800
commit332a5cf6a57dc838e7010e2f7c42eceb8209f6c6 (patch)
tree65c6cdbb282ea8eb320e538cb81ba878ba0d867b /src
parent6ad9e8690d144f110150d3367254504c1b322682 (diff)
v3d: Add safety checks for resource_create().
This should ease my debugging next time I screw it up.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/v3d/v3d_resource.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/v3d/v3d_resource.c b/src/gallium/drivers/v3d/v3d_resource.c
index 33b44868bbd..e7e149abd74 100644
--- a/src/gallium/drivers/v3d/v3d_resource.c
+++ b/src/gallium/drivers/v3d/v3d_resource.c
@@ -432,6 +432,12 @@ v3d_setup_slices(struct v3d_resource *rsc, uint32_t winsys_stride)
*/
bool uif_top = msaa;
+ /* Check some easy mistakes to make in a resource_create() call that
+ * will break our setup.
+ */
+ assert(prsc->array_size != 0);
+ assert(prsc->depth0 != 0);
+
for (int i = prsc->last_level; i >= 0; i--) {
struct v3d_resource_slice *slice = &rsc->slices[i];