Skip to content

Commit 59b8ac6

Browse files
Testing env: added logs
1 parent 98cabeb commit 59b8ac6

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

Tests/GPUTestFramework/src/Linux/TestingEnvironmentLinux.cpp

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ namespace Testing
3939

4040
NativeWindow GPUTestingEnvironment::CreateNativeWindow()
4141
{
42+
LOG_INFO_MESSAGE("XOpenDisplay");
4243
auto* display = XOpenDisplay(0);
44+
LOG_INFO_MESSAGE("XOpenDisplay completed");
4345

4446
// clang-format off
4547
static int visual_attribs[] =
@@ -65,17 +67,24 @@ NativeWindow GPUTestingEnvironment::CreateNativeWindow()
6567
};
6668
// clang-format on
6769

68-
int fbcount = 0;
69-
GLXFBConfig* fbc = glXChooseFBConfig(display, DefaultScreen(display), visual_attribs, &fbcount);
70+
int fbcount = 0;
71+
LOG_INFO_MESSAGE("glXChooseFBConfig");
72+
GLXFBConfig* fbc = glXChooseFBConfig(display, DefaultScreen(display), visual_attribs, &fbcount);
73+
LOG_INFO_MESSAGE("glXChooseFBConfig completed");
7074
if (!fbc)
7175
{
7276
LOG_ERROR_AND_THROW("Failed to retrieve a framebuffer config");
7377
}
7478

79+
LOG_INFO_MESSAGE("glXGetVisualFromFBConfig");
7580
XVisualInfo* vi = glXGetVisualFromFBConfig(display, fbc[0]);
81+
LOG_INFO_MESSAGE("glXGetVisualFromFBConfig completed");
7682

7783
XSetWindowAttributes swa;
78-
swa.colormap = XCreateColormap(display, RootWindow(display, vi->screen), vi->visual, AllocNone);
84+
LOG_INFO_MESSAGE("XCreateColormap");
85+
swa.colormap = XCreateColormap(display, RootWindow(display, vi->screen), vi->visual, AllocNone);
86+
LOG_INFO_MESSAGE("XCreateColormap completed");
87+
7988
swa.border_pixel = 0;
8089
swa.event_mask =
8190
StructureNotifyMask |
@@ -86,7 +95,10 @@ NativeWindow GPUTestingEnvironment::CreateNativeWindow()
8695
ButtonReleaseMask |
8796
PointerMotionMask;
8897

98+
99+
LOG_INFO_MESSAGE("XCreateWindow");
89100
auto win = XCreateWindow(display, RootWindow(display, vi->screen), 0, 0, 1024, 768, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap | CWEventMask, &swa);
101+
LOG_INFO_MESSAGE("XCreateWindow completed");
90102
if (!win)
91103
{
92104
LOG_ERROR_AND_THROW("Failed to create window.");
@@ -101,14 +113,25 @@ NativeWindow GPUTestingEnvironment::CreateNativeWindow()
101113
XFree(SizeHints);
102114
}
103115

116+
LOG_INFO_MESSAGE("XMapWindow");
104117
XMapWindow(display, win);
118+
LOG_INFO_MESSAGE("XMapWindow completed");
105119

106120
glXCreateContextAttribsARBProc glXCreateContextAttribsARB = nullptr;
107121
{
108122
// Create an oldstyle context first, to get the correct function pointer for glXCreateContextAttribsARB
109-
GLXContext ctx_old = glXCreateContext(display, vi, 0, GL_TRUE);
123+
LOG_INFO_MESSAGE("glXCreateContext");
124+
GLXContext ctx_old = glXCreateContext(display, vi, 0, GL_TRUE);
125+
LOG_INFO_MESSAGE("glXCreateContext completed");
126+
127+
LOG_INFO_MESSAGE("glXGetProcAddress");
110128
glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB");
129+
LOG_INFO_MESSAGE("glXGetProcAddress completed");
130+
131+
LOG_INFO_MESSAGE("glXMakeCurrent");
111132
glXMakeCurrent(display, None, NULL);
133+
LOG_INFO_MESSAGE("glXMakeCurrent completed");
134+
112135
glXDestroyContext(display, ctx_old);
113136
}
114137

@@ -134,14 +157,19 @@ NativeWindow GPUTestingEnvironment::CreateNativeWindow()
134157
};
135158
// clang-format on
136159

160+
LOG_INFO_MESSAGE("glXCreateContextAttribsARB");
137161
GLXContext ctx = glXCreateContextAttribsARB(display, fbc[0], NULL, 1, context_attribs);
162+
LOG_INFO_MESSAGE("glXCreateContextAttribsARB completed");
163+
138164
if (!ctx)
139165
{
140166
LOG_ERROR_AND_THROW("Failed to create GL context.");
141167
}
142168
XFree(fbc);
143169

170+
LOG_INFO_MESSAGE("glXMakeCurrent");
144171
glXMakeCurrent(display, win, ctx);
172+
LOG_INFO_MESSAGE("glXMakeCurrent completed");
145173

146174
struct TestingEnvironmentLinuxData : PlatformData
147175
{

0 commit comments

Comments
 (0)