DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST(false)
DRI_CONF_VK_DONT_CARE_AS_LOAD(false)
DRI_CONF_SECTION_END
+
+ DRI_CONF_SECTION_MISCELLANEOUS
+ DRI_CONF_DISABLE_CONSERVATIVE_LRZ(false)
+ DRI_CONF_SECTION_END
};
static void
if (driQueryOptionb(&instance->dri_options, "vk_dont_care_as_load"))
instance->debug_flags |= TU_DEBUG_DONT_CARE_AS_LOAD;
+
+ instance->conservative_lrz =
+ !driQueryOptionb(&instance->dri_options, "disable_conservative_lrz");
}
VKAPI_ATTR VkResult VKAPI_CALL
struct driOptionCache available_dri_options;
enum tu_debug_flags debug_flags;
+
+ /* Conservative LRZ (default true) invalidates LRZ on draws with
+ * blend and depth-write enabled, because this can lead to incorrect
+ * rendering. Driconf can be used to disable conservative LRZ for
+ * games which do not have the problematic sequence of draws *and*
+ * suffer a performance loss with conservative LRZ.
+ */
+ bool conservative_lrz;
};
VK_DEFINE_HANDLE_CASTS(tu_instance, vk.base, VkInstance,
VK_OBJECT_TYPE_INSTANCE)
* enable LRZ write. But this would cause early-z/lrz to discard
* fragments from draw A which should be visible due to draw B.
*/
- if (reads_dest && z_write_enable) {
+ if (reads_dest && z_write_enable && cmd->device->instance->conservative_lrz) {
perf_debug(cmd->device, "Invalidating LRZ due to blend+depthwrite");
disable_lrz = true;
}
screen = fd_drm_screen_create(fd, NULL, config);
return screen ? debug_screen_wrap(screen) : NULL;
}
-DRM_DRIVER_DESCRIPTOR(msm, NULL, 0)
+
+const driOptionDescription msm_driconf[] = {
+#ifdef GALLIUM_FREEDRENO
+ #include "freedreno/driinfo_freedreno.h"
+#endif
+};
+DRM_DRIVER_DESCRIPTOR(msm, msm_driconf, ARRAY_SIZE(msm_driconf))
+DRM_DRIVER_DESCRIPTOR_ALIAS(msm, kgsl, msm_driconf, ARRAY_SIZE(msm_driconf))
#else
DRM_DRIVER_DESCRIPTOR_STUB(msm)
+DRM_DRIVER_DESCRIPTOR_STUB(kgsl)
#endif
-DRM_DRIVER_DESCRIPTOR_ALIAS(msm, kgsl, NULL, 0)
#if defined(GALLIUM_VIRGL) || (defined(GALLIUM_FREEDRENO) && !defined(PIPE_LOADER_DYNAMIC))
#include "virgl/drm/virgl_drm_public.h"
}
const driOptionDescription virgl_driconf[] = {
-#ifdef GALLIUM_VIRGL
#include "virgl/virgl_driinfo.h.in"
-#endif
};
DRM_DRIVER_DESCRIPTOR(virtio_gpu, virgl_driconf, ARRAY_SIZE(virgl_driconf))
* Normally looking at the state in draw C, we'd assume we could
* enable LRZ write. But this would cause early-z/lrz to discard
* fragments from draw A which should be visible due to draw B.
- *
- * NOTE: So far invalid rendering due to this case has only been
- * found in a single game (The Walking Dead: Season One -
- * com.telltalegames.walkingdead100). But other Telltale Games
- * use the same Telltale Tool engine, so they might also have the
- * same issue. But blend+depthwrite is more common. Hopefully
- * it only shows up late in the renderpass where invalidating LRZ
- * would not be too costly, but if this is found to cause perf
- * regressions, a driconf allowlist/denylist can be added.
*/
- if (reads_dest && zsa->writes_z) {
+ if (reads_dest && zsa->writes_z && ctx->screen->conservative_lrz) {
if (!zsa->perf_warn_blend && rsc->lrz_valid) {
perf_debug_ctx(ctx, "Invalidating LRZ due to blend+depthwrite");
zsa->perf_warn_blend = true;
--- /dev/null
+// freedreno specific driconf options
+
+DRI_CONF_SECTION_MISCELLANEOUS
+ DRI_CONF_DISABLE_CONSERVATIVE_LRZ(false)
+DRI_CONF_SECTION_END
driParseConfigFiles(config->options, config->options_info, 0, "msm",
NULL, fd_dev_name(screen->dev_id), NULL, 0, NULL, 0);
+ screen->conservative_lrz =
+ !driQueryOptionb(config->options, "disable_conservative_lrz");
+
struct sysinfo si;
sysinfo(&si);
screen->ram_size = si.totalram;
bool has_robustness;
bool has_syncobj;
+ /* Conservative LRZ (default true) invalidates LRZ on draws with
+ * blend and depth-write enabled, because this can lead to incorrect
+ * rendering. Driconf can be used to disable conservative LRZ for
+ * games which do not have the problematic sequence of draws *and*
+ * suffer a performance loss with conservative LRZ.
+ */
+ bool conservative_lrz;
+
const struct fd_dev_info *info;
uint32_t ccu_offset_gmem;
uint32_t ccu_offset_bypass;
# SOFTWARE.
files_libfreedreno = files(
+ 'driinfo_freedreno.h',
'freedreno_autotune.c',
'freedreno_autotune.h',
'freedreno_batch.c',
DRI_CONF_GLES_EMULATE_BGRA(true)
DRI_CONF_GLES_APPLY_BGRA_DEST_SWIZZLE(true)
DRI_CONF_GLES_SAMPLES_PASSED_VALUE(1024, 1, 400000000)
+
+ /*
+ * Native-context drivers also (can) bind to the some virtio_gpu guest
+ * kernel device. Because drm_helper ties the driconf config to the
+ * drm device name, we also need to include config options for any
+ * possible drm-native-context guest driver:
+ */
+ DRI_CONF_DISABLE_CONSERVATIVE_LRZ(false)
DRI_CONF_SECTION_END
"Force-enable reading back L8_SRGB textures")
/**
+ * \brief freedreno specific configuration options
+ */
+
+#define DRI_CONF_DISABLE_CONSERVATIVE_LRZ(def) \
+ DRI_CONF_OPT_B(disable_conservative_lrz, def, \
+ "Disable conservative LRZ")
+
+/**
* \brief venus specific configuration options
*/
#define DRI_CONF_VENUS_IMPLICIT_FENCING(def) \