| 1 |
/* |
| 2 |
* Copyright (C) 2020-2024 Intel Corporation |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: MIT |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
#pragma once |
| 9 |
|
| 10 |
#include "opencl/source/sharings/gl/gl_sharing.h" |
| 11 |
|
| 12 |
#include "gl_types.h" |
| 13 |
|
| 14 |
namespace NEO { |
| 15 |
class GLContextGuard { |
| 16 |
public: |
| 17 |
GLContextGuard() = delete; |
| 18 |
GLContextGuard(GLSharingFunctions &sharingFcns); |
| 19 |
~GLContextGuard(); |
| 20 |
|
| 21 |
protected: |
| 22 |
GLSharingFunctions *sharingFunctions = nullptr; |
| 23 |
|
| 24 |
GLContext currentContextHandle{}; |
| 25 |
GLDisplay currentDisplayHandle{}; |
| 26 |
}; |
| 27 |
} // namespace NEO |