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

Side by Side Diff: src/gpu/vk/GrVkGpu.h

Issue 1984363002: initial checkin of SkSL compiler (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: more 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 unified diff | Download patch
OLDNEW
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
12
11 #include "GrGpu.h" 13 #include "GrGpu.h"
12 #include "GrGpuFactory.h" 14 #include "GrGpuFactory.h"
13 #include "vk/GrVkBackendContext.h" 15 #include "vk/GrVkBackendContext.h"
14 #include "GrVkCaps.h" 16 #include "GrVkCaps.h"
15 #include "GrVkIndexBuffer.h" 17 #include "GrVkIndexBuffer.h"
16 #include "GrVkMemory.h" 18 #include "GrVkMemory.h"
17 #include "GrVkResourceProvider.h" 19 #include "GrVkResourceProvider.h"
18 #include "GrVkVertexBuffer.h" 20 #include "GrVkVertexBuffer.h"
19 #include "GrVkUtil.h" 21 #include "GrVkUtil.h"
20 22
23 #if USE_SKSL
24 namespace SkSL {
25 class Compiler;
26 }
27 #else
21 #include "shaderc/shaderc.h" 28 #include "shaderc/shaderc.h"
29 #endif
30
22 #include "vk/GrVkDefines.h" 31 #include "vk/GrVkDefines.h"
23 32
24 class GrPipeline; 33 class GrPipeline;
25 class GrNonInstancedMesh; 34 class GrNonInstancedMesh;
26 35
27 class GrVkBufferImpl; 36 class GrVkBufferImpl;
28 class GrVkPipeline; 37 class GrVkPipeline;
29 class GrVkPipelineState; 38 class GrVkPipelineState;
30 class GrVkPrimaryCommandBuffer; 39 class GrVkPrimaryCommandBuffer;
31 class GrVkRenderPass; 40 class GrVkRenderPass;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 VkMemoryBarrier* barrier) const; 115 VkMemoryBarrier* barrier) const;
107 void addBufferMemoryBarrier(VkPipelineStageFlags srcStageMask, 116 void addBufferMemoryBarrier(VkPipelineStageFlags srcStageMask,
108 VkPipelineStageFlags dstStageMask, 117 VkPipelineStageFlags dstStageMask,
109 bool byRegion, 118 bool byRegion,
110 VkBufferMemoryBarrier* barrier) const; 119 VkBufferMemoryBarrier* barrier) const;
111 void addImageMemoryBarrier(VkPipelineStageFlags srcStageMask, 120 void addImageMemoryBarrier(VkPipelineStageFlags srcStageMask,
112 VkPipelineStageFlags dstStageMask, 121 VkPipelineStageFlags dstStageMask,
113 bool byRegion, 122 bool byRegion,
114 VkImageMemoryBarrier* barrier) const; 123 VkImageMemoryBarrier* barrier) const;
115 124
125 #if USE_SKSL
126 SkSL::Compiler* shaderCompiler() const {
127 return fCompiler;
128 }
129 #else
116 shaderc_compiler_t shadercCompiler() const { 130 shaderc_compiler_t shadercCompiler() const {
117 return fCompiler; 131 return fCompiler;
118 } 132 }
133 #endif
119 134
120 void submitSecondaryCommandBuffer(const GrVkSecondaryCommandBuffer*); 135 void submitSecondaryCommandBuffer(const GrVkSecondaryCommandBuffer*);
121 136
122 void finishDrawTarget() override; 137 void finishDrawTarget() override;
123 138
124 void generateMipmap(GrVkTexture* tex) const; 139 void generateMipmap(GrVkTexture* tex) const;
125 140
126 // Heaps 141 // Heaps
127 enum Heap { 142 enum Heap {
128 kLinearImage_Heap = 0, 143 kLinearImage_Heap = 0,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 GrVkPrimaryCommandBuffer* fCurrentCmdBuffer; 263 GrVkPrimaryCommandBuffer* fCurrentCmdBuffer;
249 VkPhysicalDeviceMemoryProperties fPhysDevMemProps; 264 VkPhysicalDeviceMemoryProperties fPhysDevMemProps;
250 265
251 SkAutoTDelete<GrVkHeap> fHeaps[kHeapCount]; 266 SkAutoTDelete<GrVkHeap> fHeaps[kHeapCount];
252 267
253 #ifdef ENABLE_VK_LAYERS 268 #ifdef ENABLE_VK_LAYERS
254 // For reporting validation layer errors 269 // For reporting validation layer errors
255 VkDebugReportCallbackEXT fCallback; 270 VkDebugReportCallbackEXT fCallback;
256 #endif 271 #endif
257 272
273 #if USE_SKSL
274 SkSL::Compiler* fCompiler;
275 #else
258 // Shaderc compiler used for compiling glsl in spirv. We only want to create the compiler once 276 // Shaderc compiler used for compiling glsl in spirv. We only want to create the compiler once
259 // since there is significant overhead to the first compile of any compiler. 277 // since there is significant overhead to the first compile of any compiler.
260 shaderc_compiler_t fCompiler; 278 shaderc_compiler_t fCompiler;
261 279 #endif
262 280
263 typedef GrGpu INHERITED; 281 typedef GrGpu INHERITED;
264 }; 282 };
265 283
266 #endif 284 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698