Commit 01c32ca8 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Demonstrate size pointer bit

parent 0903b00c
......@@ -1014,7 +1014,14 @@ struct midgard_payload_vertex_tiler {
struct mali_vertex_tiler_postfix postfix;
#ifdef T8XX
float line_width;
/* Point/line width can either be specified as a constant or as a
* varying. Which is used is controlled by unknown_draw & 0x100 (set
* for varying, clear for constant) */
union {
float line_width;
mali_ptr width_varying;
};
#endif
} __attribute__((packed));
......
......@@ -102,6 +102,7 @@ panfrost_shader_compile(struct panfrost_context *ctx, struct mali_shader_meta *m
meta->midgard1.work_count = program.work_register_count;
state->can_discard = program.can_discard;
state->writes_point_size = program.writes_point_size;
/* Separate as primary uniform count is truncated */
state->uniform_count = program.uniform_count;
......
......@@ -1064,6 +1064,22 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data)
vs->tripipe->texture_count = ctx->sampler_view_count[PIPE_SHADER_VERTEX];
vs->tripipe->sampler_count = ctx->sampler_count[PIPE_SHADER_VERTEX];
/* Set the flag allowing point size writes if we need that */
SET_BIT(ctx->payload_tiler.prefix.unknown_draw, 0x100, vs->writes_point_size);
if (vs->writes_point_size) {
struct panfrost_transfer transfer = panfrost_allocate_chunk(ctx, 64, HEAP_DESCRIPTOR);
uint16_t fs[] = {
_mesa_float_to_half(30.0),
_mesa_float_to_half(60.0),
_mesa_float_to_half(90.0)
};
memcpy(transfer.cpu, &fs, sizeof(fs));
ctx->payload_tiler.width_varying = transfer.gpu;
}
/* Who knows */
vs->tripipe->midgard1.unknown1 = 0x2201;
......@@ -1703,7 +1719,7 @@ panfrost_draw_vbo(
* rendering artefacts. It's not clear what these values mean yet. */
ctx->payload_tiler.prefix.unknown_draw &= ~(0x3000 | 0x18000);
ctx->payload_tiler.prefix.unknown_draw |= (ctx->vertex_count > 65535) ? 0x3000 : 0x18000;
ctx->payload_tiler.prefix.unknown_draw |= (info->mode == PIPE_PRIM_POINTS || ctx->vertex_count > 65535) ? 0x3000 : 0x18000;
if (info->index_size) {
/* Calculate the min/max index used so we can figure out how
......
......@@ -287,6 +287,7 @@ struct panfrost_shader_state {
/* Non-descript information */
int uniform_count;
bool can_discard;
bool writes_point_size;
/* Valid for vertex shaders only due to when this is calculated */
struct panfrost_varyings varyings;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment