summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_context.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_draw_arrays.c9
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_blend.c27
-rw-r--r--src/gallium/drivers/softpipe/sp_setup.c24
-rw-r--r--src/gallium/drivers/softpipe/sp_state.h3
5 files changed, 43 insertions, 22 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index 200fb415acf..f2ce0fdc6e9 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -178,6 +178,8 @@ softpipe_create( struct pipe_screen *screen,
softpipe->pipe.draw_arrays = softpipe_draw_arrays;
softpipe->pipe.draw_elements = softpipe_draw_elements;
+ softpipe->pipe.set_edgeflags = softpipe_set_edgeflags;
+
softpipe->pipe.clear = softpipe_clear;
softpipe->pipe.flush = softpipe_flush;
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c
index 778291dded7..6c58f9909da 100644
--- a/src/gallium/drivers/softpipe/sp_draw_arrays.c
+++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c
@@ -170,3 +170,12 @@ softpipe_draw_elements(struct pipe_context *pipe,
return TRUE;
}
+
+
+void
+softpipe_set_edgeflags(struct pipe_context *pipe, const unsigned *edgeflags)
+{
+ struct softpipe_context *sp = softpipe_context(pipe);
+ draw_set_edgeflags(sp->draw, edgeflags);
+}
+
diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c
index 802472df45f..74c6bff84ae 100644
--- a/src/gallium/drivers/softpipe/sp_quad_blend.c
+++ b/src/gallium/drivers/softpipe/sp_quad_blend.c
@@ -232,6 +232,11 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad)
struct softpipe_context *softpipe = qs->softpipe;
uint cbuf;
+ if (softpipe->blend->logicop_enable) {
+ logicop_quad(qs, quad);
+ return;
+ }
+
/* loop over colorbuffer outputs */
for (cbuf = 0; cbuf < softpipe->framebuffer.num_cbufs; cbuf++) {
float source[4][QUAD_SIZE], dest[4][QUAD_SIZE];
@@ -242,11 +247,6 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad)
float (*quadColor)[4] = quad->outputs.color[cbuf];
uint i, j;
- if (softpipe->blend->logicop_enable) {
- logicop_quad(qs, quad);
- return;
- }
-
/* get/swizzle dest colors */
for (j = 0; j < QUAD_SIZE; j++) {
int x = (quad->x0 & (TILE_SIZE-1)) + (j & 1);
@@ -294,11 +294,12 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad)
case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE:
{
const float *alpha = quadColor[3];
- float diff[4];
+ float diff[4], temp[4];
VEC4_SUB(diff, one, dest[3]);
- VEC4_MIN(source[0], alpha, diff); /* R */
- VEC4_MIN(source[1], alpha, diff); /* G */
- VEC4_MIN(source[2], alpha, diff); /* B */
+ VEC4_MIN(temp, alpha, diff);
+ VEC4_MUL(source[0], quadColor[0], temp); /* R */
+ VEC4_MUL(source[1], quadColor[1], temp); /* G */
+ VEC4_MUL(source[2], quadColor[2], temp); /* B */
}
break;
case PIPE_BLENDFACTOR_CONST_COLOR:
@@ -426,12 +427,8 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad)
VEC4_MUL(source[3], quadColor[3], dest[3]); /* A */
break;
case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE:
- {
- const float *alpha = quadColor[3];
- float diff[4];
- VEC4_SUB(diff, one, dest[3]);
- VEC4_MIN(source[3], alpha, diff); /* A */
- }
+ /* multiply alpha by 1.0 */
+ VEC4_COPY(source[3], quadColor[3]); /* A */
break;
case PIPE_BLENDFACTOR_CONST_COLOR:
/* fall-through */
diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c
index 7df8fc5f679..df7be01fcd5 100644
--- a/src/gallium/drivers/softpipe/sp_setup.c
+++ b/src/gallium/drivers/softpipe/sp_setup.c
@@ -719,6 +719,13 @@ void setup_tri( struct setup_context *setup,
{
float det = calc_det(v0, v1, v2);
+#if DEBUG_VERTS
+ debug_printf("Setup triangle:\n");
+ print_vertex(setup, v0);
+ print_vertex(setup, v1);
+ print_vertex(setup, v2);
+#endif
+
if (setup->softpipe->no_rast)
return;
@@ -731,13 +738,6 @@ void setup_tri( struct setup_context *setup,
setup->numFragsWritten = 0;
#endif
-#if DEBUG_VERTS
- debug_printf("Triangle:\n");
- print_vertex(setup, v0);
- print_vertex(setup, v1);
- print_vertex(setup, v2);
-#endif
-
if (cull_tri( setup, det ))
return;
@@ -935,6 +935,12 @@ setup_line(struct setup_context *setup,
int dy = y1 - y0;
int xstep, ystep;
+#if DEBUG_VERTS
+ debug_printf("Setup line:\n");
+ print_vertex(setup, v0);
+ print_vertex(setup, v1);
+#endif
+
if (setup->softpipe->no_rast)
return;
@@ -1056,6 +1062,10 @@ setup_point( struct setup_context *setup,
const struct vertex_info *vinfo = softpipe_get_vertex_info(softpipe);
uint fragSlot;
+#if DEBUG_VERTS
+ debug_printf("Setup point:\n");
+ print_vertex(setup, v0);
+#endif
if (softpipe->no_rast)
return;
diff --git a/src/gallium/drivers/softpipe/sp_state.h b/src/gallium/drivers/softpipe/sp_state.h
index 6e6501f5bc4..45056502b8e 100644
--- a/src/gallium/drivers/softpipe/sp_state.h
+++ b/src/gallium/drivers/softpipe/sp_state.h
@@ -171,6 +171,9 @@ boolean softpipe_draw_elements(struct pipe_context *pipe,
unsigned indexSize,
unsigned mode, unsigned start, unsigned count);
+void
+softpipe_set_edgeflags(struct pipe_context *pipe, const unsigned *edgeflags);
+
void
softpipe_map_surfaces(struct softpipe_context *sp);