st/nine: Add ColorFill test for compressed textures
authorAxel Davy <axel.davy@ens.fr>
Tue, 9 Feb 2016 22:51:39 +0000 (23:51 +0100)
committerAxel Davy <axel.davy@ens.fr>
Wed, 18 May 2016 21:37:14 +0000 (23:37 +0200)
ColorFill should contain alignment checks
for compressed textures.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/device9.c

index 3e00ceed4243ba7cdd5819b02fd0975f08ee28f3..279b8352b966922a6f02168c2620ab9fb53fbc65 100644 (file)
@@ -1732,6 +1732,14 @@ NineDevice9_ColorFill( struct NineDevice9 *This,
         y = pRect->top;
         w = pRect->right - pRect->left;
         h = pRect->bottom - pRect->top;
+        /* Wine tests: */
+        if (compressed_format(surf->desc.Format)) {
+           const unsigned bw = util_format_get_blockwidth(surf->base.info.format);
+           const unsigned bh = util_format_get_blockheight(surf->base.info.format);
+
+           user_assert(!(x % bw) && !(y % bh) && !(w % bw) && !(h % bh),
+                       D3DERR_INVALIDCALL);
+        }
     } else{
         x = 0;
         y = 0;