<commit_before>#include "glad/glad.h"
#include "GLFW/glfw3.h"
#include "device.hpp"
#include "context.hpp"
#include "global_managers_init.hpp"
#include <stdlib.h>
#include <cmath>

#ifndef _WIN32
#include <unistd.h>
#endif

using namespace Vulkan;

static void check_gl_error()
{
	GLenum err;
	if ((err = glGetError()) != GL_NO_ERROR)
	{
		LOGE("GL error: #%x.\n", err);
		exit(EXIT_FAILURE);
	}
}

static void import_semaphore(GLuint &glsem, const ExternalHandle &handle)
{
	glGenSemaphoresEXT(1, &glsem);
#ifdef _WIN32
	glImportSemaphoreWin32HandleEXT(glsem, GL_HANDLE_TYPE_OPAQUE_WIN32_EXT, handle.handle);
	CloseHandle(handle.handle);
#else
	// Importing an FD takes ownership of it. We'll reimport the FD, so need to dup it.
	glImportSemaphoreFdEXT(glsem, GL_HANDLE_TYPE_OPAQUE_FD_EXT, handle.handle);
#endif
	check_gl_error();
}

int main()
{
	Granite::Global::init(1, Granite::Global::MANAGER_FEATURE_DEFAULT_BITS);
	if (!glfwInit())<commit_msg>Minor fix for GL interop.<commit_after>#include "glad/glad.h"
#include "GLFW/glfw3.h"
#include "device.hpp"
#include "context.hpp"
#include "global_managers_init.hpp"
#include <stdlib.h>
#include <cmath>

#ifndef _WIN32
#include <unistd.h>
#endif

using namespace Vulkan;

static void check_gl_error()
{
	GLenum err;
	if ((err = glGetError()) != GL_NO_ERROR)
	{
		LOGE("GL error: #%x.\n", err);
		exit(EXIT_FAILURE);
	}
}

static void import_semaphore(GLuint &glsem, const ExternalHandle &handle)
{
	glGenSemaphoresEXT(1, &glsem);
#ifdef _WIN32
	glImportSemaphoreWin32HandleEXT(glsem, GL_HANDLE_TYPE_OPAQUE_WIN32_EXT, handle.handle);
	CloseHandle(handle.handle);
#else
	// Importing an FD takes ownership of it. We'll reimport the FD, so need to dup it.
	glImportSemaphoreFdEXT(glsem, GL_HANDLE_TYPE_OPAQUE_FD_EXT, handle.handle);
#endif
	check_gl_error();
}

int main()
{
	Granite::Global::init(Granite::Global::MANAGER_FEATURE_DEFAULT_BITS, 1);
	if (!glfwInit())
{'fraction_non_alphanumeric': 0.13517745302713988, 'fraction_numerical': 0.011482254697286013, 'mean_word_length': 6.373076923076923, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3797085', 'n_tokens_mistral': 783, 'n_tokens_neox': 761, 'n_words': 161}