vt->postfix.shared_memory = batch->framebuffer.gpu;
}
+void
+panfrost_vt_update_rasterizer(struct panfrost_context *ctx,
+ struct midgard_payload_vertex_tiler *tp)
+{
+ struct panfrost_rasterizer *rasterizer = ctx->rasterizer;
+
+ tp->gl_enables |= 0x7;
+ SET_BIT(tp->gl_enables, MALI_FRONT_CCW_TOP,
+ rasterizer && rasterizer->base.front_ccw);
+ SET_BIT(tp->gl_enables, MALI_CULL_FACE_FRONT,
+ rasterizer && (rasterizer->base.cull_face & PIPE_FACE_FRONT));
+ SET_BIT(tp->gl_enables, MALI_CULL_FACE_BACK,
+ rasterizer && (rasterizer->base.cull_face & PIPE_FACE_BACK));
+ SET_BIT(tp->prefix.unknown_draw, MALI_DRAW_FLATSHADE_FIRST,
+ rasterizer && rasterizer->base.flatshade_first);
+
+ if (!panfrost_writes_point_size(ctx)) {
+ bool points = tp->prefix.draw_mode == MALI_POINTS;
+ float val = 0.0f;
+
+ if (rasterizer)
+ val = points ?
+ rasterizer->base.point_size :
+ rasterizer->base.line_width;
+
+ tp->primitive_size.constant = val;
+ }
+}
+
void
panfrost_vt_update_occlusion_query(struct panfrost_context *ctx,
struct midgard_payload_vertex_tiler *tp)
panfrost_vt_attach_framebuffer(struct panfrost_context *ctx,
struct midgard_payload_vertex_tiler *vt);
+void
+panfrost_vt_update_rasterizer(struct panfrost_context *ctx,
+ struct midgard_payload_vertex_tiler *tp);
+
void
panfrost_vt_update_occlusion_query(struct panfrost_context *ctx,
struct midgard_payload_vertex_tiler *tp);
if (ctx->rasterizer) {
bool msaa = ctx->rasterizer->base.multisample;
- ctx->payloads[PIPE_SHADER_FRAGMENT].gl_enables = ctx->rasterizer->tiler_gl_enables;
/* TODO: Sample size */
SET_BIT(ctx->fragment_shader_core.unknown2_3, MALI_HAS_MSAA, msaa);
panfrost_batch_set_requirements(batch);
+ panfrost_vt_update_rasterizer(ctx, &ctx->payloads[PIPE_SHADER_FRAGMENT]);
panfrost_vt_update_occlusion_query(ctx, &ctx->payloads[PIPE_SHADER_FRAGMENT]);
panfrost_patch_shader_state(ctx, PIPE_SHADER_VERTEX);
panfrost_emit_shader_meta(batch, PIPE_SHADER_VERTEX,
&ctx->payloads[PIPE_SHADER_VERTEX]);
- if (ctx->shader[PIPE_SHADER_VERTEX] && ctx->shader[PIPE_SHADER_FRAGMENT]) {
- /* Check if we need to link the gl_PointSize varying */
- if (!panfrost_writes_point_size(ctx)) {
- /* If the size is constant, write it out. Otherwise,
- * don't touch primitive_size (since we would clobber
- * the pointer there) */
-
- bool points = ctx->payloads[PIPE_SHADER_FRAGMENT].prefix.draw_mode == MALI_POINTS;
-
- ctx->payloads[PIPE_SHADER_FRAGMENT].primitive_size.constant = points ?
- ctx->rasterizer->base.point_size :
- ctx->rasterizer->base.line_width;
- }
- }
-
if (ctx->shader[PIPE_SHADER_FRAGMENT]) {
struct panfrost_shader_state *variant = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
so->base = *cso;
- /* Bitmask, unknown meaning of the start value. 0x105 on 32-bit T6XX */
- so->tiler_gl_enables = 0x7;
-
- if (cso->front_ccw)
- so->tiler_gl_enables |= MALI_FRONT_CCW_TOP;
-
- if (cso->cull_face & PIPE_FACE_FRONT)
- so->tiler_gl_enables |= MALI_CULL_FACE_FRONT;
-
- if (cso->cull_face & PIPE_FACE_BACK)
- so->tiler_gl_enables |= MALI_CULL_FACE_BACK;
-
return so;
}