summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-03-31 12:01:16 +0800
committerChia-I Wu <[email protected]>2010-05-12 12:12:57 +0800
commitbcce57c2e9a1d9b203dba8fe13480889e6d19c89 (patch)
treee974365e0635003a159483fa86d49c05861d39dd /src/mesa/state_tracker/st_draw.c
parent14a92b26ff76550c5010ddf8bcbf5226dae5183f (diff)
st/mesa: Make FEATURE_feedback and FEATURE_rastpos more modular.
Make st_cb_feedback.h FEATURE_feedback aware and st_cb_rastpos.h FEATURE_rastpos aware. Move creation of selection/feedback draw context to st_init_draw.
Diffstat (limited to 'src/mesa/state_tracker/st_draw.c')
-rw-r--r--src/mesa/state_tracker/st_draw.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 4137596bd40..eb2e5b2bbf7 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -57,6 +57,7 @@
#include "pipe/p_defines.h"
#include "util/u_inlines.h"
#include "util/u_format.h"
+#include "draw/draw_context.h"
#include "cso_cache/cso_context.h"
@@ -741,11 +742,26 @@ void st_init_draw( struct st_context *st )
GLcontext *ctx = st->ctx;
vbo_set_draw_func(ctx, st_draw_vbo);
+
+#if FEATURE_feedback || FEATURE_rastpos
+ st->draw = draw_create(st->pipe); /* for selection/feedback */
+
+ /* Disable draw options that might convert points/lines to tris, etc.
+ * as that would foul-up feedback/selection mode.
+ */
+ draw_wide_line_threshold(st->draw, 1000.0f);
+ draw_wide_point_threshold(st->draw, 1000.0f);
+ draw_enable_line_stipple(st->draw, FALSE);
+ draw_enable_point_sprites(st->draw, FALSE);
+#endif
}
void st_destroy_draw( struct st_context *st )
{
+#if FEATURE_feedback || FEATURE_rastpos
+ draw_destroy(st->draw);
+#endif
}