Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1383)

Unified Diff: src/gpu/vk/GrVkGpu.cpp

Issue 1984363002: initial checkin of SkSL compiler (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: documentation and cleanups Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/vk/GrVkGpu.cpp
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index f87a6f6fbd199b626d28eebc75f66b980f1760d5..41a3aa24d9f82acf8187ede09dadfb05f20f9412 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -35,6 +35,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)
@@ -109,7 +113,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));
@@ -148,7 +156,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) {

Powered by Google App Engine
This is Rietveld 408576698