windows
authorJohn Tsiombikas <nuclear@member.fsf.org>
Sat, 7 Sep 2024 09:44:20 +0000 (12:44 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Sat, 7 Sep 2024 09:44:20 +0000 (12:44 +0300)
src/app.c
src/main_w32.c [new file with mode: 0644]
src/util.h
src/vk.c
vktest3.sln [new file with mode: 0644]
vktest3.vcxproj [new file with mode: 0644]
vktest3.vcxproj.filters [new file with mode: 0644]

index bc931d1..6f9e8f9 100644 (file)
--- a/src/app.c
+++ b/src/app.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include "app.h"
 #include "vk.h"
 
@@ -107,8 +106,6 @@ void app_display(void)
 
        /* swap buffers after drawing is finished */
        vk_present(queue, imgid, sem_draw);
-
-       usleep(10000);
 }
 
 void app_reshape(int x, int y)
diff --git a/src/main_w32.c b/src/main_w32.c
new file mode 100644 (file)
index 0000000..119df1b
--- /dev/null
@@ -0,0 +1,246 @@
+#include <stdio.h>
+#include <windows.h>
+#include "app.h"
+#include "vk.h"
+
+static int create_window(const char *title, int xsz, int ysz);
+static void destroy_window(void);
+static void handle_events(void);
+
+static int translate_vkey(int vkey);
+static void calc_win_rect(RECT *rect, int x, int y, int w, int h);
+static LRESULT CALLBACK handle_msg(HWND win, unsigned int msg, WPARAM wparam, LPARAM lparam);
+
+static HINSTANCE hinst;
+static HWND win;
+static int quit;
+
+static int win_width, win_height, mapped;
+
+static int init_done, reshape_pending;
+static HDC dc;
+static WNDCLASSEX wc;
+
+
+int main(int argc, char **argv)
+{
+       hinst = GetModuleHandle(0);
+
+       if(create_window("vulkan test 3", 1280, 800) == -1) {
+               return 1;
+       }
+       vk_init_win(hinst, win);
+
+       win_width = 1280;
+       win_height = 800;
+
+       if(app_init() == -1) {
+               destroy_window();
+               return 1;
+       }
+
+       for(;;) {
+               MSG msg;
+               while(PeekMessage(&msg, win, 0, 0, PM_REMOVE)) {
+                       TranslateMessage(&msg);
+                       DispatchMessage(&msg);
+                       if(quit) return;
+               }
+
+               if(reshape_pending) {
+                       reshape_pending = 0;
+                       app_reshape(win_width, win_height);
+               }
+
+               app_display();
+       }
+
+       app_cleanup();
+       destroy_window();
+       return 0;
+}
+
+void app_quit(void)
+{
+       quit = 1;
+}
+
+void app_swap_buffers(void)
+{
+}
+
+
+static int create_window(const char *title, int xsz, int ysz)
+{
+       RECT rect;
+
+       if(!init_done) {
+               wc.cbSize = sizeof wc;
+               wc.hbrBackground = GetStockObject(BLACK_BRUSH);
+               wc.hCursor = LoadCursor(0, IDC_ARROW);
+               wc.hIcon = wc.hIconSm = LoadIcon(0, IDI_APPLICATION);
+               wc.hInstance = hinst;
+               wc.lpfnWndProc = handle_msg;
+               wc.lpszClassName = "vktest3";
+               wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
+               if(!RegisterClassEx(&wc)) {
+                       fprintf(stderr, "failed to register window class\n");
+                       return -1;
+               }
+               init_done = 1;
+       }
+
+       rect.left = GetSystemMetrics(SM_CXSCREEN) / 3;
+       rect.top = GetSystemMetrics(SM_CYSCREEN) / 3;
+       calc_win_rect(&rect, rect.left, rect.top, xsz, ysz);
+
+       if(!(win = CreateWindow("vktest3", title, WS_OVERLAPPEDWINDOW, rect.left, rect.top, rect.right - rect.left,
+                       rect.bottom - rect.top, 0, 0, hinst, 0))) {
+               return -1;
+       }
+       dc = GetDC(win);
+       ShowWindow(win, 1);
+       SetForegroundWindow(win);
+       SetFocus(win);
+
+       reshape_pending = 1;
+       return 0;
+}
+
+static void destroy_window(void)
+{
+       if(win) {
+               DestroyWindow(win);
+               win = 0;
+       }
+}
+
+static void handle_events(void)
+{
+       MSG msg;
+       while(PeekMessage(&msg, win, 0, 0, PM_REMOVE)) {
+               TranslateMessage(&msg);
+               DispatchMessage(&msg);
+               if(quit) return;
+       }
+
+       if(reshape_pending) {
+               reshape_pending = 0;
+               app_reshape(win_width, win_height);
+       }
+}
+
+static void calc_win_rect(RECT *rect, int x, int y, int w, int h)
+{
+       rect->left = x;
+       rect->top = y;
+       rect->right = x + w;
+       rect->bottom = y + h;
+       AdjustWindowRect(rect, WS_OVERLAPPEDWINDOW, 0);
+}
+
+static LRESULT CALLBACK handle_msg(HWND win, unsigned int msg, WPARAM wparam, LPARAM lparam)
+{
+       static int mouse_x, mouse_y;
+       int x, y, bn, key;
+
+       switch(msg) {
+       case WM_CLOSE:
+       case WM_DESTROY:
+               PostQuitMessage(0);
+               quit = 1;
+               break;
+
+       case WM_PAINT:
+               ValidateRect(win, 0);
+               break;
+
+       case WM_SIZE:
+               x = lparam & 0xffff;
+               y = lparam >> 16;
+               if(x != win_width || y != win_height) {
+                       win_width = x;
+                       win_height = y;
+                       reshape_pending = 1;
+               }
+               break;
+
+       case WM_SHOWWINDOW:
+               mapped = wparam;
+               break;
+
+       case WM_KEYDOWN:
+       case WM_SYSKEYDOWN:
+               key = translate_vkey(wparam);
+               app_keyboard(key, 1);
+               break;
+
+       case WM_KEYUP:
+       case WM_SYSKEYUP:
+               key = translate_vkey(wparam);
+               app_keyboard(key, 1);
+               break;
+
+       case WM_LBUTTONDOWN:
+               bn = 0;
+               if(0)
+       case WM_MBUTTONDOWN:
+               bn = 1;
+               if(0)
+       case WM_RBUTTONDOWN:
+               bn = 2;
+               app_mouse(bn, 1, lparam & 0xffff, lparam >> 16);
+               break;
+
+       case WM_LBUTTONUP:
+               bn = 0;
+               if(0)
+       case WM_MBUTTONUP:
+               bn = 1;
+               if(0)
+       case WM_RBUTTONUP:
+               bn = 2;
+               app_mouse(bn, 0, lparam & 0xffff, lparam >> 16);
+               break;
+
+       case WM_MOUSEMOVE:
+               app_motion(lparam & 0xffff, lparam >> 16);
+               break;
+
+       default:
+               return DefWindowProc(win, msg, wparam, lparam);
+       }
+
+       return 0;
+}
+
+static int translate_vkey(int vkey)
+{
+       switch(vkey) {
+       /*case VK_PRIOR: return GLUT_KEY_PAGE_UP;
+       case VK_NEXT: return GLUT_KEY_PAGE_DOWN;
+       case VK_END: return GLUT_KEY_END;
+       case VK_HOME: return GLUT_KEY_HOME;
+       case VK_LEFT: return GLUT_KEY_LEFT;
+       case VK_UP: return GLUT_KEY_UP;
+       case VK_RIGHT: return GLUT_KEY_RIGHT;
+       case VK_DOWN: return GLUT_KEY_DOWN;*/
+       case VK_OEM_1: return ';';
+       case VK_OEM_2: return '/';
+       case VK_OEM_3: return '`';
+       case VK_OEM_4: return '[';
+       case VK_OEM_5: return '\\';
+       case VK_OEM_6: return ']';
+       case VK_OEM_7: return '\'';
+       default:
+               break;
+       }
+
+       if(vkey >= 'A' && vkey <= 'Z') {
+               vkey += 32;
+       }/* else if(vkey >= VK_F1 && vkey <= VK_F12) {
+               vkey -= VK_F1 + GLUT_KEY_F1;
+       }*/
+
+       return vkey;
+}
index 61ae532..61f6d47 100644 (file)
@@ -4,7 +4,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#if defined(__WATCOMC__) || defined(WIN32)
+#if defined(__WATCOMC__) || defined(_WIN32)
 #include <malloc.h>
 #else
 #if !defined(__FreeBSD__) && !defined(__OpenBSD__)
