Skip to content

Commit 04cae69

Browse files
corporatesharkmeta-codesync[bot]
authored andcommitted
igl | opengl | Add Tracy profiler markers to HWDevice (egl)
Reviewed By: rudybear Differential Revision: D114575234 fbshipit-source-id: 43fd98bf3a9b1d882f8e1c0b3b293a3d3c113f98
1 parent d08d38a commit 04cae69

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/igl/opengl/egl/HWDevice.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,43 @@
88
#include "HWDevice.h"
99

1010
#include <EGL/eglplatform.h>
11+
#include <igl/Macros.h>
1112
#include <igl/opengl/egl/Context.h>
1213
#include <igl/opengl/egl/Device.h>
1314

1415
namespace igl::opengl::egl {
1516

1617
std::unique_ptr<IContext> HWDevice::createContext(Result* outResult) const {
18+
IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_CREATE);
1719
Result::setOk(outResult);
1820
return std::make_unique<Context>(IGL_EGL_NULL_WINDOW);
1921
}
2022

2123
std::unique_ptr<IContext> HWDevice::createContext(EGLNativeWindowType nativeWindow,
2224
Result* outResult) const {
25+
IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_CREATE);
2326
return std::make_unique<Context>(nativeWindow);
2427
}
2528

2629
std::unique_ptr<IContext> HWDevice::createContext(BackendVersion backendVersion,
2730
EGLNativeWindowType nativeWindow,
2831
Result* outResult) const {
32+
IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_CREATE);
2933
return std::make_unique<Context>(backendVersion, nativeWindow);
3034
}
3135

3236
std::unique_ptr<IContext> HWDevice::createOffscreenContext(size_t width,
3337
size_t height,
3438
Result* outResult) const {
39+
IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_CREATE);
3540
Result::setOk(outResult);
3641
return std::make_unique<Context>(width, height);
3742
}
3843

3944
// @fb-only
4045
std::unique_ptr<opengl::Device> HWDevice::createWithContext(std::unique_ptr<IContext> context,
4146
Result* outResult) const {
47+
IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_CREATE);
4248
Result::setOk(outResult);
4349
if (context == nullptr) {
4450
Result::setResult(outResult, Result::Code::ArgumentInvalid, "context is null");
@@ -50,6 +56,7 @@ std::unique_ptr<opengl::Device> HWDevice::createWithContext(std::unique_ptr<ICon
5056
// @fb-only
5157
std::unique_ptr<opengl::Device> HWDevice::create(EGLNativeWindowType nativeWindow,
5258
Result* outResult) const {
59+
IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_CREATE);
5360
auto context = createContext(nativeWindow, outResult);
5461
if (context == nullptr) {
5562
return nullptr;

0 commit comments

Comments
 (0)