Module: Mesa
Branch: master
Commit: 3a2e0c77848120f44031d2deb91108ff8e951d85
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a2e0c77848120f44031d2deb91108ff8e951d85

Author: Axel Davy <axel.d...@ens.fr>
Date:   Tue Jan 26 18:14:02 2016 +0100

st/nine: Support ATI1/ATI2 for CubeTexture

Texture and CubeTexture use common code,
and thus ATI1/ATI2 is already implemented
for CubeTexture.

Signed-off-by: Axel Davy <axel.d...@ens.fr>
Reviewed-by: Patrick Rudolph <s...@das-labor.org>

---

 src/gallium/state_trackers/nine/adapter9.c       | 5 +++--
 src/gallium/state_trackers/nine/cubetexture9.c   | 4 ----
 src/gallium/state_trackers/nine/volumetexture9.c | 2 +-
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/gallium/state_trackers/nine/adapter9.c 
b/src/gallium/state_trackers/nine/adapter9.c
index 8428b1b..5e9c7f7 100644
--- a/src/gallium/state_trackers/nine/adapter9.c
+++ b/src/gallium/state_trackers/nine/adapter9.c
@@ -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 } 
*/
diff --git a/src/gallium/state_trackers/nine/cubetexture9.c 
b/src/gallium/state_trackers/nine/cubetexture9.c
index 1749190..03b5fca 100644
--- a/src/gallium/state_trackers/nine/cubetexture9.c
+++ b/src/gallium/state_trackers/nine/cubetexture9.c
@@ -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);
diff --git a/src/gallium/state_trackers/nine/volumetexture9.c 
b/src/gallium/state_trackers/nine/volumetexture9.c
index cdec21f..cd94a36 100644
--- a/src/gallium/state_trackers/nine/volumetexture9.c
+++ b/src/gallium/state_trackers/nine/volumetexture9.c
@@ -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;
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to