Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright 2016 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | // ProgramVk.h: |
| 7 | // Defines the class interface for ProgramVk, implementing ProgramImpl. |
| 8 | // |
| 9 | |
| 10 | #ifndef LIBANGLE_RENDERER_VULKAN_PROGRAMVK_H_ |
| 11 | #define LIBANGLE_RENDERER_VULKAN_PROGRAMVK_H_ |
| 12 | |
| 13 | #include "libANGLE/renderer/ProgramImpl.h" |
Jamie Madill | 8ecf7f9 | 2017-01-13 17:29:52 -0500 | [diff] [blame^] | 14 | #include "libANGLE/renderer/vulkan/renderervk_utils.h" |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 15 | |
| 16 | namespace rx |
| 17 | { |
| 18 | |
| 19 | class ProgramVk : public ProgramImpl |
| 20 | { |
| 21 | public: |
| 22 | ProgramVk(const gl::ProgramState &state); |
| 23 | ~ProgramVk() override; |
| 24 | |
Jamie Madill | a7d12dc | 2016-12-13 15:08:19 -0500 | [diff] [blame] | 25 | LinkResult load(const ContextImpl *contextImpl, |
| 26 | gl::InfoLog &infoLog, |
| 27 | gl::BinaryInputStream *stream) override; |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 28 | gl::Error save(gl::BinaryOutputStream *stream) override; |
| 29 | void setBinaryRetrievableHint(bool retrievable) override; |
| 30 | |
Jamie Madill | 8ecf7f9 | 2017-01-13 17:29:52 -0500 | [diff] [blame^] | 31 | LinkResult link(ContextImpl *contextImpl, |
Jamie Madill | 192745a | 2016-12-22 15:58:21 -0500 | [diff] [blame] | 32 | const gl::VaryingPacking &packing, |
| 33 | gl::InfoLog &infoLog) override; |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 34 | GLboolean validate(const gl::Caps &caps, gl::InfoLog *infoLog) override; |
| 35 | |
| 36 | void setUniform1fv(GLint location, GLsizei count, const GLfloat *v) override; |
| 37 | void setUniform2fv(GLint location, GLsizei count, const GLfloat *v) override; |
| 38 | void setUniform3fv(GLint location, GLsizei count, const GLfloat *v) override; |
| 39 | void setUniform4fv(GLint location, GLsizei count, const GLfloat *v) override; |
| 40 | void setUniform1iv(GLint location, GLsizei count, const GLint *v) override; |
| 41 | void setUniform2iv(GLint location, GLsizei count, const GLint *v) override; |
| 42 | void setUniform3iv(GLint location, GLsizei count, const GLint *v) override; |
| 43 | void setUniform4iv(GLint location, GLsizei count, const GLint *v) override; |
| 44 | void setUniform1uiv(GLint location, GLsizei count, const GLuint *v) override; |
| 45 | void setUniform2uiv(GLint location, GLsizei count, const GLuint *v) override; |
| 46 | void setUniform3uiv(GLint location, GLsizei count, const GLuint *v) override; |
| 47 | void setUniform4uiv(GLint location, GLsizei count, const GLuint *v) override; |
| 48 | void setUniformMatrix2fv(GLint location, |
| 49 | GLsizei count, |
| 50 | GLboolean transpose, |
| 51 | const GLfloat *value) override; |
| 52 | void setUniformMatrix3fv(GLint location, |
| 53 | GLsizei count, |
| 54 | GLboolean transpose, |
| 55 | const GLfloat *value) override; |
| 56 | void setUniformMatrix4fv(GLint location, |
| 57 | GLsizei count, |
| 58 | GLboolean transpose, |
| 59 | const GLfloat *value) override; |
| 60 | void setUniformMatrix2x3fv(GLint location, |
| 61 | GLsizei count, |
| 62 | GLboolean transpose, |
| 63 | const GLfloat *value) override; |
| 64 | void setUniformMatrix3x2fv(GLint location, |
| 65 | GLsizei count, |
| 66 | GLboolean transpose, |
| 67 | const GLfloat *value) override; |
| 68 | void setUniformMatrix2x4fv(GLint location, |
| 69 | GLsizei count, |
| 70 | GLboolean transpose, |
| 71 | const GLfloat *value) override; |
| 72 | void setUniformMatrix4x2fv(GLint location, |
| 73 | GLsizei count, |
| 74 | GLboolean transpose, |
| 75 | const GLfloat *value) override; |
| 76 | void setUniformMatrix3x4fv(GLint location, |
| 77 | GLsizei count, |
| 78 | GLboolean transpose, |
| 79 | const GLfloat *value) override; |
| 80 | void setUniformMatrix4x3fv(GLint location, |
| 81 | GLsizei count, |
| 82 | GLboolean transpose, |
| 83 | const GLfloat *value) override; |
| 84 | |
| 85 | // TODO: synchronize in syncState when dirty bits exist. |
| 86 | void setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding) override; |
| 87 | |
| 88 | // May only be called after a successful link operation. |
| 89 | // Return false for inactive blocks. |
| 90 | bool getUniformBlockSize(const std::string &blockName, size_t *sizeOut) const override; |
| 91 | |
| 92 | // May only be called after a successful link operation. |
| 93 | // Returns false for inactive members. |
| 94 | bool getUniformBlockMemberInfo(const std::string &memberUniformName, |
| 95 | sh::BlockMemberInfo *memberInfoOut) const override; |
Sami Väisänen | 46eaa94 | 2016-06-29 10:26:37 +0300 | [diff] [blame] | 96 | |
| 97 | void setPathFragmentInputGen(const std::string &inputName, |
| 98 | GLenum genMode, |
| 99 | GLint components, |
| 100 | const GLfloat *coeffs) override; |
Jamie Madill | 8ecf7f9 | 2017-01-13 17:29:52 -0500 | [diff] [blame^] | 101 | |
| 102 | const vk::ShaderModule &getLinkedVertexModule() const; |
| 103 | const vk::ShaderModule &getLinkedFragmentModule() const; |
| 104 | |
| 105 | private: |
| 106 | vk::ShaderModule mLinkedVertexModule; |
| 107 | vk::ShaderModule mLinkedFragmentModule; |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 108 | }; |
| 109 | |
| 110 | } // namespace rx |
| 111 | |
| 112 | #endif // LIBANGLE_RENDERER_VULKAN_PROGRAMVK_H_ |