Mesa (7.10): st/mesa: GenerateMipmap should not be killed by conditional rendering
Marek Olšák
mareko at kemper.freedesktop.org
Wed Jun 1 00:21:04 UTC 2011
Module: Mesa
Branch: 7.10
Commit: 06b04a2a64c56a0a34548ca3e2c91f87164900d1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=06b04a2a64c56a0a34548ca3e2c91f87164900d1
Author: Marek Olšák <maraeo at gmail.com>
Date: Wed Jun 1 01:41:54 2011 +0200
st/mesa: GenerateMipmap should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.
Reviewed-by: Brian Paul <brianp at vmware.com>
(cherry picked from commit 1c95c3ef9c51c0eb218f80959bbbf29d213a6af0)
Conflicts:
src/mesa/state_tracker/st_context.h
---
src/mesa/state_tracker/st_cb_condrender.c | 11 +++++++++--
src/mesa/state_tracker/st_context.h | 4 ++++
src/mesa/state_tracker/st_gen_mipmap.c | 9 +++++++++
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/mesa/state_tracker/st_cb_condrender.c b/src/mesa/state_tracker/st_cb_condrender.c
index 7766ead..64c6c11 100644
--- a/src/mesa/state_tracker/st_cb_condrender.c
+++ b/src/mesa/state_tracker/st_cb_condrender.c
@@ -51,7 +51,8 @@ st_BeginConditionalRender(struct gl_context *ctx, struct gl_query_object *q,
GLenum mode)
{
struct st_query_object *stq = st_query_object(q);
- struct pipe_context *pipe = st_context(ctx)->pipe;
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
uint m;
switch (mode) {
@@ -72,6 +73,9 @@ 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);
}
@@ -82,9 +86,12 @@ st_BeginConditionalRender(struct gl_context *ctx, struct gl_query_object *q,
static void
st_EndConditionalRender(struct gl_context *ctx, struct gl_query_object *q)
{
- struct pipe_context *pipe = st_context(ctx)->pipe;
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
(void) q;
+
pipe->render_condition(pipe, NULL, 0);
+ st->render_condition = NULL;
}
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index d342c0c..7e445fb 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -190,6 +190,10 @@ struct st_context
int force_msaa;
void *winsys_drawable_handle;
+
+ /* Active render condition. */
+ struct pipe_query *render_condition;
+ unsigned condition_mode;
};
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index c5f6008..7f3fd88 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -91,9 +91,18 @@ st_render_mipmap(struct st_context *st,
return FALSE;
}
+ /* 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);
+ }
+
return TRUE;
}
More information about the mesa-commit
mailing list