index a18a0cd..c73cf31 100644 (file)
--- a/src/vk.c
+++ b/src/vk.c
@@ -86,6 +86,7 @@ static int create_device(void);
 static int create_swapchain(void);
 static int create_default_cmdbuf(void);
 
+static void *init_rayext_list(void);
 static int choose_pixfmt(void);
 static int eval_pdev_score(VkPhysicalDevice dev);
 static int have_inst_layer(const char *name);
@@ -133,6 +134,7 @@ static uint32_t num_pdev;
 
 static int have_raytrace, have_debug_report;
 
+
 #ifdef _WIN32
 void vk_init_win(HINSTANCE hi, HWND w)
 {
@@ -323,7 +325,7 @@ int vk_find_qfamily(unsigned int flags)
 
        if(!qfam) return -1;    /* not initialized I guess... */
 
-       for(i=0; i<num_qfam; i++) {
+       for(i=0; i<(int)num_qfam; i++) {
                vkGetPhysicalDeviceSurfaceSupportKHR(vkpdev, i, vksurf, &can_pres);
 
                if((flags & VKQ_PRESENT) && !can_pres) {
@@ -347,7 +349,7 @@ VkQueue vk_getq_fam(int fam, int n)
        VkQueue q;
 
        if(fam < 0) return 0;
-       if(n < 0 || n >= qfam[fam].queueCount) {
+       if(n < 0 || n >= (int)qfam[fam].queueCount) {
                fprintf(stderr, "vk_getq_fam: invalid index %d, family %d has %d queues\n",
                           n, fam, qfam[fam].queueCount);
                return 0;
@@ -1160,11 +1162,11 @@ static int create_instance(void)
        vkEnumerateInstanceExtensionProperties(0, &inst_ext_count, inst_ext);
 
        printf("Layers:\n");
-       for(i=0; i<inst_layers_count; i++) {
+       for(i=0; i<(int)inst_layers_count; i++) {
                printf(" - %s: %s\n", inst_layers[i].layerName, inst_layers[i].description);
        }
        printf("Instance extensions:\n");
-       for(i=0; i<inst_ext_count; i++) {
+       for(i=0; i<(int)inst_ext_count; i++) {
                printf(" - %s\n", inst_ext[i].extensionName);
        }
 
@@ -1242,7 +1244,6 @@ int choose_phys_dev(void)
        uint32_t i, num_pdev, score, best_score, best_dev;
        VkPhysicalDevice *pdev;
        VkPhysicalDeviceProperties pdevprop;
-       VkBool32 can_pres;
 
        vkEnumeratePhysicalDevices(vk, &num_pdev, 0);
        if(!num_pdev) {
@@ -1287,7 +1288,7 @@ static int create_device(void)
 {
        float *prio;
        VkDeviceQueueCreateInfo qinf[MAX_INIT_QUEUE] = {0};
-       VkPhysicalDeviceFeatures feat = {0};
+       /*VkPhysicalDeviceFeatures feat = {0};*/
        VkDeviceCreateInfo devinf = {0};
        const char *ext[ARRSZ(known_devext_list) + 16];
        int i, j, num_ext, qfam, totalq;
@@ -1350,10 +1351,26 @@ static int create_device(void)
        devinf.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
        devinf.pQueueCreateInfos = qinf;
        devinf.queueCreateInfoCount = num_initq;
-       devinf.pEnabledFeatures = &feat;
+       devinf.pEnabledFeatures = 0;/*&feat;*/
        devinf.enabledExtensionCount = num_ext;
        devinf.ppEnabledExtensionNames = ext;
 
+       if(initflags & VKINIT_RAY) {
+               VkPhysicalDeviceProperties2 prop2 = {0};
+               VkPhysicalDeviceRayTracingPipelinePropertiesKHR rtprop = {0};
+
+               prop2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               prop2.pNext = &rtprop;
+               rtprop.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR;
+               vkGetPhysicalDeviceProperties2(vkpdev, &prop2);
+
+               printf("RT max recursion depth: %u\n", rtprop.maxRayRecursionDepth);
+               printf("RT max hit attrib size: %u\n", rtprop.maxRayHitAttributeSize);
+               printf("RT max ray distpatch: %u\n", rtprop.maxRayDispatchInvocationCount);
+
+               devinf.pNext = init_rayext_list();
+       }
+
        if(vkCreateDevice(vkpdev, &devinf, 0, &vkdev) != 0) {
                fprintf(stderr, "failed to create vulkan device\n");
                return -1;
@@ -1361,6 +1378,28 @@ static int create_device(void)
        return 0;
 }
 
+static void *init_rayext_list(void)
+{
+       static VkPhysicalDeviceFeatures2 feat2;
+       static VkPhysicalDeviceVulkan12Features vk12;
+       static VkPhysicalDeviceVulkan11Features vk11;
+       static VkPhysicalDeviceAccelerationStructureFeaturesKHR acc;
+       static VkPhysicalDeviceRayTracingPipelineFeaturesKHR rtpipe;
+
+       feat2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
+       feat2.pNext = &vk12;
+       vk12.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES;
+       vk12.pNext = &vk11;
+       vk11.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES;
+       vk11.pNext = &acc;
+       acc.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR;
+       acc.pNext = &rtpipe;
+       rtpipe.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR;
+
+       vkGetPhysicalDeviceFeatures2(vkpdev, &feat2);
+       return &feat2;
+}
+
 static int create_swapchain(void)
 {
        int i;
@@ -1393,7 +1432,10 @@ static int create_swapchain(void)
 
        if(!vksc_img) {
                free(vksc_img);
-               vkGetSwapchainImagesKHR(vkdev, vksc, &num, 0);
+               if(vkGetSwapchainImagesKHR(vkdev, vksc, &num, 0) != 0) {
+                       fprintf(stderr, "vkGetSwapchainImagesKHR failed\n");
+                       return -1;
+               }
                vksc_img = malloc_nf(num * sizeof *vksc_img);
                vkGetSwapchainImagesKHR(vkdev, vksc, &num, vksc_img);
        }
@@ -1403,7 +1445,7 @@ static int create_swapchain(void)
        }
        vksc_numimg = num;
 
-       for(i=0; i<num; i++) {
+       for(i=0; i<(int)num; i++) {
                memset(&ivinf, 0, sizeof ivinf);
                ivinf.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
                ivinf.image = vksc_img[i];
@@ -1427,7 +1469,7 @@ static int create_swapchain(void)
 
 static int create_default_cmdbuf(void)
 {
-       int i, qfam;
+       int qfam;
        VkCommandPool cmdpool;
        VkCommandBufferAllocateInfo cbinf = {0};
 
@@ -1549,7 +1591,7 @@ static int choose_pixfmt(void)
        vkGetPhysicalDeviceSurfaceFormatsKHR(vkpdev, vksurf, &num_fmt, vksurf_fmt);
 
        vksurf_selfmt = 0;
-       for(i=0; i<num_fmt; i++) {
+       for(i=0; i<(int)num_fmt; i++) {
                if(vksurf_fmt[i].colorSpace != VK_COLOR_SPACE_SRGB_NONLINEAR_KHR) {
                        continue;
                }
@@ -1570,7 +1612,7 @@ static int choose_pixfmt(void)
 static int have_inst_layer(const char *name)
 {
        int i;
-       for(i=0; i<inst_layers_count; i++) {
+       for(i=0; i<(int)inst_layers_count; i++) {
                if(strcmp(inst_layers[i].layerName, name) == 0) {
                        return 1;
                }
diff --git a/vktest3.sln b/vktest3.sln
new file mode 100644 (file)
index 0000000..a9d8e10
--- /dev/null
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.11.35222.181
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vktest3", "vktest3.vcxproj", "{862FE05B-CDED-4EB5-B591-53E5E62B6D63}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|x64 = Debug|x64
+               Debug|x86 = Debug|x86
+               Release|x64 = Release|x64
+               Release|x86 = Release|x86
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {862FE05B-CDED-4EB5-B591-53E5E62B6D63}.Debug|x64.ActiveCfg = Debug|x64
+               {862FE05B-CDED-4EB5-B591-53E5E62B6D63}.Debug|x64.Build.0 = Debug|x64
+               {862FE05B-CDED-4EB5-B591-53E5E62B6D63}.Debug|x86.ActiveCfg = Debug|Win32
+               {862FE05B-CDED-4EB5-B591-53E5E62B6D63}.Debug|x86.Build.0 = Debug|Win32
+               {862FE05B-CDED-4EB5-B591-53E5E62B6D63}.Release|x64.ActiveCfg = Release|x64
+               {862FE05B-CDED-4EB5-B591-53E5E62B6D63}.Release|x64.Build.0 = Release|x64
+               {862FE05B-CDED-4EB5-B591-53E5E62B6D63}.Release|x86.ActiveCfg = Release|Win32
+               {862FE05B-CDED-4EB5-B591-53E5E62B6D63}.Release|x86.Build.0 = Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+       GlobalSection(ExtensibilityGlobals) = postSolution
+               SolutionGuid = {1F08629C-2AEB-4DF1-98F5-5C796154CCEE}
+       EndGlobalSection
+EndGlobal
diff --git a/vktest3.vcxproj b/vktest3.vcxproj
new file mode 100644 (file)
index 0000000..5f91e0c
--- /dev/null
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <VCProjectVersion>17.0</VCProjectVersion>
+    <Keyword>Win32Proj</Keyword>
+    <ProjectGuid>{862fe05b-cded-4eb5-b591-53e5e62b6d63}</ProjectGuid>
+    <RootNamespace>vktest3</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v143</PlatformToolset>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v143</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v143</PlatformToolset>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v143</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+      <AdditionalIncludeDirectories>C:\VulkanSDK\1.3.290.0\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996;4244</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>C:\VulkanSDK\1.3.290.0\Lib32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>vulkan-1.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+      <AdditionalIncludeDirectories>C:\VulkanSDK\1.3.290.0\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996;4244</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>C:\VulkanSDK\1.3.290.0\Lib32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>vulkan-1.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+      <AdditionalIncludeDirectories>C:\VulkanSDK\1.3.290.0\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996;4244</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>C:\VulkanSDK\1.3.290.0\Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>vulkan-1.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+      <AdditionalIncludeDirectories>C:\VulkanSDK\1.3.290.0\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996;4244</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>C:\VulkanSDK\1.3.290.0\Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>vulkan-1.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="src\app.c" />
+    <ClCompile Include="src\darray.c" />
+    <ClCompile Include="src\main_w32.c" />
+    <ClCompile Include="src\util.c" />
+    <ClCompile Include="src\vk.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="src\app.h" />
+    <ClInclude Include="src\darray.h" />
+    <ClInclude Include="src\util.h" />
+    <ClInclude Include="src\vk.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
diff --git a/vktest3.vcxproj.filters b/vktest3.vcxproj.filters
new file mode 100644 (file)
index 0000000..201506d
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="src">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="src\app.c">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\darray.c">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\util.c">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\vk.c">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\main_w32.c">
+      <Filter>src</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="src\app.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\darray.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\util.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\vk.h">
+      <Filter>src</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>