Index: src/gpu/vk/GrVkGpu.cpp |
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp |
index ab6761cc32b5ccda141ca310bdd8215ed9065ed8..0b3b14a4604017477ed77b79a12b6b750211a490 100644 |
--- a/src/gpu/vk/GrVkGpu.cpp |
+++ b/src/gpu/vk/GrVkGpu.cpp |
@@ -36,6 +36,10 @@ |
#include "vk/GrVkInterface.h" |
#include "vk/GrVkTypes.h" |
+#if USE_SKSL |
+#include "SkSLCompiler.h" |
+#endif |
+ |
#define VK_CALL(X) GR_VK_CALL(this->vkInterface(), X) |
#define VK_CALL_RET(RET, X) GR_VK_CALL_RET(this->vkInterface(), RET, X) |
#define VK_CALL_ERRCHECK(X) GR_VK_CALL_ERRCHECK(this->vkInterface(), X) |
@@ -110,7 +114,11 @@ GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, |
} |
#endif |
+#if USE_SKSL |
+ fCompiler = new SkSL::Compiler(); |
+#else |
fCompiler = shaderc_compiler_initialize(); |
+#endif |
fVkCaps.reset(new GrVkCaps(options, this->vkInterface(), backendCtx->fPhysicalDevice, |
backendCtx->fFeatures, backendCtx->fExtensions)); |
@@ -176,7 +184,11 @@ GrVkGpu::~GrVkGpu() { |
VK_CALL(DestroyCommandPool(fDevice, fCmdPool, nullptr)); |
+#if USE_SKSL |
+ delete fCompiler; |
+#else |
shaderc_compiler_release(fCompiler); |
+#endif |
#ifdef ENABLE_VK_LAYERS |
if (fCallback) { |