Mesa (master): r600g: only set PIPE_BIND_BLENDABLE if colorbuffer rendering is supported

Marek Olšák mareko at kemper.freedesktop.org
Mon Aug 25 11:12:49 UTC 2014


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Aug 23 11:18:43 2014 +0200

r600g: only set PIPE_BIND_BLENDABLE if colorbuffer rendering is supported

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

---

 src/gallium/drivers/r600/evergreen_state.c |   15 +++++----------
 src/gallium/drivers/r600/r600_state.c      |   15 +++++----------
 2 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 841ad0c..9f0e82d 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -227,11 +227,6 @@ static bool r600_is_zs_format_supported(enum pipe_format format)
 	return r600_translate_dbformat(format) != ~0U;
 }
 
-static inline bool r600_is_blending_supported(enum pipe_format format)
-{
-	return !(util_format_is_pure_integer(format) || util_format_is_depth_or_stencil(format));
-}
-
 boolean evergreen_is_format_supported(struct pipe_screen *screen,
 				      enum pipe_format format,
 				      enum pipe_texture_target target,
@@ -276,13 +271,17 @@ boolean evergreen_is_format_supported(struct pipe_screen *screen,
 	if ((usage & (PIPE_BIND_RENDER_TARGET |
 		      PIPE_BIND_DISPLAY_TARGET |
 		      PIPE_BIND_SCANOUT |
-		      PIPE_BIND_SHARED)) &&
+		      PIPE_BIND_SHARED |
+		      PIPE_BIND_BLENDABLE)) &&
 	    r600_is_colorbuffer_format_supported(rscreen->b.chip_class, format)) {
 		retval |= usage &
 			  (PIPE_BIND_RENDER_TARGET |
 			   PIPE_BIND_DISPLAY_TARGET |
 			   PIPE_BIND_SCANOUT |
 			   PIPE_BIND_SHARED);
+		if (!util_format_is_pure_integer(format) &&
+		    !util_format_is_depth_or_stencil(format))
+			retval |= usage & PIPE_BIND_BLENDABLE;
 	}
 
 	if ((usage & PIPE_BIND_DEPTH_STENCIL) &&
@@ -300,10 +299,6 @@ boolean evergreen_is_format_supported(struct pipe_screen *screen,
 	if (usage & PIPE_BIND_TRANSFER_WRITE)
 		retval |= PIPE_BIND_TRANSFER_WRITE;
 
-	if ((usage & PIPE_BIND_BLENDABLE) &&
-	    r600_is_blending_supported(format))
-		retval |= PIPE_BIND_BLENDABLE;
-
 	return retval == usage;
 }
 
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 607b199..d9342d4 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -157,11 +157,6 @@ static bool r600_is_zs_format_supported(enum pipe_format format)
 	return r600_translate_dbformat(format) != ~0U;
 }
 
-static inline bool r600_is_blending_supported(enum pipe_format format)
-{
-	return !(util_format_is_pure_integer(format) || util_format_is_depth_or_stencil(format));
-}
-
 boolean r600_is_format_supported(struct pipe_screen *screen,
 				 enum pipe_format format,
 				 enum pipe_texture_target target,
@@ -216,13 +211,17 @@ boolean r600_is_format_supported(struct pipe_screen *screen,
 	if ((usage & (PIPE_BIND_RENDER_TARGET |
 		      PIPE_BIND_DISPLAY_TARGET |
 		      PIPE_BIND_SCANOUT |
-		      PIPE_BIND_SHARED)) &&
+		      PIPE_BIND_SHARED |
+		      PIPE_BIND_BLENDABLE)) &&
 	    r600_is_colorbuffer_format_supported(rscreen->b.chip_class, format)) {
 		retval |= usage &
 			  (PIPE_BIND_RENDER_TARGET |
 			   PIPE_BIND_DISPLAY_TARGET |
 			   PIPE_BIND_SCANOUT |
 			   PIPE_BIND_SHARED);
+		if (!util_format_is_pure_integer(format) &&
+		    !util_format_is_depth_or_stencil(format))
+			retval |= usage & PIPE_BIND_BLENDABLE;
 	}
 
 	if ((usage & PIPE_BIND_DEPTH_STENCIL) &&
@@ -240,10 +239,6 @@ boolean r600_is_format_supported(struct pipe_screen *screen,
 	if (usage & PIPE_BIND_TRANSFER_WRITE)
 		retval |= PIPE_BIND_TRANSFER_WRITE;
 
-	if ((usage & PIPE_BIND_BLENDABLE) &&
-	    r600_is_blending_supported(format))
-		retval |= PIPE_BIND_BLENDABLE;
-
 	return retval == usage;
 }
 




More information about the mesa-commit mailing list