summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_stipple.c
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2016-10-12 14:01:34 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2016-10-12 17:04:16 -0400
commite6a693c447213b578f562edad8f15ccc43056acd (patch)
treeb5dd8a08d730d3224149cfd30d84d7a1bf7858d6 /src/mesa/state_tracker/st_atom_stipple.c
parenta4622305e67dbb3ed224fa966160616688e43ee8 (diff)
downloadexternal_mesa3d-e6a693c447213b578f562edad8f15ccc43056acd.zip
external_mesa3d-e6a693c447213b578f562edad8f15ccc43056acd.tar.gz
external_mesa3d-e6a693c447213b578f562edad8f15ccc43056acd.tar.bz2
st/mesa: only flip stipple pattern for winsys fbo's
Gallium is completely oblivious to whether the fbo is flipped or not. Only flip the stipple pattern when the fbo is flipped as well. Otherwise the driver has no idea when to unflip the pattern. Fixes bin/gl-2.1-polygon-stipple-fs -fbo Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Brian Paul <brianp@vmware.com> Tested-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/mesa/state_tracker/st_atom_stipple.c')
-rw-r--r--src/mesa/state_tracker/st_atom_stipple.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_atom_stipple.c b/src/mesa/state_tracker/st_atom_stipple.c
index a30215f..5f7bf82 100644
--- a/src/mesa/state_tracker/st_atom_stipple.c
+++ b/src/mesa/state_tracker/st_atom_stipple.c
@@ -61,7 +61,7 @@ invert_stipple(GLuint dest[32], const GLuint src[32], GLuint winHeight)
-static void
+static void
update_stipple( struct st_context *st )
{
const struct gl_context *ctx = st->ctx;
@@ -74,8 +74,12 @@ update_stipple( struct st_context *st )
memcpy(st->state.poly_stipple, ctx->PolygonStipple, sz);
- invert_stipple(newStipple.stipple, ctx->PolygonStipple,
- ctx->DrawBuffer->Height);
+ if (_mesa_is_user_fbo(ctx->DrawBuffer)) {
+ memcpy(newStipple.stipple, ctx->PolygonStipple, sizeof(newStipple.stipple));
+ } else {
+ invert_stipple(newStipple.stipple, ctx->PolygonStipple,
+ ctx->DrawBuffer->Height);
+ }
st->pipe->set_polygon_stipple(st->pipe, &newStipple);
}