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

Unified Diff: site/user/special/vulkan.md

Issue 2318603002: Update Vulkan docs (Closed)
Patch Set: more Created 4 years, 3 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
« include/gpu/GrTypes.h ('K') | « include/gpu/GrTypes.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: site/user/special/vulkan.md
diff --git a/site/user/special/vulkan.md b/site/user/special/vulkan.md
index 740df29de67957e87557f641503606ecdabaeb0e..8dc11b692ef0f2ea469ff6b12489cf89de521323 100644
--- a/site/user/special/vulkan.md
+++ b/site/user/special/vulkan.md
@@ -1,20 +1,39 @@
-Building the Vulkan backend
-===========================
+Vulkan
+======
-Introduction
-------------
+Skis has a Vulkan implementation of its GPU backend. The Vulkan backend can be built alongside the OpenGL backend. The client can select between the OpenGL and Vulkan implementation at runtime. The Vulkan backend has reached feature parity with the OpenGL backend. At this time we find that many Vulkan drivers have bugs that Skia triggers for which we have no workaround. We are reporting bugs to vendors as we find them.
-The Vulkan backend is experimental and not built by default. It currently replaces the 'gpu' config in the dm tool rather than running in addition to OpenGL. Vulkan has been built on Windows and Linux.
+Build for Windows and Linux
+--------------------------------
+To build the Vulkan backend add skia_vulkan to your GYP_DEFINES:
-Details
--------
+<!--?prettify lang=sh?-->
+ export GYP_DEFINES="$GYP_DEFINES skia_vulkan=1"
jvanverth1 2016/09/06 14:09:00 Don't we need skia_arch_width=64 skia_arch_type=x8
bsalomon 2016/09/06 14:27:47 Do we only support vulkan for 64bit builds?
-Add `skia_vulkan=1` to your `GYP_DEFINES` environment variable. Ensure cmake is installed and in your path. On Windows install the prebuilt cmake from https://cmake.org/download/. The Vulkan SDK must also be installed.
+The Vulkan SDK must be installed and the VULKAN_SDK environment variable must point to the installation location.
egdaniel 2016/09/06 14:07:38 Not sure if its worth saying, but windows will set
bsalomon 2016/09/06 14:27:47 I'll add something about windows setting it up aut
-On Windows the 'msvs' gyp generator will not work. Use msvs-ninja for MSVS integration.
+Build as usual for your platform.
-Run:
- python gyp_skia
+Build for Android
+----------------------
+The Vulkan backend will run on a device running the N release with Vulkan drivers. To build the Vulkan backend simply add --vulkan to the flags passed to ./platform_tools/android/bin/android_ninja
+
+
+Using the Vulkan Backend
+------------------------
+
+To create a GrContext that is backend by Vulkan the client creates a Vulkan device and queue, initializes a GrVkBackendContext to describe the context, and then calls GrContext::Create:
jvanverth1 2016/09/06 14:09:00 backend -> backed
bsalomon 2016/09/06 14:27:47 Done.
+
+<!--?prettify lang=c++?-->
+ sk_sp<GrVkBackendContext> vkContext = new GrVkBackendContext;
+ vkBackendContext.fInstance = vkInstance;
+ vkBackendContext.fPhysicalDevice = vkPhysDevice;
+ ...
+ vkBackendContext.fInteface.reset(GrVkCreateInterface(instance, vkPhysDevice, extensionFlags);
bsalomon 2016/09/06 13:52:42 Should/do we require the client to create this GrV
egdaniel 2016/09/06 14:07:38 I guess it is left like this so that it could be u
jvanverth1 2016/09/06 14:09:00 fInterface.reset(). And I'm not sure on the need f
bsalomon 2016/09/06 14:27:47 Fixed the spelling. I see Greg's point about custo
jvanverth1 2016/09/06 14:32:53 The client is filling in the rest of the struct --
bsalomon 2016/09/06 16:01:52 I was thinking we'd store a GrVkInterface pointer
+ ...
+
+ sk_sp<GrContext> context = GrContext::Create(kVulkan_GrBackend, (GrBackendContext) vkContext);
+
+When using the Vulkan backend the GrBackendObject field in GrBackendRenderTargetDesc and GrBackendTextureDesc is interpeted as a pointer to a GrVkImageInfo object. GrVkImage specifies a VkImage and associated state (tiling, layout, format, etc). This allows the client to import externally created Vulkan images as destinations for Skia rendering via SkSurface factory functions or for to composite Skia rendered content using SkImage::getTextureHandle().
egdaniel 2016/09/06 14:07:38 GrVkImageInfo
jvanverth1 2016/09/06 14:09:00 GrVkImageInfo specifies a VkImage [...]
bsalomon 2016/09/06 14:27:47 Done.
egdaniel 2016/09/06 14:07:39 Should we add the following to the doc or just lea
egdaniel 2016/09/06 14:21:57 Also should we add something along the lines of, "
bsalomon 2016/09/06 14:27:47 Done.
-and build Skia as usual.
« include/gpu/GrTypes.h ('K') | « include/gpu/GrTypes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698