| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrVkGpu_DEFINED | 8 #ifndef GrVkGpu_DEFINED |
| 9 #define GrVkGpu_DEFINED | 9 #define GrVkGpu_DEFINED |
| 10 | 10 |
| 11 #define USE_SKSL 1 | 11 #define USE_SKSL 1 |
| 12 | 12 |
| 13 #include "GrGpu.h" | 13 #include "GrGpu.h" |
| 14 #include "GrGpuFactory.h" | 14 #include "GrGpuFactory.h" |
| 15 #include "vk/GrVkBackendContext.h" | 15 #include "vk/GrVkBackendContext.h" |
| 16 #include "GrVkCaps.h" | 16 #include "GrVkCaps.h" |
| 17 #include "GrVkCopyManager.h" |
| 17 #include "GrVkIndexBuffer.h" | 18 #include "GrVkIndexBuffer.h" |
| 18 #include "GrVkMemory.h" | 19 #include "GrVkMemory.h" |
| 19 #include "GrVkResourceProvider.h" | 20 #include "GrVkResourceProvider.h" |
| 20 #include "GrVkVertexBuffer.h" | 21 #include "GrVkVertexBuffer.h" |
| 21 #include "GrVkUtil.h" | 22 #include "GrVkUtil.h" |
| 22 | 23 |
| 23 #if USE_SKSL | 24 #if USE_SKSL |
| 24 namespace SkSL { | 25 namespace SkSL { |
| 25 class Compiler; | 26 class Compiler; |
| 26 } | 27 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 52 const GrVkInterface* vkInterface() const { return fBackendContext->fInterfac
e; } | 53 const GrVkInterface* vkInterface() const { return fBackendContext->fInterfac
e; } |
| 53 const GrVkCaps& vkCaps() const { return *fVkCaps; } | 54 const GrVkCaps& vkCaps() const { return *fVkCaps; } |
| 54 | 55 |
| 55 VkDevice device() const { return fDevice; } | 56 VkDevice device() const { return fDevice; } |
| 56 VkQueue queue() const { return fQueue; } | 57 VkQueue queue() const { return fQueue; } |
| 57 VkCommandPool cmdPool() const { return fCmdPool; } | 58 VkCommandPool cmdPool() const { return fCmdPool; } |
| 58 VkPhysicalDeviceMemoryProperties physicalDeviceMemoryProperties() const { | 59 VkPhysicalDeviceMemoryProperties physicalDeviceMemoryProperties() const { |
| 59 return fPhysDevMemProps; | 60 return fPhysDevMemProps; |
| 60 } | 61 } |
| 61 | 62 |
| 62 GrVkResourceProvider& resourceProvider() { return fResourceProvider; } | 63 GrVkResourceProvider& resourceProvider() { return fResourceProvider; } |
| 64 |
| 65 GrVkPrimaryCommandBuffer* currentCommandBuffer() { return fCurrentCmdBuffer;
} |
| 63 | 66 |
| 64 enum SyncQueue { | 67 enum SyncQueue { |
| 65 kForce_SyncQueue, | 68 kForce_SyncQueue, |
| 66 kSkip_SyncQueue | 69 kSkip_SyncQueue |
| 67 }; | 70 }; |
| 68 | 71 |
| 69 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh
t, size_t rowBytes, | 72 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh
t, size_t rowBytes, |
| 70 GrPixelConfig readConfig, DrawPreference*, | 73 GrPixelConfig readConfig, DrawPreference*, |
| 71 ReadPixelTempDrawInfo*) override; | 74 ReadPixelTempDrawInfo*) override; |
| 72 | 75 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 VkQueue fQueue; // Must be Graphics queue | 258 VkQueue fQueue; // Must be Graphics queue |
| 256 | 259 |
| 257 // Created by GrVkGpu | 260 // Created by GrVkGpu |
| 258 GrVkResourceProvider fResourceProvider; | 261 GrVkResourceProvider fResourceProvider; |
| 259 VkCommandPool fCmdPool; | 262 VkCommandPool fCmdPool; |
| 260 GrVkPrimaryCommandBuffer* fCurrentCmdBuffer; | 263 GrVkPrimaryCommandBuffer* fCurrentCmdBuffer; |
| 261 VkPhysicalDeviceMemoryProperties fPhysDevMemProps; | 264 VkPhysicalDeviceMemoryProperties fPhysDevMemProps; |
| 262 | 265 |
| 263 SkAutoTDelete<GrVkHeap> fHeaps[kHeapCount]; | 266 SkAutoTDelete<GrVkHeap> fHeaps[kHeapCount]; |
| 264 | 267 |
| 268 GrVkCopyManager fCopyManager; |
| 269 |
| 265 #ifdef SK_ENABLE_VK_LAYERS | 270 #ifdef SK_ENABLE_VK_LAYERS |
| 266 // For reporting validation layer errors | 271 // For reporting validation layer errors |
| 267 VkDebugReportCallbackEXT fCallback; | 272 VkDebugReportCallbackEXT fCallback; |
| 268 #endif | 273 #endif |
| 269 | 274 |
| 270 #if USE_SKSL | 275 #if USE_SKSL |
| 271 SkSL::Compiler* fCompiler; | 276 SkSL::Compiler* fCompiler; |
| 272 #else | 277 #else |
| 273 // Shaderc compiler used for compiling glsl in spirv. We only want to create
the compiler once | 278 // Shaderc compiler used for compiling glsl in spirv. We only want to create
the compiler once |
| 274 // since there is significant overhead to the first compile of any compiler. | 279 // since there is significant overhead to the first compile of any compiler. |
| 275 shaderc_compiler_t fCompiler; | 280 shaderc_compiler_t fCompiler; |
| 276 #endif | 281 #endif |
| 277 | 282 |
| 278 typedef GrGpu INHERITED; | 283 typedef GrGpu INHERITED; |
| 279 }; | 284 }; |
| 280 | 285 |
| 281 #endif | 286 #endif |
| OLD | NEW |