{
bool is_colour = loc >= FRAG_RESULT_DATA0;
- nir_shader *shader = nir_shader_create(NULL, MESA_SHADER_FRAGMENT, &midgard_nir_options, NULL);
- nir_function *fn = nir_function_create(shader, "main");
- nir_function_impl *impl = nir_function_impl_create(fn);
+ nir_builder _b;
+ nir_builder_init_simple_shader(&_b, NULL, MESA_SHADER_FRAGMENT, &midgard_nir_options);
+ nir_builder *b = &_b;
+ nir_shader *shader = b->shader;
nir_variable *c_src = nir_variable_create(shader, nir_var_shader_in, glsl_vector_type(GLSL_TYPE_FLOAT, 2), "coord");
nir_variable *c_out = nir_variable_create(shader, nir_var_shader_out, glsl_vector_type(
c_src->data.location = VARYING_SLOT_TEX0;
c_out->data.location = loc;
- nir_builder _b;
- nir_builder *b = &_b;
- nir_builder_init(b, impl);
- b->cursor = nir_before_block(nir_start_block(impl));
-
nir_ssa_def *coord = nir_load_var(b, c_src);
nir_tex_instr *tex = nir_tex_instr_create(shader, ms ? 3 : 1);
struct midgard_payload_vertex_tiler payload = {};
struct mali_primitive_packed primitive;
struct mali_draw_packed draw;
+ struct mali_invocation_packed invocation;
pan_pack(&draw, DRAW, cfg) {
cfg.unknown_1 = 0x7;
cfg.unknown_3 = 6;
}
- memcpy(&payload.prefix.primitive, &primitive, MALI_DRAW_LENGTH);
- memcpy(&payload.postfix, &draw, MALI_DRAW_LENGTH);
+ panfrost_pack_work_groups_compute(&invocation, 1, vertex_count, 1, 1, 1, 1, true);
- panfrost_pack_work_groups_compute(&payload.prefix, 1, vertex_count, 1, 1, 1, 1, true);
+ payload.prefix.primitive = primitive;
+ memcpy(&payload.postfix, &draw, MALI_DRAW_LENGTH);
+ payload.prefix.invocation = invocation;
panfrost_new_job(pool, scoreboard, MALI_JOB_TYPE_TILER, false, 0, &payload, sizeof(payload), true);
}