/* Separate as primary uniform count is truncated */
state->uniform_count = program.uniform_count;
- meta->midgard1.unknown2 = 8; /* XXX */
+ meta->midgard1.flags_hi = 8; /* XXX */
unsigned default_vec1_swizzle = panfrost_get_default_swizzle(1);
unsigned default_vec2_swizzle = panfrost_get_default_swizzle(2);
ss->tripipe->texture_count = ctx->sampler_view_count[stage];
ss->tripipe->sampler_count = ctx->sampler_count[stage];
- ss->tripipe->midgard1.flags = 0x220;
+ ss->tripipe->midgard1.flags_lo = 0x220;
unsigned ubo_count = panfrost_ubo_count(ctx, stage);
ss->tripipe->midgard1.uniform_buffer_count = ubo_count;
COPY(midgard1.uniform_count);
COPY(midgard1.uniform_buffer_count);
COPY(midgard1.work_count);
- COPY(midgard1.flags);
- COPY(midgard1.unknown2);
+ COPY(midgard1.flags_lo);
+ COPY(midgard1.flags_hi);
#undef COPY
/* Depending on whether it's legal to in the given shader, we
* try to enable early-z testing (or forward-pixel kill?) */
- SET_BIT(ctx->fragment_shader_core.midgard1.flags, MALI_EARLY_Z, !variant->can_discard);
+ SET_BIT(ctx->fragment_shader_core.midgard1.flags_lo, MALI_EARLY_Z, !variant->can_discard);
/* Any time texturing is used, derivatives are implicitly
* calculated, so we need to enable helper invocations */
- SET_BIT(ctx->fragment_shader_core.midgard1.flags, MALI_HELPER_INVOCATIONS, variant->helper_invocations);
+ SET_BIT(ctx->fragment_shader_core.midgard1.flags_lo, MALI_HELPER_INVOCATIONS, variant->helper_invocations);
/* Assign the stencil refs late */
*/
SET_BIT(ctx->fragment_shader_core.unknown2_3, MALI_CAN_DISCARD, variant->can_discard);
- SET_BIT(ctx->fragment_shader_core.midgard1.flags, 0x400, variant->can_discard);
+ SET_BIT(ctx->fragment_shader_core.midgard1.flags_lo, 0x400, variant->can_discard);
/* Even on MFBD, the shader descriptor gets blend shaders. It's
* *also* copied to the blend_meta appended (by convention),
#define MALI_ALPHA_COVERAGE(clampf) ((uint16_t) (int) (clampf * 15.0f))
#define MALI_GET_ALPHA_COVERAGE(nibble) ((float) nibble / 15.0f)
-/* Applies to midgard1.flags */
+/* Applies to midgard1.flags_lo */
+
+/* Should be set when the fragment shader updates the depth value. */
+#define MALI_WRITES_Z (1 << 4)
/* Should the hardware perform early-Z testing? Normally should be set
* for performance reasons. Clear if you use: discard,
#define MALI_READS_ZS (1 << 8)
#define MALI_READS_TILEBUFFER (1 << 12)
+/* Applies to midgard1.flags_hi */
+
+/* Should be set when the fragment shader updates the stencil value. */
+#define MALI_WRITES_S (1 << 2)
+
/* The raw Midgard blend payload can either be an equation or a shader
* address, depending on the context */
} bifrost1;
struct {
unsigned uniform_buffer_count : 4;
- unsigned flags : 12;
+ unsigned flags_lo : 12;
/* vec4 units */
unsigned work_count : 5;
unsigned uniform_count : 5;
- unsigned unknown2 : 6;
+ unsigned flags_hi : 6;
} midgard1;
};
#undef FLAG_INFO
#define FLAG_INFO(flag) { MALI_##flag, "MALI_" #flag }
-static const struct pandecode_flag_info shader_midgard1_flag_info [] = {
+static const struct pandecode_flag_info shader_midgard1_flag_lo_info [] = {
+ FLAG_INFO(WRITES_Z),
FLAG_INFO(EARLY_Z),
FLAG_INFO(READS_TILEBUFFER),
FLAG_INFO(READS_ZS),
{}
};
+
+static const struct pandecode_flag_info shader_midgard1_flag_hi_info [] = {
+ FLAG_INFO(WRITES_S),
+ {}
+};
#undef FLAG_INFO
#define FLAG_INFO(flag) { MALI_MFBD_##flag, "MALI_MFBD_" #flag }
if (is_bifrost) {
pandecode_prop("bifrost1.unk1 = 0x%" PRIx32, s->bifrost1.unk1);
} else {
- bool helpers = s->midgard1.flags & MALI_HELPER_INVOCATIONS;
- s->midgard1.flags &= ~MALI_HELPER_INVOCATIONS;
+ bool helpers = s->midgard1.flags_lo & MALI_HELPER_INVOCATIONS;
+ s->midgard1.flags_lo &= ~MALI_HELPER_INVOCATIONS;
if (helpers != info.helper_invocations) {
pandecode_msg("XXX: expected helpers %u but got %u\n",
info.helper_invocations, helpers);
}
- pandecode_log(".midgard1.flags = ");
- pandecode_log_decoded_flags(shader_midgard1_flag_info, s->midgard1.flags);
+ pandecode_log(".midgard1.flags_lo = ");
+ pandecode_log_decoded_flags(shader_midgard1_flag_lo_info, s->midgard1.flags_lo);
pandecode_log_cont(",\n");
- pandecode_prop("midgard1.unknown2 = 0x%" PRIx32, s->midgard1.unknown2);
+ pandecode_log(".midgard1.flags_hi = ");
+ pandecode_log_decoded_flags(shader_midgard1_flag_hi_info, s->midgard1.flags_hi);
+ pandecode_log_cont(",\n");
}
if (s->depth_units || s->depth_factor) {