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

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

Issue 1755483002: Add support for 2x2 matrices (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: vk updates Created 4 years, 9 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
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramDataManager.h ('k') | src/gpu/vk/GrVkProgramDataManager.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef GrVkProgramDataManager_DEFINED 8 #ifndef GrVkProgramDataManager_DEFINED
9 #define GrVkProgramDataManager_DEFINED 9 #define GrVkProgramDataManager_DEFINED
10 10
(...skipping 15 matching lines...) Expand all
26 void set1f(UniformHandle, float v0) const override; 26 void set1f(UniformHandle, float v0) const override;
27 void set1fv(UniformHandle, int arrayCount, const float v[]) const override; 27 void set1fv(UniformHandle, int arrayCount, const float v[]) const override;
28 void set2f(UniformHandle, float, float) const override; 28 void set2f(UniformHandle, float, float) const override;
29 void set2fv(UniformHandle, int arrayCount, const float v[]) const override; 29 void set2fv(UniformHandle, int arrayCount, const float v[]) const override;
30 void set3f(UniformHandle, float, float, float) const override; 30 void set3f(UniformHandle, float, float, float) const override;
31 void set3fv(UniformHandle, int arrayCount, const float v[]) const override; 31 void set3fv(UniformHandle, int arrayCount, const float v[]) const override;
32 void set4f(UniformHandle, float, float, float, float) const override; 32 void set4f(UniformHandle, float, float, float, float) const override;
33 void set4fv(UniformHandle, int arrayCount, const float v[]) const override; 33 void set4fv(UniformHandle, int arrayCount, const float v[]) const override;
34 // matrices are column-major, the first two upload a single matrix, the latt er two upload 34 // matrices are column-major, the first two upload a single matrix, the latt er two upload
35 // arrayCount matrices into a uniform array. 35 // arrayCount matrices into a uniform array.
36 void setMatrix2f(UniformHandle, const float matrix[]) const override;
36 void setMatrix3f(UniformHandle, const float matrix[]) const override; 37 void setMatrix3f(UniformHandle, const float matrix[]) const override;
37 void setMatrix4f(UniformHandle, const float matrix[]) const override; 38 void setMatrix4f(UniformHandle, const float matrix[]) const override;
39 void setMatrix2fv(UniformHandle, int arrayCount, const float matrices[]) con st override;
38 void setMatrix3fv(UniformHandle, int arrayCount, const float matrices[]) con st override; 40 void setMatrix3fv(UniformHandle, int arrayCount, const float matrices[]) con st override;
39 void setMatrix4fv(UniformHandle, int arrayCount, const float matrices[]) con st override; 41 void setMatrix4fv(UniformHandle, int arrayCount, const float matrices[]) con st override;
40 42
41 // for nvpr only 43 // for nvpr only
42 void setPathFragmentInputTransform(VaryingHandle u, int components, 44 void setPathFragmentInputTransform(VaryingHandle u, int components,
43 const SkMatrix& matrix) const override { 45 const SkMatrix& matrix) const override {
44 SkFAIL("Only supported in NVPR, which is not in vulkan"); 46 SkFAIL("Only supported in NVPR, which is not in vulkan");
45 } 47 }
46 48
47 void uploadUniformBuffers(const GrVkGpu* gpu, 49 void uploadUniformBuffers(const GrVkGpu* gpu,
48 GrVkUniformBuffer* vertexBuffer, 50 GrVkUniformBuffer* vertexBuffer,
49 GrVkUniformBuffer* fragmentBuffer) const; 51 GrVkUniformBuffer* fragmentBuffer) const;
50 private: 52 private:
51 struct Uniform { 53 struct Uniform {
52 uint32_t fBinding; 54 uint32_t fBinding;
53 uint32_t fOffset; 55 uint32_t fOffset;
54 SkDEBUGCODE( 56 SkDEBUGCODE(
55 GrSLType fType; 57 GrSLType fType;
56 int fArrayCount; 58 int fArrayCount;
57 uint32_t fSetNumber; 59 uint32_t fSetNumber;
58 ); 60 );
59 }; 61 };
60 62
63 template<int N> inline void setMatrices(UniformHandle, int arrayCount,
64 const float matrices[]) const;
65
61 uint32_t fVertexUniformSize; 66 uint32_t fVertexUniformSize;
62 uint32_t fFragmentUniformSize; 67 uint32_t fFragmentUniformSize;
63 68
64 SkTArray<Uniform, true> fUniforms; 69 SkTArray<Uniform, true> fUniforms;
65 70
66 mutable SkAutoMalloc fVertexUniformData; 71 mutable SkAutoMalloc fVertexUniformData;
67 mutable SkAutoMalloc fFragmentUniformData; 72 mutable SkAutoMalloc fFragmentUniformData;
68 }; 73 };
69 74
70 #endif 75 #endif
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramDataManager.h ('k') | src/gpu/vk/GrVkProgramDataManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698