st/nine: Support ATI1/ATI2 for CubeTexture
authorAxel Davy <axel.davy@ens.fr>
Tue, 26 Jan 2016 17:14:02 +0000 (18:14 +0100)
committerAxel Davy <axel.davy@ens.fr>
Fri, 12 Feb 2016 22:26:36 +0000 (23:26 +0100)
Texture and CubeTexture use common code,
and thus ATI1/ATI2 is already implemented
for CubeTexture.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
src/gallium/state_trackers/nine/adapter9.c
src/gallium/state_trackers/nine/cubetexture9.c
src/gallium/state_trackers/nine/volumetexture9.c

index 8428b1bd7ebe67b3a099325ceec25733ef0dffe8..5e9c7f73a509853f5d12ed692b2f09b4d08aaa20 100644 (file)
@@ -338,8 +338,9 @@ NineAdapter9_CheckDeviceFormat( struct NineAdapter9 *This,
         return D3DERR_NOTAVAILABLE;
     }
 
-    /* we support ATI1 and ATI2 hack only for 2D textures */
-    if (RType != D3DRTYPE_TEXTURE && (CheckFormat == D3DFMT_ATI1 || CheckFormat == D3DFMT_ATI2))
+    /* we support ATI1 and ATI2 hack only for 2D and Cube textures */
+    if (RType != D3DRTYPE_TEXTURE && RType != D3DRTYPE_CUBETEXTURE &&
+        (CheckFormat == D3DFMT_ATI1 || CheckFormat == D3DFMT_ATI2))
         return D3DERR_NOTAVAILABLE;
     /* if (Usage & D3DUSAGE_NONSECURE) { don't know the implications of this } */
     /* if (Usage & D3DUSAGE_SOFTWAREPROCESSING) { we can always support this } */
index 1749190b38a2ccc3cd34fd2da3dbeaf6c2bb4f4a..03b5fcad60ec064e4cb40db2aeb0e0d0b274f1ab 100644 (file)
@@ -69,10 +69,6 @@ NineCubeTexture9_ctor( struct NineCubeTexture9 *This,
     if (pf == PIPE_FORMAT_NONE)
         return D3DERR_INVALIDCALL;
 
-    /* We support ATI1 and ATI2 hacks only for 2D textures */
-    if (Format == D3DFMT_ATI1 || Format == D3DFMT_ATI2)
-        return D3DERR_INVALIDCALL;
-
     if (compressed_format(Format)) {
         const unsigned w = util_format_get_blockwidth(pf);
         const unsigned h = util_format_get_blockheight(pf);
index cdec21fcb76534ee04d095680917ebab6aecb3bf..cd94a36b64a9551a8e7c6d24b0b9f6d6cc580e99 100644 (file)
@@ -63,7 +63,7 @@ NineVolumeTexture9_ctor( struct NineVolumeTexture9 *This,
     if (pf == PIPE_FORMAT_NONE)
         return D3DERR_INVALIDCALL;
 
-    /* We support ATI1 and ATI2 hacks only for 2D textures */
+    /* We support ATI1 and ATI2 hacks only for 2D and Cube textures */
     if (Format == D3DFMT_ATI1 || Format == D3DFMT_ATI2)
         return D3DERR_INVALIDCALL;