panfrost: XMLify draw_mode

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
This commit is contained in:
Alyssa Rosenzweig 2020-08-05 18:44:36 -04:00 committed by Tomeu Vizoso
parent 4b7056b8c8
commit 32dbc80979
6 changed files with 19 additions and 47 deletions

View file

@ -101,7 +101,7 @@ panfrost_vt_update_primitive_size(struct panfrost_context *ctx,
struct panfrost_rasterizer *rasterizer = ctx->rasterizer;
if (!panfrost_writes_point_size(ctx)) {
bool points = prefix->draw_mode == MALI_POINTS;
bool points = prefix->draw_mode == MALI_DRAW_MODE_POINTS;
float val = 0.0f;
if (rasterizer)

View file

@ -265,7 +265,7 @@ panfrost_texture_barrier(struct pipe_context *pipe, unsigned flags)
panfrost_flush_all_batches(ctx, 0);
}
#define DEFINE_CASE(c) case PIPE_PRIM_##c: return MALI_##c;
#define DEFINE_CASE(c) case PIPE_PRIM_##c: return MALI_DRAW_MODE_##c;
static int
g2m_draw_mode(enum pipe_prim_type mode)

View file

@ -38,22 +38,6 @@ typedef uint32_t u32;
typedef uint64_t u64;
typedef uint64_t mali_ptr;
enum mali_draw_mode {
MALI_DRAW_NONE = 0x0,
MALI_POINTS = 0x1,
MALI_LINES = 0x2,
MALI_LINE_STRIP = 0x4,
MALI_LINE_LOOP = 0x6,
MALI_TRIANGLES = 0x8,
MALI_TRIANGLE_STRIP = 0xA,
MALI_TRIANGLE_FAN = 0xC,
MALI_POLYGON = 0xD,
MALI_QUADS = 0xE,
MALI_QUAD_STRIP = 0xF,
/* All other modes invalid */
};
/* Applies to tiler_gl_enables */
#define MALI_OCCLUSION_QUERY (1 << 3)

View file

@ -464,32 +464,6 @@ static char *pandecode_format(enum mali_format format)
#undef DEFINE_CASE
static char *
pandecode_draw_mode(enum mali_draw_mode mode)
{
#define DEFINE_CASE(name) case MALI_ ## name: return "MALI_" #name
switch (mode) {
DEFINE_CASE(DRAW_NONE);
DEFINE_CASE(POINTS);
DEFINE_CASE(LINES);
DEFINE_CASE(TRIANGLES);
DEFINE_CASE(TRIANGLE_STRIP);
DEFINE_CASE(TRIANGLE_FAN);
DEFINE_CASE(LINE_STRIP);
DEFINE_CASE(LINE_LOOP);
DEFINE_CASE(POLYGON);
DEFINE_CASE(QUADS);
DEFINE_CASE(QUAD_STRIP);
default:
pandecode_msg("XXX: invalid draw mode %X\n", mode);
return "";
}
#undef DEFINE_CASE
}
#define DEFINE_CASE(name) case MALI_FUNC_ ## name: return "MALI_FUNC_" #name
static char *
pandecode_func(enum mali_func mode)
@ -2013,8 +1987,8 @@ pandecode_vertex_tiler_prefix(struct mali_vertex_tiler_prefix *p, int job_no, bo
pandecode_prop("workgroups_x_shift_3 = 0x%" PRIx32, p->workgroups_x_shift_3);
if (p->draw_mode != MALI_DRAW_NONE)
pandecode_prop("draw_mode = %s", pandecode_draw_mode(p->draw_mode));
if (p->draw_mode != MALI_DRAW_MODE_NONE)
pandecode_prop("draw_mode = %s", mali_draw_mode_as_str(p->draw_mode));
/* Index count only exists for tiler jobs anyway */

View file

@ -13,4 +13,18 @@
<value name="Fragment" value="9"/>
</enum>
<enum name="Draw Mode">
<value name="None" value="0"/>
<value name="Points" value="1"/>
<value name="Lines" value="2"/>
<value name="Line strip" value="4"/>
<value name="Line loop" value="6"/>
<value name="Triangles" value="8"/>
<value name="Triangle strip" value="10"/>
<value name="Triangle fan" value="12"/>
<value name="Polygon" value="13"/>
<value name="Quads" value="14"/>
<value name="Quad strip" value="15"/>
</enum>
</panxml>

View file

@ -346,7 +346,7 @@ panfrost_load_midg(
struct midgard_payload_vertex_tiler payload = {
.prefix = {
.draw_mode = MALI_TRIANGLES,
.draw_mode = MALI_DRAW_MODE_TRIANGLES,
.unknown_draw = 0x3000,
.index_count = MALI_POSITIVE(vertex_count)
},