1 // Copyright 2019 The Dawn Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef DAWNNATIVE_OPENGL_OPENGLFUNCTIONS_H_ 16 #define DAWNNATIVE_OPENGL_OPENGLFUNCTIONS_H_ 17 18 #include <unordered_set> 19 20 #include "dawn_native/opengl/OpenGLFunctionsBase_autogen.h" 21 22 namespace dawn_native { namespace opengl { 23 24 struct OpenGLFunctions : OpenGLFunctionsBase { 25 public: 26 MaybeError Initialize(GetProcAddress getProc); 27 28 bool IsAtLeastGL(uint32_t majorVersion, uint32_t minorVersion) const; 29 bool IsAtLeastGLES(uint32_t majorVersion, uint32_t minorVersion) const; 30 31 bool IsGLExtensionSupported(const char* extension) const; 32 33 private: 34 void InitializeSupportedGLExtensions(); 35 36 uint32_t mMajorVersion; 37 uint32_t mMinorVersion; 38 39 enum class Standard { 40 Desktop, 41 ES, 42 }; 43 Standard mStandard; 44 45 std::unordered_set<std::string> mSupportedGLExtensionsSet; 46 }; 47 48 }} // namespace dawn_native::opengl 49 50 #endif // DAWNNATIVE_OPENGL_OPENGLFUNCTIONS_H_ 51