added mesh rendering

This commit is contained in:
2025-05-28 14:36:57 +03:00
parent 60fa98e240
commit b83078553e
53 changed files with 1436 additions and 363 deletions

View File

@@ -38,6 +38,7 @@ ConVar vulkan_gpu("vk_gpu", "0", FCVAR_ARCHIVE);
VkCommandPool g_vkCommandPool;
/* more efficient */
CUtlVector<VkCommandBuffer> g_commandBuffers;
VkCommandBuffer g_vkCommandBuffer;
@@ -49,11 +50,18 @@ VkImage g_swapchainImage;
uint32_t g_nNumSwapchainImages = 0;
#define VK_DEVICE_FUNCTION(name) PFN_##name _##name
#include "vk_external_functions.cpp"
#undef VK_DEVICE_FUNCTION
char g_bConfigNotify = 0;
uint32_t g_nWindowWidth = 1280;
uint32_t g_nWindowHeight = 720;
void IVideo_SwapchainInit()
{
/* swapchain */
VkXlibSurfaceCreateInfoKHR surfaceCreateInfo = {};
surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR;
surfaceCreateInfo.dpy = g_xdisplay;
@@ -176,16 +184,13 @@ void IVideo_SwapchainDestroy()
}
};
#define VK_DEVICE_FUNCTION(name) PFN_##name _##name
#include "vk_external_functions.cpp"
#undef VK_DEVICE_FUNCTION
void IVideo::Init()
{
g_xdisplay = XOpenDisplay(NULL);
g_xscreen = DefaultScreen(g_xdisplay);
g_xroot = RootWindow(g_xdisplay, g_xscreen);
g_xwin = XCreateSimpleWindow(g_xdisplay, g_xroot, 0, 0, 1280, 720, 0, 0, 0);
XSelectInput(g_xdisplay, g_xwin, StructureNotifyMask);
vulkan_gpu.SetValue(ICommandLine::ParamValue("-gpu"));
@@ -338,7 +343,6 @@ void IVideo::Init()
#undef VK_DEVICE_FUNCTION
IVideo_SwapchainInit();
XMapWindow(g_xdisplay, g_xwin);
XFlush(g_xdisplay);
@@ -346,10 +350,6 @@ void IVideo::Init()
}
char g_bConfigNotify = 0;
uint32_t g_nWindowWidth = 1280;
uint32_t g_nWindowHeight = 720;
void IVideo_HandleX11()
{
XEvent event;