turnip: replace TU_DEBUG_DONT_CARE_AS_LOAD by a bool

Instead of using TU_DEBUG=dontcare_as_load, it can still be overriden
using vk_dont_care_as_load=true.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20946>
This commit is contained in:
Chia-I Wu 2023-01-26 09:36:07 -08:00 committed by Marge Bot
parent c0122b81a4
commit 511c42ef4e
3 changed files with 6 additions and 6 deletions

View file

@ -407,7 +407,6 @@ static const struct debug_control tu_debug_options[] = {
{ "perfc", TU_DEBUG_PERFC },
{ "flushall", TU_DEBUG_FLUSHALL },
{ "syncdraw", TU_DEBUG_SYNCDRAW },
{ "dontcare_as_load", TU_DEBUG_DONT_CARE_AS_LOAD },
{ "rast_order", TU_DEBUG_RAST_ORDER },
{ "unaligned_store", TU_DEBUG_UNALIGNED_STORE },
{ "log_skip_gmem_ops", TU_DEBUG_LOG_SKIP_GMEM_OPS },
@ -451,9 +450,8 @@ tu_init_dri_options(struct tu_instance *instance)
instance->vk.app_info.app_name, instance->vk.app_info.app_version,
instance->vk.app_info.engine_name, instance->vk.app_info.engine_version);
if (driQueryOptionb(&instance->dri_options, "vk_dont_care_as_load"))
instance->debug_flags |= TU_DEBUG_DONT_CARE_AS_LOAD;
instance->dont_care_as_load =
driQueryOptionb(&instance->dri_options, "vk_dont_care_as_load");
instance->conservative_lrz =
!driQueryOptionb(&instance->dri_options, "disable_conservative_lrz");
}

View file

@ -48,7 +48,7 @@ enum tu_debug_flags
TU_DEBUG_PERFC = 1 << 9,
TU_DEBUG_FLUSHALL = 1 << 10,
TU_DEBUG_SYNCDRAW = 1 << 11,
TU_DEBUG_DONT_CARE_AS_LOAD = 1 << 12,
/* bit 12 is available */
TU_DEBUG_GMEM = 1 << 13,
TU_DEBUG_RAST_ORDER = 1 << 14,
TU_DEBUG_UNALIGNED_STORE = 1 << 15,
@ -150,6 +150,8 @@ struct tu_instance
enum tu_debug_flags debug_flags;
bool dont_care_as_load;
/* 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

View file

@ -684,7 +684,7 @@ attachment_set_ops(struct tu_device *device,
VkAttachmentStoreOp store_op,
VkAttachmentStoreOp stencil_store_op)
{
if (device->instance->debug_flags & TU_DEBUG_DONT_CARE_AS_LOAD) {
if (unlikely(device->instance->dont_care_as_load)) {
if (load_op == VK_ATTACHMENT_LOAD_OP_DONT_CARE)
load_op = VK_ATTACHMENT_LOAD_OP_LOAD;
if (stencil_load_op == VK_ATTACHMENT_LOAD_OP_DONT_CARE)