+ user_assert(!(srcb->base.usage & D3DUSAGE_AUTOGENMIPMAP) ||
+ dstb->base.usage & D3DUSAGE_AUTOGENMIPMAP, D3DERR_INVALIDCALL);
+
+ /* Spec: Failure if
+ * . Different formats
+ * . Fewer src levels than dst levels (if the opposite, only matching levels
+ * are supposed to be copied)
+ * . Levels do not match
+ * DDI: Actually the above should pass because of legacy applications
+ * Do what you want about these, but you shouldn't crash.
+ * However driver can expect that the top dimension is greater for src than dst.
+ * Wine tests: Every combination that passes the initial checks should pass.
+ * . Different formats => conversion driver and format dependent.
+ * . 1 level, but size not matching => copy is done (and even crash if src bigger
+ * than dst. For the case where dst bigger, wine doesn't test if a stretch is applied
+ * or if a subrect is copied).
+ * . 8x8 4 sublevels -> 7x7 2 sublevels => driver dependent, On NV seems to be 4x4 subrect
+ * copied to 7x7.
+ *
+ * From these, the proposal is:
+ * . Different formats -> use util_format_translate to translate if possible for surfaces.
+ * Accept ARGB/XRGB for Volumes. Do nothing for the other combinations
+ * . First level copied -> the first level such that src is smaller or equal to dst first level
+ * . number of levels copied -> as long as it fits and textures have levels
+ * That should satisfy the constraints (and instead of crashing for some cases we return D3D_OK)
+ */