Flutter Engine
The Flutter Engine
GrVkPipelineStateBuilder.h
Go to the documentation of this file.
1/*
2* Copyright 2016 Google Inc.
3*
4* Use of this source code is governed by a BSD-style license that can be
5* found in the LICENSE file.
6*/
7
8#ifndef GrVkPipelineStateBuilder_DEFINED
9#define GrVkPipelineStateBuilder_DEFINED
10
19
20class GrProgramDesc;
21class GrVkGpu;
22class GrVkRenderPass;
23class SkReadBuffer;
24
26public:
27 /** Generates a pipeline state.
28 *
29 * The return GrVkPipelineState implements the supplied GrProgramInfo.
30 *
31 * @return the created pipeline if generation was successful; nullptr otherwise
32 */
34 const GrProgramDesc&,
35 const GrProgramInfo&,
36 VkRenderPass compatibleRenderPass,
37 bool overrideSubpassForResolveLoad);
38
39 const GrCaps* caps() const override;
40
41 GrVkGpu* gpu() const { return fGpu; }
42
43 void finalizeFragmentSecondaryColor(GrShaderVar& outputColor) override;
44
45private:
47
48 GrVkPipelineState* finalize(const GrProgramDesc&, VkRenderPass compatibleRenderPass,
49 bool overrideSupbassForResolveLoad);
50
51 // returns number of shader stages
52 int loadShadersFromCache(SkReadBuffer* cached, VkShaderModule outShaderModules[],
54
55 void storeShadersInCache(const std::string shaders[],
57 bool isSkSL);
58
59 bool createVkShaderModule(VkShaderStageFlagBits stage,
60 const std::string& sksl,
61 VkShaderModule* shaderModule,
64 std::string* outSPIRV,
65 SkSL::Program::Interface* outInterface);
66
67 bool installVkShaderModule(VkShaderStageFlagBits stage,
69 VkShaderModule* shaderModule,
71 std::string spirv,
73
74 GrGLSLUniformHandler* uniformHandler() override { return &fUniformHandler; }
75 const GrGLSLUniformHandler* uniformHandler() const override { return &fUniformHandler; }
76 GrGLSLVaryingHandler* varyingHandler() override { return &fVaryingHandler; }
77
78 GrVkGpu* fGpu;
79 GrVkVaryingHandler fVaryingHandler;
80 GrVkUniformHandler fUniformHandler;
81
82 using INHERITED = GrGLSLProgramBuilder;
83};
84
85#endif
Definition: GrCaps.h:57
GrGLSLProgramBuilder(const GrProgramDesc &, const GrProgramInfo &)
static GrVkPipelineState * CreatePipelineState(GrVkGpu *, const GrProgramDesc &, const GrProgramInfo &, VkRenderPass compatibleRenderPass, bool overrideSubpassForResolveLoad)
const GrCaps * caps() const override
void finalizeFragmentSecondaryColor(GrShaderVar &outputColor) override
VkShaderStageFlagBits
Definition: vulkan_core.h:2664