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>
macos/master
Chia-I Wu 4 years ago
parent 49ca1883d4
commit d67cfcbd01
  1. 1
      config.h.meson
  2. 5
      meson.build
  3. 7
      meson_options.txt
  4. 11
      src/vkr_renderer.c

@ -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

@ -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() {}')

@ -45,6 +45,13 @@ option(
description : 'enable support for venus'
)
option(
'venus-validate',
type : 'boolean',
value : 'false',
description : 'enable the validation layer for venus'
)
option(
'tests',
type : 'boolean',

@ -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);

Loading…
Cancel
Save