summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-12-07 19:52:00 +0100
committerMarek Olšák <[email protected]>2012-12-12 13:09:53 +0100
commiteae9674f187ea0f250723fef75d4f71bb3ba632e (patch)
treedafb0ce62d43280d0dff7e69dfdb66d9e42bd60e /src/mesa/state_tracker
parent9ec6ffd85d019cdba3bbeba24dbc49981791df28 (diff)
gallium: manage render condition in cso_context and fix postprocessing w/ it
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_condrender.c11
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c12
-rw-r--r--src/mesa/state_tracker/st_context.h4
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c9
4 files changed, 3 insertions, 33 deletions
diff --git a/src/mesa/state_tracker/st_cb_condrender.c b/src/mesa/state_tracker/st_cb_condrender.c
index 1ced560e160..3a5835ecdc6 100644
--- a/src/mesa/state_tracker/st_cb_condrender.c
+++ b/src/mesa/state_tracker/st_cb_condrender.c
@@ -38,6 +38,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
+#include "cso_cache/cso_context.h"
#include "st_context.h"
#include "st_cb_queryobj.h"
#include "st_cb_condrender.h"
@@ -53,7 +54,6 @@ st_BeginConditionalRender(struct gl_context *ctx, struct gl_query_object *q,
{
struct st_query_object *stq = st_query_object(q);
struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
uint m;
st_flush_bitmap_cache(st);
@@ -76,10 +76,7 @@ st_BeginConditionalRender(struct gl_context *ctx, struct gl_query_object *q,
m = PIPE_RENDER_COND_WAIT;
}
- st->render_condition = stq->pq;
- st->condition_mode = m;
-
- pipe->render_condition(pipe, stq->pq, m);
+ cso_set_render_condition(st->cso_context, stq->pq, m);
}
@@ -90,13 +87,11 @@ static void
st_EndConditionalRender(struct gl_context *ctx, struct gl_query_object *q)
{
struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
(void) q;
st_flush_bitmap_cache(st);
- pipe->render_condition(pipe, NULL, 0);
- st->render_condition = NULL;
+ cso_set_render_condition(st->cso_context, NULL, 0);
}
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index ae069eb2cba..1ddb695e57b 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1089,11 +1089,6 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
goto fallback;
}
- /* Disable conditional rendering. */
- if (st->render_condition) {
- pipe->render_condition(pipe, NULL, 0);
- }
-
memset(&surf_tmpl, 0, sizeof(surf_tmpl));
surf_tmpl.format = util_format_linear(stImage->pt->format);
surf_tmpl.usage = dst_usage;
@@ -1115,13 +1110,6 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
0.0, PIPE_TEX_MIPFILTER_NEAREST,
color_writemask, 0);
pipe_surface_reference(&dest_surface, NULL);
-
- /* Restore conditional rendering state. */
- if (st->render_condition) {
- pipe->render_condition(pipe, st->render_condition,
- st->condition_mode);
- }
-
return;
fallback:
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 8e6f28b50f9..eeb7f0c4fd6 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -190,10 +190,6 @@ struct st_context
/* The number of vertex buffers from the last call of validate_arrays. */
unsigned last_num_vbuffers;
- /* Active render condition. */
- struct pipe_query *render_condition;
- unsigned condition_mode;
-
int32_t draw_stamp;
int32_t read_stamp;
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index c0926131254..8ce2e06a241 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -93,18 +93,9 @@ st_render_mipmap(struct st_context *st,
psv = st_create_texture_sampler_view(pipe, stObj->pt);
- /* Disable conditional rendering. */
- if (st->render_condition) {
- pipe->render_condition(pipe, NULL, 0);
- }
-
util_gen_mipmap(st->gen_mipmap, psv, face, baseLevel, lastLevel,
PIPE_TEX_FILTER_LINEAR);
- if (st->render_condition) {
- pipe->render_condition(pipe, st->render_condition, st->condition_mode);
- }
-
pipe_sampler_view_reference(&psv, NULL);
return TRUE;