config_host/config_skia.h.in          |    3 +++
 configure.ac                          |    9 +++++++++
 external/skia/share-grcontext.patch.1 |    2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 0e553976c29a84bdb5d2d8ee720e1901d9da77ac
Author:     Jonathan Clark <jonat...@libreoffice.org>
AuthorDate: Wed Dec 18 10:25:30 2024 -0700
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Dec 19 07:41:34 2024 +0100

    Added build option for Skia/Vulkan validation layers
    
    This change adds the --enable-skia-vulkan-validation build option. When
    this option is set, Skia will be built with Vulkan validation layers
    enabled. Vulkan validation layers must also be installed on the
    development machine (e.g. via the Windows Vulkan SDK, or the Ubuntu
    vulkan-validationlayers package).
    
    Vulkan validation layers are an important debugging tool for Vulkan
    application development. Validation layers externally verify that Vulkan
    API calls are correct and comply with the standard. This is particularly
    important as Vulkan does not require drivers to reject invalid uses;
    some hardware or drivers may tolerate certain developer mistakes, while
    other drivers reject them. Without using validation layers to confirm,
    this may create a false impression that certain hardware/drivers are
    faulty, when it is our own code at fault.
    
    Change-Id: If39a09e3d1043d37b465dd3cc5fcd8e5c364a1a2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178736
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/config_host/config_skia.h.in b/config_host/config_skia.h.in
index 602e18a3f67b..5fb8a1b8b57e 100644
--- a/config_host/config_skia.h.in
+++ b/config_host/config_skia.h.in
@@ -40,6 +40,9 @@ are the same.
 // Memory allocator for Vulkan.
 #define SK_USE_VMA 1
 
+// Enable Vulkan validation layers (set by configure).
+#undef SK_ENABLE_VK_LAYERS
+
 #define SK_CODEC_DECODES_PNG 1
 #define SK_ENCODE_PNG 1
 
diff --git a/configure.ac b/configure.ac
index 6859dfeb1e95..39391223a6f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1598,6 +1598,11 @@ libo_FUZZ_ARG_ENABLE(skia,
         [Disable building Skia. Use --enable-skia=debug to build without 
optimizations.])
 )
 
+libo_FUZZ_ARG_ENABLE(skia-vulkan-validation,
+    AS_HELP_STRING([--enable-skia-vulkan-validation],
+        [Enable Vulkan validation layers under Skia. The Vulkan SDK must be 
installed externally.])
+)
+
 ###############################################################################
 
 dnl ---------- *** ----------
@@ -12760,6 +12765,10 @@ if test "$enable_skia" != "no" -a "$build_skia" = 
"yes" -a -z "$DISABLE_GUI"; th
             SKIA_GPU=VULKAN
             AC_SUBST(SKIA_GPU)
         fi
+
+        if test "$enable_skia_vulkan_validation" = "yes"; then
+            AC_DEFINE(SK_ENABLE_VK_LAYERS,1)
+        fi
     else
         AC_MSG_RESULT([no (freetype too old)])
         add_warning "freetype version is too old for Skia library, at least 
2.8.1 required, Skia support disabled"
diff --git a/external/skia/share-grcontext.patch.1 
b/external/skia/share-grcontext.patch.1
index 20f410b48bc9..ce225bcbb6c7 100644
--- a/external/skia/share-grcontext.patch.1
+++ b/external/skia/share-grcontext.patch.1
@@ -568,7 +568,7 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
 -    if (fDebugCallback != VK_NULL_HANDLE) {
 -        fDestroyDebugReportCallbackEXT(fInstance, fDebugCallback, nullptr);
 +    if (fGlobalShared->fDebugCallback != VK_NULL_HANDLE) {
-+        
fGlobalShared->fDestroyDebugReportCallbackEXT(fGlobalShared->fInstance, 
fDebugCallback, nullptr);
++        
fGlobalShared->fDestroyDebugReportCallbackEXT(fGlobalShared->fInstance, 
fGlobalShared->fDebugCallback, nullptr);
      }
  #endif
 

Reply via email to