Mesa (master): gallium/targets: Haiku softpipe, perform better framebuffer validation

Alexander von Gluck IV kallisti5 at kemper.freedesktop.org
Fri Aug 29 01:27:46 UTC 2014


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

Author: Alexander von Gluck IV <kallisti5 at unixzen.com>
Date:   Mon Aug 25 14:32:42 2014 +0000

gallium/targets: Haiku softpipe, perform better framebuffer validation

* Check for back left attachment as well
* Set and act on pipe format none

Ack'ed by Emil Velikov <emil.l.velikov at gmail.com>

---

 .../targets/haiku-softpipe/GalliumFramebuffer.cpp  |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/gallium/targets/haiku-softpipe/GalliumFramebuffer.cpp b/src/gallium/targets/haiku-softpipe/GalliumFramebuffer.cpp
index 84c8bd2..d6bfdb4 100644
--- a/src/gallium/targets/haiku-softpipe/GalliumFramebuffer.cpp
+++ b/src/gallium/targets/haiku-softpipe/GalliumFramebuffer.cpp
@@ -100,8 +100,10 @@ hgl_framebuffer_validate(struct st_context_iface* stctx,
 	
 			switch(statts[i]) {
 				case ST_ATTACHMENT_FRONT_LEFT:
+				case ST_ATTACHMENT_BACK_LEFT:
 					format = context->stVisual->color_format;
-					bind = PIPE_BIND_RENDER_TARGET;
+					bind = PIPE_BIND_DISPLAY_TARGET
+						| PIPE_BIND_RENDER_TARGET;
 					break;
 				case ST_ATTACHMENT_DEPTH_STENCIL:
 					format = context->stVisual->depth_stencil_format;
@@ -112,14 +114,18 @@ hgl_framebuffer_validate(struct st_context_iface* stctx,
 					bind = PIPE_BIND_RENDER_TARGET;
 					break;
 				default:
-					ERROR("%s: Unexpected attachment type!\n", __func__);
+					format = PIPE_FORMAT_NONE;
+					break;
 			}
-			templat.format = format;
-			templat.bind = bind;
 
-			struct pipe_screen* screen = context->manager->screen;
-			context->textures[i] = screen->resource_create(screen, &templat);
-			out[i] = context->textures[i];
+			if (format != PIPE_FORMAT_NONE) {
+				templat.format = format;
+				templat.bind = bind;
+
+				struct pipe_screen* screen = context->manager->screen;
+				context->textures[i] = screen->resource_create(screen, &templat);
+				out[i] = context->textures[i];
+			}
 		}
 	}
 




More information about the mesa-commit mailing list