Remove emit_rectlist() and ILO_RENDER_RECTLIST indirections.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
ilo_draw_set_owner(ilo);
- max_len = ilo_render_estimate_size(ilo->render,
- ILO_RENDER_RECTLIST, ilo->blitter);
+ max_len = ilo_render_get_rectlist_len(ilo->render, ilo->blitter);
max_len += ilo_render_get_flush_len(ilo->render) * 2;
if (max_len > ilo_cp_space(ilo->cp)) {
assert(ilo_builder_batch_used(render->builder) <= batch_used +
ilo_render_get_query_len(render, q->type));
}
+
+int
+ilo_render_get_rectlist_len(const struct ilo_render *render,
+ const struct ilo_blitter *blitter)
+{
+ ILO_DEV_ASSERT(render->dev, 6, 7.5);
+
+ return ilo_render_get_rectlist_dynamic_states_len(render, blitter) +
+ ilo_render_get_rectlist_commands_len(render, blitter);
+}
+
+void
+ilo_render_emit_rectlist(struct ilo_render *render,
+ const struct ilo_blitter *blitter)
+{
+ ILO_DEV_ASSERT(render->dev, 6, 7.5);
+
+ ilo_render_emit_rectlist_dynamic_states(render, blitter);
+ ilo_render_emit_rectlist_commands(render, blitter);
+}
enum ilo_render_action {
ILO_RENDER_DRAW,
- ILO_RENDER_RECTLIST,
};
/**
void (*emit_draw)(struct ilo_render *render,
const struct ilo_state_vector *vec);
- void (*emit_rectlist)(struct ilo_render *render,
- const struct ilo_blitter *blitter);
-
bool hw_ctx_changed;
/*
render->emit_draw(render, vec);
}
-static inline void
-ilo_render_emit_rectlist(struct ilo_render *render,
- const struct ilo_blitter *blitter)
-{
- render->emit_rectlist(render, blitter);
-}
-
void
ilo_render_get_sample_position(const struct ilo_render *render,
unsigned sample_count,
ilo_render_emit_query(struct ilo_render *render,
struct ilo_query *q, uint32_t offset);
+int
+ilo_render_get_rectlist_len(const struct ilo_render *render,
+ const struct ilo_blitter *blitter);
+
+void
+ilo_render_emit_rectlist(struct ilo_render *render,
+ const struct ilo_blitter *blitter);
+
#endif /* ILO_RENDER_H */
#define ILO_RENDER_GEN_H
#include "ilo_common.h"
+#include "ilo_builder.h"
+#include "ilo_render.h"
struct ilo_blitter;
struct ilo_render;
};
int
+ilo_render_get_rectlist_commands_len_gen6(const struct ilo_render *render,
+ const struct ilo_blitter *blitter);
+
+static inline int
+ilo_render_get_rectlist_commands_len(const struct ilo_render *render,
+ const struct ilo_blitter *blitter)
+{
+ return ilo_render_get_rectlist_commands_len_gen6(render, blitter);
+}
+
+void
+ilo_render_emit_rectlist_commands_gen6(struct ilo_render *r,
+ const struct ilo_blitter *blitter);
+
+void
+ilo_render_emit_rectlist_commands_gen7(struct ilo_render *r,
+ const struct ilo_blitter *blitter);
+
+static inline void
+ilo_render_emit_rectlist_commands(struct ilo_render *render,
+ const struct ilo_blitter *blitter)
+{
+ const unsigned batch_used = ilo_builder_batch_used(render->builder);
+
+ if (ilo_dev_gen(render->dev) >= ILO_GEN(7))
+ ilo_render_emit_rectlist_commands_gen7(render, blitter);
+ else
+ ilo_render_emit_rectlist_commands_gen6(render, blitter);
+
+ assert(ilo_builder_batch_used(render->builder) <= batch_used +
+ ilo_render_get_rectlist_commands_len(render, blitter));
+}
+
+int
ilo_render_get_draw_dynamic_states_len(const struct ilo_render *render,
const struct ilo_state_vector *vec);
(1 << blitter->fb.num_samples) - 1);
}
-static void
-gen6_rectlist_commands(struct ilo_render *r,
- const struct ilo_blitter *blitter)
+int
+ilo_render_get_rectlist_commands_len_gen6(const struct ilo_render *render,
+ const struct ilo_blitter *blitter)
{
+ ILO_DEV_ASSERT(render->dev, 6, 7.5);
+
+ return 256;
+}
+
+void
+ilo_render_emit_rectlist_commands_gen6(struct ilo_render *r,
+ const struct ilo_blitter *blitter)
+{
+ ILO_DEV_ASSERT(r->dev, 6, 6);
+
gen6_wa_pre_non_pipelined(r);
gen6_rectlist_wm_multisample(r, blitter);
gen6_3DPRIMITIVE(r->builder, &blitter->draw, NULL);
}
-static void
-ilo_render_emit_rectlist_gen6(struct ilo_render *render,
- const struct ilo_blitter *blitter)
-{
- ilo_render_emit_rectlist_dynamic_states(render, blitter);
- gen6_rectlist_commands(render, blitter);
-}
-
static int
gen6_render_max_command_size(const struct ilo_render *render)
{
ilo_render_get_draw_surface_states_len(render, vec);
}
break;
- case ILO_RENDER_RECTLIST:
- {
- const struct ilo_blitter *blitter = arg;
-
- size = ilo_render_get_rectlist_dynamic_states_len(render, blitter);
- size += 256; /* commands */
- }
- break;
default:
assert(!"unknown render action");
size = 0;
{
render->estimate_size = ilo_render_estimate_size_gen6;
render->emit_draw = ilo_render_emit_draw_gen6;
- render->emit_rectlist = ilo_render_emit_rectlist_gen6;
}
(1 << blitter->fb.num_samples) - 1, blitter->fb.num_samples);
}
-static void
-gen7_rectlist_commands(struct ilo_render *r,
- const struct ilo_blitter *blitter)
+void
+ilo_render_emit_rectlist_commands_gen7(struct ilo_render *r,
+ const struct ilo_blitter *blitter)
{
+ ILO_DEV_ASSERT(r->dev, 7, 7.5);
+
gen7_rectlist_wm_multisample(r, blitter);
gen6_state_base_address(r->builder, true);
gen7_3DPRIMITIVE(r->builder, &blitter->draw, NULL);
}
-static void
-ilo_render_emit_rectlist_gen7(struct ilo_render *render,
- const struct ilo_blitter *blitter)
-{
- ilo_render_emit_rectlist_dynamic_states(render, blitter);
- gen7_rectlist_commands(render, blitter);
-}
-
static int
gen7_render_max_command_size(const struct ilo_render *render)
{
ilo_render_get_draw_surface_states_len(render, vec);
}
break;
- case ILO_RENDER_RECTLIST:
- {
- const struct ilo_blitter *blitter = arg;
-
- size = ilo_render_get_rectlist_dynamic_states_len(render, blitter);
- size += 256; /* commands */
- }
- break;
default:
assert(!"unknown render action");
size = 0;
{
render->estimate_size = ilo_render_estimate_size_gen7;
render->emit_draw = ilo_render_emit_draw_gen7;
- render->emit_rectlist = ilo_render_emit_rectlist_gen7;
}