-#define __glTexImage3D_size(format, type, width, height, depth) __gl_image_size(format, type, width, height, depth)
-#define __glTexImage2D_size(format, type, width, height) __gl_image_size(format, type, width, height, 1)
-#define __glTexImage1D_size(format, type, width) __gl_image_size(format, type, width, 1, 1)
+// note that can_unpack_subimage() is generated by gltrace.py
+#define __glTexImage3D_size(format, type, width, height, depth) __gl_image_size(format, type, width, height, depth, can_unpack_subimage())
+#define __glTexImage2D_size(format, type, width, height) __gl_image_size(format, type, width, height, 1, can_unpack_subimage())
+#define __glTexImage1D_size(format, type, width) __gl_image_size(format, type, width, 1, 1, can_unpack_subimage())