Mesa (mesa_7_7_branch): svga: emit blend color
Roland Scheidegger
sroland at kemper.freedesktop.org
Fri Feb 12 21:14:09 UTC 2010
Module: Mesa
Branch: mesa_7_7_branch
Commit: b685927156cdaec73fbd3639d710f095a05fbca3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b685927156cdaec73fbd3639d710f095a05fbca3
Author: Roland Scheidegger <sroland at vmware.com>
Date: Fri Feb 12 22:12:10 2010 +0100
svga: emit blend color
---
src/gallium/drivers/svga/svga_state_rss.c | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/svga/svga_state_rss.c b/src/gallium/drivers/svga/svga_state_rss.c
index 2f9adae..b97e636 100644
--- a/src/gallium/drivers/svga/svga_state_rss.c
+++ b/src/gallium/drivers/svga/svga_state_rss.c
@@ -26,6 +26,7 @@
#include "pipe/p_inlines.h"
#include "pipe/p_defines.h"
#include "util/u_math.h"
+#include "util/u_pack_color.h"
#include "svga_context.h"
#include "svga_state.h"
@@ -101,6 +102,20 @@ static int emit_rss( struct svga_context *svga,
}
+ if (dirty & SVGA_NEW_BLEND_COLOR) {
+ unsigned color = 0;
+ ubyte r = float_to_ubyte(svga->curr.blend_color.color[0]);
+ ubyte g = float_to_ubyte(svga->curr.blend_color.color[1]);
+ ubyte b = float_to_ubyte(svga->curr.blend_color.color[2]);
+ ubyte a = float_to_ubyte(svga->curr.blend_color.color[3]);
+
+ util_pack_color_ub( r, g, b, a,
+ PIPE_FORMAT_B8G8R8A8_UNORM, &color);
+
+ EMIT_RS( svga, color, BLENDCOLOR, fail );
+ }
+
+
if (dirty & (SVGA_NEW_DEPTH_STENCIL | SVGA_NEW_RAST)) {
const struct svga_depth_stencil_state *curr = svga->curr.depth;
const struct svga_rasterizer_state *rast = svga->curr.rast;
@@ -230,13 +245,10 @@ static int emit_rss( struct svga_context *svga,
memcpy( rs,
queue.rs,
queue.rs_count * sizeof queue.rs[0]);
-
+
SVGA_FIFOCommitAll( svga->swc );
}
- /* Also blend color:
- */
-
return 0;
fail:
@@ -256,6 +268,7 @@ struct svga_tracked_state svga_hw_rss =
"hw rss state",
(SVGA_NEW_BLEND |
+ SVGA_NEW_BLEND_COLOR |
SVGA_NEW_DEPTH_STENCIL |
SVGA_NEW_RAST |
SVGA_NEW_FRAME_BUFFER |
More information about the mesa-commit
mailing list