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

Side by Side Diff: tools/vulkan/win/VulkanTestContext_win.cpp

Issue 1945103003: Rename VulkanViewer to Viewer, take 2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix android path Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « tools/vulkan/win/VulkanTestContext_win.h ('k') | tools/vulkan/win/Window_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2016 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9 #include "VulkanTestContext_win.h"
10
11 #include "vk/GrVkInterface.h"
12 #include "vk/GrVkUtil.h"
13
14 // Platform dependant call
15 VkSurfaceKHR VulkanTestContext::createVkSurface(VkInstance instance, void* platf ormData) {
16 static PFN_vkCreateWin32SurfaceKHR createWin32SurfaceKHR = nullptr;
17 if (!createWin32SurfaceKHR) {
18 createWin32SurfaceKHR = (PFN_vkCreateWin32SurfaceKHR)vkGetInstanceProcAd dr(instance,
19 "vkCrea teWin32SurfaceKHR");
20 }
21
22 if (!platformData) {
23 return VK_NULL_HANDLE;
24 }
25 ContextPlatformData_win* winPlatformData =
26 reinterpret_cast<ContextPlatformData_ win*>(platformData);
27 VkSurfaceKHR surface;
28
29 VkWin32SurfaceCreateInfoKHR surfaceCreateInfo;
30 memset(&surfaceCreateInfo, 0, sizeof(VkWin32SurfaceCreateInfoKHR));
31 surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;
32 surfaceCreateInfo.pNext = nullptr;
33 surfaceCreateInfo.flags = 0;
34 surfaceCreateInfo.hinstance = winPlatformData->fHInstance;
35 surfaceCreateInfo.hwnd = winPlatformData->fHWnd;
36
37 VkResult res = createWin32SurfaceKHR(instance, &surfaceCreateInfo, nullptr, &surface);
38 if (VK_SUCCESS != res) {
39 return VK_NULL_HANDLE;
40 }
41
42 return surface;
43 }
44
45 // Platform dependant call
46 bool VulkanTestContext::canPresent(VkInstance instance, VkPhysicalDevice physDev ,
47 uint32_t queueFamilyIndex) {
48 static PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR
49 getPhysicalDeviceWin32PresentationS upportKHR = nullptr;
50 if (!getPhysicalDeviceWin32PresentationSupportKHR) {
51 getPhysicalDeviceWin32PresentationSupportKHR =
52 (PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR) vkGetInstancePr ocAddr(instance,
53 "vkGetPhysicalDeviceWin32Prese ntationSupportKHR");
54 }
55
56 VkBool32 check = getPhysicalDeviceWin32PresentationSupportKHR(physDev, queue FamilyIndex);
57 return (VK_FALSE != check);
58 }
OLDNEW
« no previous file with comments | « tools/vulkan/win/VulkanTestContext_win.h ('k') | tools/vulkan/win/Window_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698