OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 | 8 |
9 #ifndef GrVkPipelineState_DEFINED | 9 #ifndef GrVkPipelineState_DEFINED |
10 #define GrVkPipelineState_DEFINED | 10 #define GrVkPipelineState_DEFINED |
11 | 11 |
12 #include "GrStencilSettings.h" | 12 #include "GrStencilSettings.h" |
13 #include "GrVkImage.h" | 13 #include "GrVkImage.h" |
14 #include "GrVkProgramDesc.h" | 14 #include "GrVkProgramDesc.h" |
15 #include "GrVkPipelineStateDataManager.h" | 15 #include "GrVkPipelineStateDataManager.h" |
16 #include "glsl/GrGLSLProgramBuilder.h" | 16 #include "glsl/GrGLSLProgramBuilder.h" |
17 | 17 |
18 #include "vk/GrVkDefines.h" | 18 #include "vk/GrVkDefines.h" |
19 | 19 |
20 class GrPipeline; | 20 class GrPipeline; |
21 class GrVkCommandBuffer; | 21 class GrVkCommandBuffer; |
22 class GrVkDescriptorPool; | 22 class GrVkDescriptorPool; |
| 23 class GrVkDescriptorSet; |
23 class GrVkGpu; | 24 class GrVkGpu; |
24 class GrVkImageView; | 25 class GrVkImageView; |
25 class GrVkPipeline; | 26 class GrVkPipeline; |
26 class GrVkSampler; | 27 class GrVkSampler; |
27 class GrVkUniformBuffer; | 28 class GrVkUniformBuffer; |
28 | 29 |
29 /** | 30 /** |
30 * This class holds onto a GrVkPipeline object that we use for draws. Besides st
oring the acutal | 31 * This class holds onto a GrVkPipeline object that we use for draws. Besides st
oring the acutal |
31 * GrVkPipeline object, this class is also responsible handling all uniforms, de
scriptors, samplers, | 32 * GrVkPipeline object, this class is also responsible handling all uniforms, de
scriptors, samplers, |
32 * and other similar objects that are used along with the VkPipeline in the draw
. This includes both | 33 * and other similar objects that are used along with the VkPipeline in the draw
. This includes both |
(...skipping 216 matching lines...) Loading... |
249 // command buffer execution. Thus this is not need to be a GrVkResource. | 250 // command buffer execution. Thus this is not need to be a GrVkResource. |
250 VkPipelineLayout fPipelineLayout; | 251 VkPipelineLayout fPipelineLayout; |
251 | 252 |
252 // The DescriptorSets need to survive until the gpu has finished all draws t
hat use them. | 253 // The DescriptorSets need to survive until the gpu has finished all draws t
hat use them. |
253 // However, they will only be freed by the descriptor pool. Thus by simply k
eeping the | 254 // However, they will only be freed by the descriptor pool. Thus by simply k
eeping the |
254 // descriptor pool alive through the draw, the descritor sets will also stay
alive. Thus we do | 255 // descriptor pool alive through the draw, the descritor sets will also stay
alive. Thus we do |
255 // not need a GrVkResource versions of VkDescriptorSet. We hold on to these
in the | 256 // not need a GrVkResource versions of VkDescriptorSet. We hold on to these
in the |
256 // GrVkPipelineState since we update the descriptor sets and bind them at se
parate times; | 257 // GrVkPipelineState since we update the descriptor sets and bind them at se
parate times; |
257 VkDescriptorSet fDescriptorSets[2]; | 258 VkDescriptorSet fDescriptorSets[2]; |
258 | 259 |
| 260 // Once we move samplers over to use the resource provider for descriptor se
ts we will not need |
| 261 // the above array and instead just use GrVkDescriptorSet like the uniform o
ne here. |
| 262 const GrVkDescriptorSet* fUniformDescriptorSet; |
| 263 |
259 // Meta data so we know which descriptor sets we are using and need to bind. | 264 // Meta data so we know which descriptor sets we are using and need to bind. |
260 int fStartDS; | 265 int fStartDS; |
261 int fDSCount; | 266 int fDSCount; |
262 | 267 |
263 SkAutoTDelete<GrVkUniformBuffer> fVertexUniformBuffer; | 268 SkAutoTDelete<GrVkUniformBuffer> fVertexUniformBuffer; |
264 SkAutoTDelete<GrVkUniformBuffer> fFragmentUniformBuffer; | 269 SkAutoTDelete<GrVkUniformBuffer> fFragmentUniformBuffer; |
265 | 270 |
266 // GrVkResources used for sampling textures | 271 // GrVkResources used for sampling textures |
267 SkTDArray<GrVkSampler*> fSamplers; | 272 SkTDArray<GrVkSampler*> fSamplers; |
268 SkTDArray<const GrVkImageView*> fTextureViews; | 273 SkTDArray<const GrVkImageView*> fTextureViews; |
269 SkTDArray<const GrVkResource*> fTextures; | 274 SkTDArray<const GrVkResource*> fTextures; |
270 | 275 |
271 // Tracks the current render target uniforms stored in the vertex buffer. | 276 // Tracks the current render target uniforms stored in the vertex buffer. |
272 RenderTargetState fRenderTargetState; | 277 RenderTargetState fRenderTargetState; |
273 BuiltinUniformHandles fBuiltinUniformHandles; | 278 BuiltinUniformHandles fBuiltinUniformHandles; |
274 | 279 |
275 // Processors in the GrVkPipelineState | 280 // Processors in the GrVkPipelineState |
276 SkAutoTDelete<GrGLSLPrimitiveProcessor> fGeometryProcessor; | 281 SkAutoTDelete<GrGLSLPrimitiveProcessor> fGeometryProcessor; |
277 SkAutoTDelete<GrGLSLXferProcessor> fXferProcessor; | 282 SkAutoTDelete<GrGLSLXferProcessor> fXferProcessor; |
278 GrGLSLFragProcs fFragmentProcessors; | 283 GrGLSLFragProcs fFragmentProcessors; |
279 | 284 |
280 Desc fDesc; | 285 Desc fDesc; |
281 | 286 |
282 GrVkPipelineStateDataManager fDataManager; | 287 GrVkPipelineStateDataManager fDataManager; |
283 | 288 |
284 DescriptorPoolManager fSamplerPoolManager; | 289 DescriptorPoolManager fSamplerPoolManager; |
285 const GrVkDescriptorPool* fCurrentUniformDescPool; | |
286 | 290 |
287 int fNumSamplers; | 291 int fNumSamplers; |
288 | 292 |
289 friend class GrVkPipelineStateBuilder; | 293 friend class GrVkPipelineStateBuilder; |
290 }; | 294 }; |
291 | 295 |
292 #endif | 296 #endif |
OLD | NEW |