tp->postfix.occlusion_counter = 0;
}
+void
+panfrost_vt_init(struct panfrost_context *ctx,
+ enum pipe_shader_type stage,
+ struct midgard_payload_vertex_tiler *vtp)
+{
+ if (!ctx->shader[stage])
+ return;
+
+ memset(vtp, 0, sizeof(*vtp));
+ vtp->gl_enables = 0x6;
+ panfrost_vt_attach_framebuffer(ctx, vtp);
+
+ if (stage == PIPE_SHADER_FRAGMENT) {
+ panfrost_vt_update_occlusion_query(ctx, vtp);
+ panfrost_vt_update_rasterizer(ctx, vtp);
+ }
+}
+
+
static unsigned
panfrost_translate_index_size(unsigned size)
{
void panfrost_sampler_desc_init(const struct pipe_sampler_state *cso,
struct mali_sampler_descriptor *hw);
+void
+panfrost_vt_init(struct panfrost_context *ctx,
+ enum pipe_shader_type stage,
+ struct midgard_payload_vertex_tiler *vtp);
+
void
panfrost_vt_attach_framebuffer(struct panfrost_context *ctx,
struct midgard_payload_vertex_tiler *vt);
if (info->input)
pipe->set_constant_buffer(pipe, PIPE_SHADER_COMPUTE, 0, &ubuf);
+ panfrost_vt_init(ctx, PIPE_SHADER_COMPUTE, payload);
+
panfrost_emit_shader_meta(batch, PIPE_SHADER_COMPUTE, payload);
panfrost_emit_const_buf(batch, PIPE_SHADER_COMPUTE, payload);
panfrost_emit_shared_memory(batch, info, payload);
void
panfrost_invalidate_frame(struct panfrost_context *ctx)
{
- for (unsigned i = 0; i < PIPE_SHADER_TYPES; ++i)
- ctx->payloads[i].postfix.shared_memory = 0;
-
/* TODO: When does this need to be handled? */
ctx->active_queries = true;
}
-/* In practice, every field of these payloads should be configurable
- * arbitrarily, which means these functions are basically catch-all's for
- * as-of-yet unwavering unknowns */
-
-static void
-panfrost_emit_vertex_payload(struct panfrost_context *ctx)
-{
- /* 0x2 bit clear on 32-bit T6XX */
-
- struct midgard_payload_vertex_tiler payload = {
- .gl_enables = 0x4 | 0x2,
- };
-
- /* Vertex and compute are closely coupled, so share a payload */
-
- memcpy(&ctx->payloads[PIPE_SHADER_VERTEX], &payload, sizeof(payload));
- memcpy(&ctx->payloads[PIPE_SHADER_COMPUTE], &payload, sizeof(payload));
-}
-
bool
panfrost_writes_point_size(struct panfrost_context *ctx)
{
unsigned vertex_count;
+ for (int i = 0; i <= PIPE_SHADER_FRAGMENT; ++i)
+ panfrost_vt_init(ctx, i, &ctx->payloads[i]);
+
panfrost_vt_set_draw_info(ctx, info, g2m_draw_mode(mode),
&ctx->payloads[PIPE_SHADER_VERTEX],
&ctx->payloads[PIPE_SHADER_FRAGMENT],
&vertex_count, &ctx->padded_count);
- for (int i = 0; i <= PIPE_SHADER_FRAGMENT; ++i)
- panfrost_vt_attach_framebuffer(ctx, &ctx->payloads[i]);
-
- panfrost_vt_update_rasterizer(ctx, &ctx->payloads[PIPE_SHADER_FRAGMENT]);
- panfrost_vt_update_occlusion_query(ctx, &ctx->payloads[PIPE_SHADER_FRAGMENT]);
-
panfrost_statistics_record(ctx, info);
/* Dispatch "compute jobs" for the vertex/tiler pair as (1,
/* Prepare for render! */
panfrost_batch_init(ctx);
- panfrost_emit_vertex_payload(ctx);
panfrost_invalidate_frame(ctx);
return gallium;