| 12 | using namespace gte; |
| 13 | |
| 14 | GLSLReflection::GLSLReflection(GLuint handle) |
| 15 | : |
| 16 | mHandle(handle) |
| 17 | { |
| 18 | std::string vendor(reinterpret_cast<char const*>(glGetString(GL_VENDOR))); |
| 19 | mVendorIsIntel = (vendor == "Intel"); |
| 20 | mShaderTypeMap.insert(std::make_pair(GL_VERTEX_SHADER, 3)); |
| 21 | mShaderTypeMap.insert(std::make_pair(GL_GEOMETRY_SHADER, 4)); |
| 22 | mShaderTypeMap.insert(std::make_pair(GL_FRAGMENT_SHADER, 5)); |
| 23 | mShaderTypeMap.insert(std::make_pair(GL_COMPUTE_SHADER, 6)); |
| 24 | mShaderTypeMap.insert(std::make_pair(GL_TESS_CONTROL_SHADER, 7)); |
| 25 | mShaderTypeMap.insert(std::make_pair(GL_TESS_EVALUATION_SHADER, 8)); |
| 26 | |
| 27 | if (mHandle > 0) |
| 28 | { |
| 29 | ReflectProgramInputs(); |
| 30 | ReflectProgramOutputs(); |
| 31 | ReflectDataBlocks(GL_UNIFORM_BLOCK, mUniformBlocks); |
| 32 | ReflectUniforms(); |
| 33 | ReflectDataBlocks(GL_SHADER_STORAGE_BLOCK, mShaderStorageBlocks); |
| 34 | ReflectAtomicCounterBuffers(); |
| 35 | ReflectSubroutines(GL_VERTEX_SUBROUTINE, mVertexSubroutines); |
| 36 | ReflectSubroutines(GL_GEOMETRY_SUBROUTINE, mGeometrySubroutines); |
| 37 | ReflectSubroutines(GL_FRAGMENT_SUBROUTINE, mPixelSubroutines); |
| 38 | ReflectSubroutines(GL_COMPUTE_SUBROUTINE, mComputeSubroutines); |
| 39 | ReflectSubroutines(GL_TESS_CONTROL_SUBROUTINE, mTessControlSubroutines); |
| 40 | ReflectSubroutines(GL_TESS_EVALUATION_SUBROUTINE, mTessEvaluationSubroutines); |
| 41 | ReflectSubroutineUniforms(GL_VERTEX_SUBROUTINE_UNIFORM, mVertexSubroutineUniforms); |
| 42 | ReflectSubroutineUniforms(GL_GEOMETRY_SUBROUTINE_UNIFORM, mGeometrySubroutineUniforms); |
| 43 | ReflectSubroutineUniforms(GL_FRAGMENT_SUBROUTINE_UNIFORM, mPixelSubroutineUniforms); |
| 44 | ReflectSubroutineUniforms(GL_COMPUTE_SUBROUTINE_UNIFORM, mComputeSubroutineUniforms); |
| 45 | ReflectSubroutineUniforms(GL_TESS_CONTROL_SUBROUTINE_UNIFORM, mTessControlSubroutineUniforms); |
| 46 | ReflectSubroutineUniforms(GL_TESS_EVALUATION_SUBROUTINE_UNIFORM, mTessEvaluationSubroutineUniforms); |
| 47 | ReflectBufferVariables(); |
| 48 | ReflectTransformFeedbackVaryings(); |
| 49 | ReflectTransformFeedbackBuffers(); |
| 50 | } |
| 51 | else |
| 52 | { |
| 53 | LogError("The program handle is invalid."); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | void GLSLReflection::GetComputeShaderWorkGroupSize(GLint &numXThreads, GLint& numYThreads, GLint& numZThreads) const |
| 58 | { |
nothing calls this directly
no test coverage detected