Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrVkPipelineStateDataManager.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 GrVkPipelineStateDataManager_DEFINED
9#define GrVkPipelineStateDataManager_DEFINED
10
12
15
16class GrGpuBuffer;
18class GrVkGpu;
19
21public:
23
24 GrVkPipelineStateDataManager(const UniformInfoArray&, uint32_t uniformSize,
25 bool usePushConstants);
26
27 // Returns the uniform buffer that holds all the uniform data. If there are no uniforms it
28 // returns nullptr. If there was an error in creating or uploading the uniforms the value of the
29 // returned bool will be false and the buffer will be nullptr. Otherwise the bool will be true.
30 std::pair<sk_sp<GrGpuBuffer>, bool> uploadUniforms(GrVkGpu* gpu, VkPipelineLayout,
31 GrVkCommandBuffer* commandBuffer);
32
33 void releaseData();
34
35 // TODO: we might need more of these once std430 size/alignment issues are worked out
36 void set1iv(UniformHandle, int arrayCount, const int32_t v[]) const override;
37 void set1fv(UniformHandle, int arrayCount, const float v[]) const override;
38 void set2iv(UniformHandle, int arrayCount, const int32_t v[]) const override;
39 void set2fv(UniformHandle, int arrayCount, const float v[]) const override;
40 void setMatrix2fv(UniformHandle, int arrayCount, const float matrices[]) const override;
41
42private:
43 sk_sp<GrGpuBuffer> fUniformBuffer;
44 bool fUsePushConstants;
45
47};
48
49#endif
std::pair< sk_sp< GrGpuBuffer >, bool > uploadUniforms(GrVkGpu *gpu, VkPipelineLayout, GrVkCommandBuffer *commandBuffer)
void set1fv(UniformHandle, int arrayCount, const float v[]) const override
void set2fv(UniformHandle, int arrayCount, const float v[]) const override
void setMatrix2fv(UniformHandle, int arrayCount, const float matrices[]) const override
GrVkUniformHandler::UniformInfoArray UniformInfoArray
void set1iv(UniformHandle, int arrayCount, const int32_t v[]) const override
void set2iv(UniformHandle, int arrayCount, const int32_t v[]) const override