return success;
}
-bool
-ilo_3d_pass_render_condition(struct ilo_context *ilo)
-{
- struct ilo_3d *hw3d = ilo->hw3d;
- uint64_t result;
- bool wait;
-
- if (!hw3d->render_condition.query)
- return true;
-
- switch (hw3d->render_condition.mode) {
- case PIPE_RENDER_COND_WAIT:
- case PIPE_RENDER_COND_BY_REGION_WAIT:
- wait = true;
- break;
- case PIPE_RENDER_COND_NO_WAIT:
- case PIPE_RENDER_COND_BY_REGION_NO_WAIT:
- default:
- wait = false;
- break;
- }
-
- if (ilo->base.get_query_result(&ilo->base, hw3d->render_condition.query,
- wait, (union pipe_query_result *) &result))
- return (!result == hw3d->render_condition.cond);
- else
- return true;
-}
-
void
ilo_3d_draw_rectlist(struct ilo_3d *hw3d, const struct ilo_blitter *blitter)
{
ilo_state_vector_dump_dirty(&ilo->state_vector);
}
- if (!ilo_3d_pass_render_condition(ilo))
+ if (ilo_skip_rendering(ilo))
return;
if (info->primitive_restart && info->indexed) {
ilo_3d_pipeline_emit_flush(hw3d->pipeline);
}
-static void
-ilo_render_condition(struct pipe_context *pipe,
- struct pipe_query *query,
- boolean condition,
- uint mode)
-{
- struct ilo_context *ilo = ilo_context(pipe);
- struct ilo_3d *hw3d = ilo->hw3d;
-
- /* reference count? */
- hw3d->render_condition.query = query;
- hw3d->render_condition.mode = mode;
- hw3d->render_condition.cond = condition;
-}
-
static void
ilo_texture_barrier(struct pipe_context *pipe)
{
ilo_init_3d_functions(struct ilo_context *ilo)
{
ilo->base.draw_vbo = ilo_draw_vbo;
- ilo->base.render_condition = ilo_render_condition;
ilo->base.texture_barrier = ilo_texture_barrier;
ilo->base.get_sample_position = ilo_get_sample_position;
}
bool new_batch;
- struct {
- struct pipe_query *query;
- unsigned mode;
- bool cond;
- } render_condition;
-
struct list_head queries;
struct ilo_3d_pipeline *pipeline;
void
ilo_3d_process_query(struct pipe_context *pipe, struct ilo_query *q);
-bool
-ilo_3d_pass_render_condition(struct ilo_context *ilo);
-
void
ilo_init_3d_functions(struct ilo_context *ilo);
#include "util/u_dual_blend.h"
#include "util/u_prim.h"
-#include "ilo_3d.h"
#include "ilo_blitter.h"
#include "ilo_builder_3d.h"
#include "ilo_builder_mi.h"
#include "genhw/genhw.h"
#include "util/u_pack_color.h"
-#include "ilo_3d.h"
#include "ilo_builder_mi.h"
#include "ilo_builder_blt.h"
#include "ilo_context.h"
union util_color packed;
bool success;
- if (!ilo_3d_pass_render_condition(blitter->ilo))
+ if (ilo_skip_rendering(blitter->ilo))
return true;
switch (cpp) {
struct pipe_box box;
uint32_t val;
- if (!ilo_3d_pass_render_condition(blitter->ilo))
+ if (ilo_skip_rendering(blitter->ilo))
return true;
switch (zs->format) {
#include "util/u_blitter.h"
#include "util/u_surface.h"
-#include "ilo_3d.h"
#include "ilo_context.h"
#include "ilo_blitter.h"
{
struct blitter_context *b = blitter->pipe_blitter;
struct ilo_state_vector *vec = &blitter->ilo->state_vector;
- struct ilo_3d *hw3d = blitter->ilo->hw3d;
/* vertex states */
util_blitter_save_vertex_buffer_slot(b, vec->vb.states);
/* resource_copy_region() or blit() does not honor render condition */
util_blitter_save_render_condition(b,
- hw3d->render_condition.query,
- hw3d->render_condition.cond,
- hw3d->render_condition.mode);
+ blitter->ilo->render_condition.query,
+ blitter->ilo->render_condition.condition,
+ blitter->ilo->render_condition.mode);
break;
case ILO_BLITTER_PIPE_CLEAR:
/*
#include "util/u_pack_color.h"
#include "ilo_3d.h"
-#include "ilo_3d_pipeline.h"
#include "ilo_builder_3d_top.h" /* for ve_init_cso_with_components() */
#include "ilo_state.h"
#include "ilo_state_gen.h" /* for zs_align_surface() */
}
}
+static void
+ilo_render_condition(struct pipe_context *pipe,
+ struct pipe_query *query,
+ boolean condition,
+ uint mode)
+{
+ struct ilo_context *ilo = ilo_context(pipe);
+
+ /* reference count? */
+ ilo->render_condition.query = query;
+ ilo->render_condition.condition = condition;
+ ilo->render_condition.mode = mode;
+}
+
+bool
+ilo_skip_rendering(struct ilo_context *ilo)
+{
+ uint64_t result;
+ bool wait;
+
+ if (!ilo->render_condition.query)
+ return false;
+
+ switch (ilo->render_condition.mode) {
+ case PIPE_RENDER_COND_WAIT:
+ case PIPE_RENDER_COND_BY_REGION_WAIT:
+ wait = true;
+ break;
+ case PIPE_RENDER_COND_NO_WAIT:
+ case PIPE_RENDER_COND_BY_REGION_NO_WAIT:
+ default:
+ wait = false;
+ break;
+ }
+
+ if (ilo->base.get_query_result(&ilo->base, ilo->render_condition.query,
+ wait, (union pipe_query_result *) &result))
+ return ((bool) result == ilo->render_condition.condition);
+ else
+ return false;
+}
+
static void
ilo_context_destroy(struct pipe_context *pipe)
{
ilo->base.destroy = ilo_context_destroy;
ilo->base.flush = ilo_flush;
+ ilo->base.render_condition = ilo_render_condition;
ilo_init_3d_functions(ilo);
ilo_init_query_functions(ilo);
struct u_upload_mgr *uploader;
struct ilo_state_vector state_vector;
+
+ struct {
+ struct pipe_query *query;
+ bool condition;
+ unsigned mode;
+ } render_condition;
};
static inline struct ilo_context *
void
ilo_init_context_functions(struct ilo_screen *is);
+bool
+ilo_skip_rendering(struct ilo_context *ilo);
+
#endif /* ILO_CONTEXT_H */