fix some bugs on linux
This commit is contained in:
@@ -83,10 +83,11 @@ gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInf
|
||||
#endif
|
||||
|
||||
VkDebugUtilsMessengerCreateInfoEXT debugCreateInfo;
|
||||
const char* enabledLayerNames = "VK_LAYER_KHRONOS_validation";
|
||||
if (instance->enabledLayerCounts[GN_DEBUGGER_LAYER_PLATFORM] > 0) {
|
||||
vkStringArrayListAdd(extensions, VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
|
||||
createInfo.enabledLayerCount = 1;
|
||||
createInfo.ppEnabledLayerNames = (const char*[]){ "VK_LAYER_KHRONOS_validation" };
|
||||
createInfo.ppEnabledLayerNames = &enabledLayerNames;
|
||||
|
||||
instance->instance->userData.debuggerCallback = instanceInfo->debuggerInfo.callback;
|
||||
instance->instance->userData.userData = instanceInfo->debuggerInfo.userData;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include <instance/vulkan_instance.h>
|
||||
#include "vulkan_surface.h"
|
||||
#include <output_device/vulkan_physical_device.h>
|
||||
|
||||
#include "vulkan_result_converter.h"
|
||||
|
||||
#ifdef GN_PLATFORM_LINUX
|
||||
#ifdef GN_WINDOW_X11
|
||||
@@ -14,11 +14,7 @@ gnReturnCode createX11WindowSurface(gnWindowSurfaceHandle windowSurface, gnInsta
|
||||
info.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR;
|
||||
info.dpy = createInfo.display;
|
||||
info.window = createInfo.window;
|
||||
|
||||
VkResult result = vkCreateXlibSurfaceKHR(instance->instance->vk_instance, &info, NULL, &windowSurface->windowSurface->surface);
|
||||
if (result != VK_SUCCESS)
|
||||
return GN_FAILED_TO_ATTACH_WINDOW;
|
||||
return GN_SUCCESS;
|
||||
return VkResultToGnReturnCode(vkCreateXlibSurfaceKHR(instance->instance->vk_instance, &info, NULL, &windowSurface->windowSurface->surface));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -43,7 +43,7 @@ typedef struct gnDebuggerCreateInfo {
|
||||
|
||||
#ifdef GN_REVEAL_IMPL
|
||||
static inline void gnDebuggerSetErrorMessage(gnDebuggerCreateInfo debugger, gnMessageData data) {
|
||||
// if (debugger == NULL) return;
|
||||
if (debugger.callback == 0) return;
|
||||
debugger.callback(
|
||||
GN_MESSAGE_ERROR,
|
||||
GN_DEBUG_MESSAGE_VALIDATION,
|
||||
|
@@ -23,7 +23,7 @@ gryphnInstanceFunctionLayers gryphnLoadAPILayer(gnRenderingAPI api) {
|
||||
case GN_RENDERINGAPI_DIRECTX11: return (gryphnInstanceFunctionLayers){};
|
||||
case GN_RENDERINGAPI_DIRECTX12: return (gryphnInstanceFunctionLayers){};
|
||||
#ifdef GN_API_OPENGL
|
||||
// case GN_RENDERINGAPI_OPENGL: return loadOpenGLInstanceFunctions();
|
||||
case GN_RENDERINGAPI_OPENGL: return loadOpenGLAPILayer();
|
||||
#endif
|
||||
#ifdef GN_API_METAL
|
||||
case GN_RENDERINGAPI_METAL: return metalLoadAPILayer();
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include <gryphn_rendering_api.h>
|
||||
#include "utils/gryphn_bool.h"
|
||||
|
||||
#ifdef GN_PLATFORM_LINUX
|
||||
#include <platform_linux/gryphn_platform_linux.h>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#ifdef GN_PLATFORM_LINUX
|
||||
#include "gryphn_platform_linux.h"
|
||||
#include "gryphn_rendering_api.h"
|
||||
#include "utils/gryphn_bool.h"
|
||||
|
||||
gnRenderingAPI renderingAPIs[3] = {
|
||||
GN_RENDERINGAPI_VULKAN,
|
||||
@@ -14,8 +15,8 @@ gnRenderingAPI* gnGetSupportedRenderingAPIs(int* count) {
|
||||
}
|
||||
|
||||
gnBool gnSupportsRenderingAPI(gnRenderingAPI api) {
|
||||
for (int i = 0; i < 3; i++) if (api == renderingAPIs[i]) return gnTrue;
|
||||
return gnFalse;
|
||||
for (int i = 0; i < 3; i++) if (api == renderingAPIs[i]) return GN_TRUE;
|
||||
return GN_FALSE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Submodule projects/utils updated: d7a13b16d1...9f98da3b31
Reference in New Issue
Block a user