diff --git a/src/panfrost/genxml/common.xml b/src/panfrost/genxml/common.xml index 11bd5fc22c1..ce74baa49d0 100644 --- a/src/panfrost/genxml/common.xml +++ b/src/panfrost/genxml/common.xml @@ -122,4 +122,11 @@ + + + + + + + diff --git a/src/panfrost/lib/pan_earlyzs.c b/src/panfrost/lib/pan_earlyzs.c index 6647409c2c3..6a5c467d216 100644 --- a/src/panfrost/lib/pan_earlyzs.c +++ b/src/panfrost/lib/pan_earlyzs.c @@ -21,21 +21,24 @@ * SOFTWARE. */ +#include "genxml/gen_macros.h" + #include "pan_earlyzs.h" #include "panfrost/util/pan_ir.h" + /* * Return an "early" mode. If it is known that the depth/stencil tests always * pass (so the shader is always executed), weak early is usually faster than * force early. */ -static enum pan_earlyzs +static enum mali_pixel_kill best_early_mode(bool zs_always_passes, bool force_early) { if (zs_always_passes && !force_early) - return PAN_EARLYZS_WEAK_EARLY; + return MALI_PIXEL_KILL_WEAK_EARLY; else - return PAN_EARLYZS_FORCE_EARLY; + return MALI_PIXEL_KILL_FORCE_EARLY; } /* @@ -121,9 +124,9 @@ analyze(const struct pan_shader_info *s, bool writes_zs_or_oq, /* Collect results */ return (struct pan_earlyzs_state){ .update = late_update - ? PAN_EARLYZS_FORCE_LATE + ? MALI_PIXEL_KILL_FORCE_LATE : best_early_mode(zs_always_passes, force_early_update), - .kill = late_kill ? PAN_EARLYZS_FORCE_LATE + .kill = late_kill ? MALI_PIXEL_KILL_FORCE_LATE : best_early_mode(zs_always_passes, force_early_kill), .shader_readonly_zs = optimize_shader_read_only_zs, }; diff --git a/src/panfrost/lib/pan_earlyzs.h b/src/panfrost/lib/pan_earlyzs.h index c4446bbdfde..3e2649da04b 100644 --- a/src/panfrost/lib/pan_earlyzs.h +++ b/src/panfrost/lib/pan_earlyzs.h @@ -30,20 +30,13 @@ extern "C" { #endif -/* Matches hardware Pixel Kill enum on Bifrost and Valhall */ -enum pan_earlyzs { - PAN_EARLYZS_FORCE_EARLY = 0, - PAN_EARLYZS_WEAK_EARLY = 2, - PAN_EARLYZS_FORCE_LATE = 3 -}; - /* Early-ZS pair. */ struct pan_earlyzs_state { /* Z/S test and update */ - enum pan_earlyzs update : 2; + unsigned update : 2; /* Pixel kill */ - enum pan_earlyzs kill : 2; + unsigned kill : 2; /* True if the shader read-only ZS optimization should be enabled */ bool shader_readonly_zs : 1; diff --git a/src/panfrost/lib/tests/test-earlyzs.cpp b/src/panfrost/lib/tests/test-earlyzs.cpp index 703dbc8ae8b..55b667b4696 100644 --- a/src/panfrost/lib/tests/test-earlyzs.cpp +++ b/src/panfrost/lib/tests/test-earlyzs.cpp @@ -23,6 +23,7 @@ #include "util/pan_ir.h" #include "pan_earlyzs.h" +#include "genxml/gen_macros.h" #include @@ -48,7 +49,7 @@ #define ARCH_HAS_STATE_TRACK_OPT BITFIELD_BIT(11) static void -test(enum pan_earlyzs expected_update, enum pan_earlyzs expected_kill, +test(enum mali_pixel_kill expected_update, enum mali_pixel_kill expected_kill, bool expected_shader_readonly_zs, uint32_t flags) { enum pan_earlyzs_zs_tilebuf_read zs_read = PAN_EARLYZS_ZS_TILEBUF_NOT_READ; @@ -84,11 +85,11 @@ test(enum pan_earlyzs expected_update, enum pan_earlyzs expected_kill, } #define CASE(expected_update, expected_kill, flags) \ - test(PAN_EARLYZS_##expected_update, PAN_EARLYZS_##expected_kill, false, \ + test(MALI_PIXEL_KILL_##expected_update, MALI_PIXEL_KILL_##expected_kill, false, \ flags) #define CASE_RO_ZS(expected_update, expected_kill, expected_ro_zs, flags) \ - test(PAN_EARLYZS_##expected_update, PAN_EARLYZS_##expected_kill, \ + test(MALI_PIXEL_KILL_##expected_update, MALI_PIXEL_KILL_##expected_kill, \ expected_ro_zs, flags) TEST(EarlyZS, APIForceEarly)