Remove glad and replace it with our own GL header
This completely removes the dependency on glad by generating the GL
headers from gl.xml directly.
This requires adding khrplatform.h so all Khronos dependencies are
gathered in third_party/khronos.
Also removes a stray CMakeLists.txt that was still hanging out.
BUG=dawn:165
Change-Id: Ia64bc51bc8b18c6b48613918e2f309f7405ecb3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8163
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn_native/opengl/BufferGL.h b/src/dawn_native/opengl/BufferGL.h
index f1dd0a5..a4baadf 100644
--- a/src/dawn_native/opengl/BufferGL.h
+++ b/src/dawn_native/opengl/BufferGL.h
@@ -17,7 +17,7 @@
#include "dawn_native/Buffer.h"
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
namespace dawn_native { namespace opengl {
diff --git a/src/dawn_native/opengl/ComputePipelineGL.h b/src/dawn_native/opengl/ComputePipelineGL.h
index 12856ca..73b4fe6 100644
--- a/src/dawn_native/opengl/ComputePipelineGL.h
+++ b/src/dawn_native/opengl/ComputePipelineGL.h
@@ -19,7 +19,7 @@
#include "dawn_native/opengl/PipelineGL.h"
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
namespace dawn_native { namespace opengl {
diff --git a/src/dawn_native/opengl/NativeSwapChainImplGL.h b/src/dawn_native/opengl/NativeSwapChainImplGL.h
index 5427ac1..ff38f6d 100644
--- a/src/dawn_native/opengl/NativeSwapChainImplGL.h
+++ b/src/dawn_native/opengl/NativeSwapChainImplGL.h
@@ -18,7 +18,7 @@
#include "dawn_native/OpenGLBackend.h"
#include "dawn_native/dawn_platform.h"
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
namespace dawn_native { namespace opengl {
diff --git a/src/dawn_native/opengl/PersistentPipelineStateGL.h b/src/dawn_native/opengl/PersistentPipelineStateGL.h
index 7169b76..c98ec15 100644
--- a/src/dawn_native/opengl/PersistentPipelineStateGL.h
+++ b/src/dawn_native/opengl/PersistentPipelineStateGL.h
@@ -16,8 +16,7 @@
#define DAWNNATIVE_OPENGL_PERSISTENTPIPELINESTATEGL_H_
#include "dawn_native/dawn_platform.h"
-
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
namespace dawn_native { namespace opengl {
diff --git a/src/dawn_native/opengl/PipelineGL.h b/src/dawn_native/opengl/PipelineGL.h
index e524542..b574589 100644
--- a/src/dawn_native/opengl/PipelineGL.h
+++ b/src/dawn_native/opengl/PipelineGL.h
@@ -17,7 +17,7 @@
#include "dawn_native/Pipeline.h"
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
#include <vector>
diff --git a/src/dawn_native/opengl/PipelineLayoutGL.h b/src/dawn_native/opengl/PipelineLayoutGL.h
index abf6acf..39eb802 100644
--- a/src/dawn_native/opengl/PipelineLayoutGL.h
+++ b/src/dawn_native/opengl/PipelineLayoutGL.h
@@ -17,7 +17,7 @@
#include "dawn_native/PipelineLayout.h"
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
namespace dawn_native { namespace opengl {
diff --git a/src/dawn_native/opengl/RenderPipelineGL.h b/src/dawn_native/opengl/RenderPipelineGL.h
index 6dc3c14..b0dc2e8 100644
--- a/src/dawn_native/opengl/RenderPipelineGL.h
+++ b/src/dawn_native/opengl/RenderPipelineGL.h
@@ -18,8 +18,7 @@
#include "dawn_native/RenderPipeline.h"
#include "dawn_native/opengl/PipelineGL.h"
-
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
#include <vector>
diff --git a/src/dawn_native/opengl/SamplerGL.h b/src/dawn_native/opengl/SamplerGL.h
index 3e6e84c..3c4911b 100644
--- a/src/dawn_native/opengl/SamplerGL.h
+++ b/src/dawn_native/opengl/SamplerGL.h
@@ -17,7 +17,7 @@
#include "dawn_native/Sampler.h"
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
namespace dawn_native { namespace opengl {
diff --git a/src/dawn_native/opengl/ShaderModuleGL.h b/src/dawn_native/opengl/ShaderModuleGL.h
index 8e485e6..f723300 100644
--- a/src/dawn_native/opengl/ShaderModuleGL.h
+++ b/src/dawn_native/opengl/ShaderModuleGL.h
@@ -17,7 +17,7 @@
#include "dawn_native/ShaderModule.h"
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
namespace dawn_native { namespace opengl {
diff --git a/src/dawn_native/opengl/SwapChainGL.h b/src/dawn_native/opengl/SwapChainGL.h
index 5e532fa..9b76514 100644
--- a/src/dawn_native/opengl/SwapChainGL.h
+++ b/src/dawn_native/opengl/SwapChainGL.h
@@ -17,7 +17,7 @@
#include "dawn_native/SwapChain.h"
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
namespace dawn_native { namespace opengl {
diff --git a/src/dawn_native/opengl/TextureGL.h b/src/dawn_native/opengl/TextureGL.h
index 1dacd17..cf17f13 100644
--- a/src/dawn_native/opengl/TextureGL.h
+++ b/src/dawn_native/opengl/TextureGL.h
@@ -17,7 +17,7 @@
#include "dawn_native/Texture.h"
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
namespace dawn_native { namespace opengl {
diff --git a/src/dawn_native/opengl/UtilsGL.h b/src/dawn_native/opengl/UtilsGL.h
index f82eb28..12bb741 100644
--- a/src/dawn_native/opengl/UtilsGL.h
+++ b/src/dawn_native/opengl/UtilsGL.h
@@ -16,7 +16,7 @@
#define DAWNNATIVE_OPENGL_UTILSGL_H_
#include "dawn_native/dawn_platform.h"
-#include "glad/glad.h"
+#include "dawn_native/opengl/opengl_platform.h"
namespace dawn_native { namespace opengl {
diff --git a/src/dawn_native/opengl/opengl_platform.h b/src/dawn_native/opengl/opengl_platform.h
new file mode 100644
index 0000000..783f6e4
--- /dev/null
+++ b/src/dawn_native/opengl/opengl_platform.h
@@ -0,0 +1,15 @@
+// Copyright 2019 The Dawn Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "dawn_native/opengl/opengl_platform_autogen.h"