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

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: changed SkSLType to follow Vulkan spec 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 e5d24fc5806ff8044a55da6416b311f9c9bcb8f3..f15677580df7bc632e01c30b614acb49e60458dd 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) {

Powered by Google App Engine
This is Rietveld 408576698