summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2021-06-14 11:30:33 -0700
committerChia-I Wu <olvaffe@gmail.com>2021-07-01 11:55:48 -0700
commitd67cfcbd010d184d607df597e97fba1c4b213507 (patch)
tree7320a80b4a2c85765474628002c574f9a2aac255
parent49ca1883d40282a5abb631ea144c347b1b46777b (diff)
vkr: add a meson option to enable the validation layer
With -Dvenus-validation=true, vkr will enable the validation layer by setting ctx->validate_level = VKR_CONTEXT_VALIDATE_ON; ctx->validate_fatal = false; We would like to set ctx->validate_fatal to true, but even vulkaninfo has validation errors. We should create a list of VUIDs that are considered non-fatal before we can set ctx->validate_fatal to true. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
-rw-r--r--config.h.meson1
-rw-r--r--meson.build5
-rw-r--r--meson_options.txt7
-rw-r--r--src/vkr_renderer.c11
4 files changed, 22 insertions, 2 deletions
diff --git a/config.h.meson b/config.h.meson
index def3150..a16796f 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -5,6 +5,7 @@
#mesondefine HAVE_EPOXY_GLX_H
#mesondefine ENABLE_MINIGBM_ALLOCATION
#mesondefine ENABLE_VENUS
+#mesondefine ENABLE_VENUS_VALIDATE
#mesondefine HAVE_FUNC_ATTRIBUTE_VISIBILITY
#mesondefine HAVE_EVENTFD_H
#mesondefine HAVE_DLFCN_H
diff --git a/meson.build b/meson.build
index 2ccc20a..9c878bd 100644
--- a/meson.build
+++ b/meson.build
@@ -203,9 +203,14 @@ if with_glx
endif
with_venus = get_option('venus-experimental')
+with_venus_validate = get_option('venus-validate')
if with_venus
venus_dep = dependency('vulkan')
conf_data.set('ENABLE_VENUS', 1)
+
+ if with_venus_validate
+ conf_data.set('ENABLE_VENUS_VALIDATE', 1)
+ endif
endif
if cc.compiles('void __attribute__((hidden)) func() {}')
diff --git a/meson_options.txt b/meson_options.txt
index ddcd44b..52b8df4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -46,6 +46,13 @@ option(
)
option(
+ 'venus-validate',
+ type : 'boolean',
+ value : 'false',
+ description : 'enable the validation layer for venus'
+)
+
+option(
'tests',
type : 'boolean',
value : 'false',
diff --git a/src/vkr_renderer.c b/src/vkr_renderer.c
index 040b6a9..9138e8f 100644
--- a/src/vkr_renderer.c
+++ b/src/vkr_renderer.c
@@ -4742,8 +4742,15 @@ vkr_context_create(size_t debug_len, const char *debug_name)
memcpy(ctx->debug_name, debug_name, debug_len);
ctx->debug_name[debug_len] = '\0';
- ctx->validate_level =
- VKR_DEBUG(VALIDATE) ? VKR_CONTEXT_VALIDATE_FULL : VKR_CONTEXT_VALIDATE_NONE;
+#ifdef ENABLE_VENUS_VALIDATE
+ ctx->validate_level = VKR_CONTEXT_VALIDATE_ON;
+ ctx->validate_fatal = false; /* TODO set this to true */
+#else
+ ctx->validate_level = VKR_CONTEXT_VALIDATE_NONE;
+ ctx->validate_fatal = false;
+#endif
+ if (VKR_DEBUG(VALIDATE))
+ ctx->validate_level = VKR_CONTEXT_VALIDATE_FULL;
if (mtx_init(&ctx->mutex, mtx_plain) != thrd_success) {
free(ctx->debug_name);