summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-05-23 19:00:56 +0200
committerMarek Olšák <maraeo@gmail.com>2010-05-23 19:01:11 +0200
commitfa552261ea1795503d051864af6cdf05cb7197ae (patch)
tree53a96de06a70ed90fb13182b283e6cd9658584aa /src
parenta650d7068a00f0a256ecb54112da0f4ab9204b86 (diff)
util/blitter: allow NULL clear color
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/util/u_blitter.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index e0bd89154c..c2d1af372c 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -371,11 +371,20 @@ static void blitter_set_clear_color(struct blitter_context_priv *ctx,
{
int i;
- for (i = 0; i < 4; i++) {
- ctx->vertices[i][1][0] = rgba[0];
- ctx->vertices[i][1][1] = rgba[1];
- ctx->vertices[i][1][2] = rgba[2];
- ctx->vertices[i][1][3] = rgba[3];
+ if (rgba) {
+ for (i = 0; i < 4; i++) {
+ ctx->vertices[i][1][0] = rgba[0];
+ ctx->vertices[i][1][1] = rgba[1];
+ ctx->vertices[i][1][2] = rgba[2];
+ ctx->vertices[i][1][3] = rgba[3];
+ }
+ } else {
+ for (i = 0; i < 4; i++) {
+ ctx->vertices[i][1][0] = 0;
+ ctx->vertices[i][1][1] = 0;
+ ctx->vertices[i][1][2] = 0;
+ ctx->vertices[i][1][3] = 0;
+ }
}
}