Print image info
``info``
show GPU-related information
+ ``invariantgeom``
+ Mark geometry-affecting outputs as invariant. This works around a common
+ class of application bugs appearing as flickering.
``metashaders``
dump internal meta shaders
``nobinning``
RADV_DEBUG_HANG = 1u << 29,
RADV_DEBUG_IMG = 1u << 30,
RADV_DEBUG_NO_UMR = 1u << 31,
+ RADV_DEBUG_INVARIANT_GEOM = 1ull << 32,
};
enum {
{"hang", RADV_DEBUG_HANG},
{"img", RADV_DEBUG_IMG},
{"noumr", RADV_DEBUG_NO_UMR},
+ {"invariantgeom", RADV_DEBUG_INVARIANT_GEOM},
{NULL, 0}
};
hash_flags |= RADV_HASH_SHADER_DISCARD_TO_DEMOTE;
if (device->instance->enable_mrt_output_nan_fixup)
hash_flags |= RADV_HASH_SHADER_MRT_NAN_FIXUP;
+ if (device->instance->debug_flags & RADV_DEBUG_INVARIANT_GEOM)
+ hash_flags |= RADV_HASH_SHADER_INVARIANT_GEOM;
return hash_flags;
}
#define RADV_HASH_SHADER_LLVM (1 << 4)
#define RADV_HASH_SHADER_DISCARD_TO_DEMOTE (1 << 5)
#define RADV_HASH_SHADER_MRT_NAN_FIXUP (1 << 6)
+#define RADV_HASH_SHADER_INVARIANT_GEOM (1 << 7)
void
radv_hash_shaders(unsigned char *hash,
0, 0, "radv", message);
}
+static void
+mark_geom_invariant(nir_shader *nir)
+{
+ nir_foreach_shader_out_variable(var, nir) {
+ switch (var->data.location) {
+ case VARYING_SLOT_POS:
+ case VARYING_SLOT_PSIZ:
+ case VARYING_SLOT_CLIP_DIST0:
+ case VARYING_SLOT_CLIP_DIST1:
+ case VARYING_SLOT_CULL_DIST0:
+ case VARYING_SLOT_CULL_DIST1:
+ case VARYING_SLOT_TESS_LEVEL_OUTER:
+ case VARYING_SLOT_TESS_LEVEL_INNER:
+ var->data.invariant = true;
+ break;
+ default:
+ break;
+ }
+ }
+}
+
static bool
lower_intrinsics(nir_shader *nir)
{
nir_var_shader_in | nir_var_shader_out | nir_var_system_value | nir_var_mem_shared,
NULL);
+ if (device->instance->debug_flags & RADV_DEBUG_INVARIANT_GEOM &&
+ stage != MESA_SHADER_FRAGMENT) {
+ mark_geom_invariant(nir);
+ }
+
NIR_PASS_V(nir, nir_propagate_invariant);
NIR_PASS_V(nir, nir_lower_system_values);