| 768 | } |
| 769 | |
| 770 | void GLSLReflection::ReflectSubroutines(GLenum programInterface, |
| 771 | std::vector<std::string>& subroutines) |
| 772 | { |
| 773 | GLint numResources = 0; |
| 774 | glGetProgramInterfaceiv(mHandle, programInterface, GL_ACTIVE_RESOURCES, &numResources); |
| 775 | |
| 776 | if (numResources > 0) |
| 777 | { |
| 778 | subroutines.resize(numResources); |
| 779 | |
| 780 | GLenum nameLengthProperty = GL_NAME_LENGTH; |
| 781 | for (int32_t i = 0; i < numResources; ++i) |
| 782 | { |
| 783 | GLint result = 0; |
| 784 | glGetProgramResourceiv(mHandle, programInterface, i, 1, |
| 785 | &nameLengthProperty, 1, nullptr, &result); |
| 786 | |
| 787 | GLsizei const numBytes = static_cast<GLsizei>(result + 1); |
| 788 | std::vector<GLchar> name(numBytes); |
| 789 | glGetProgramResourceName(mHandle, programInterface, i, numBytes, |
| 790 | nullptr, name.data()); |
| 791 | subroutines[i] = std::string(name.data()); |
| 792 | } |
| 793 | } |
| 794 | } |
| 795 | |
| 796 | void GLSLReflection::ReflectSubroutineUniforms(GLenum programInterface, |
| 797 | std::vector<SubroutineUniform>& subUniforms) |
nothing calls this directly
no test coverage detected