godlikepanos / anki-3d-engine

AnKi 3D Engine - Vulkan backend, modern renderer, scripting, physics and more
http://www.anki3d.org
Other
1.35k stars 88 forks source link

Running Sponza sample gives an error on Windows #114

Open dmitrykolesnikovich opened 1 year ago

dmitrykolesnikovich commented 1 year ago
[I][CORE] Using settings dir "C:\Users\dmitrykolesnikovich/.anki" [App.cpp:399][initDirs][Main]
[I][CORE] Initializing application (version 0.1, optimized, NO dbg symbols, NO extra checks, NOT built with tracing, compiler MSVC 193532216, build date Apr  4 2023, commit 3cc6423) [App.cpp:211][initInternal][Main]
[I][CORE] Number of job threads: 8 [App.cpp:222][initInternal][Main]
[I][CORE] Creating SDL window. SDL version 2.0 [NativeWindowSdl.cpp:85][init][Main]
[I][CORE] SDL window created [NativeWindowSdl.cpp:145][init][Main]
[I][VK  ] Initializing Vulkan backend [GrManagerImpl.cpp:120][initInternal][Main]
[I][VK  ] Will enable the following instance extensions: [GrManagerImpl.cpp:373][initInstance][Main]
[I][VK  ]       VK_KHR_surface [GrManagerImpl.cpp:376][initInstance][Main]
[I][VK  ]       VK_KHR_win32_surface [GrManagerImpl.cpp:376][initInstance][Main]
[I][VK  ] Number of physical devices: 1 [GrManagerImpl.cpp:423][initInstance][Main]
[I][VK  ] GPU is NVIDIA GeForce RTX 3060. Vendor identified as nVidia [GrManagerImpl.cpp:516][initInstance][Main]
[I][VK  ] Number of queue families: 4 [GrManagerImpl.cpp:555][initDevice][Main]
[I][VK  ] Async compute is enabled [GrManagerImpl.cpp:600][initDevice][Main]
[I][VK  ] Will enable the following device extensions: [GrManagerImpl.cpp:781][initDevice][Main]
[I][VK  ]       VK_EXT_scalar_block_layout [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ]       VK_EXT_sampler_filter_minmax [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ]       VK_EXT_descriptor_indexing [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ]       VK_KHR_timeline_semaphore [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ]       VK_KHR_swapchain [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ]       VK_KHR_spirv_1_4 [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ]       VK_KHR_shader_float_controls [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ]       VK_KHR_shader_float16_int8 [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ]       VK_KHR_shader_atomic_int64 [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ]       VK_KHR_maintenance4 [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ]       VK_KHR_create_renderpass2 [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ]       VK_KHR_buffer_device_address [GrManagerImpl.cpp:784][initDevice][Main]
[I][VK  ] Robust buffer access is disabled [GrManagerImpl.cpp:799][initDevice][Main]
[I][VK  ] VK_KHR_fragment_shading_rate is not supported or disabled [GrManagerImpl.cpp:1027][initDevice][Main]
[I][VK  ] Created a swapchain. Image count: 3, present mode: 0, size: 2560x1440, vsync: 0 [SwapchainFactory.cpp:228][initInternal][Main]
[I][VK  ] Will load 36 bytes of pipeline cache [PipelineCache.cpp:62][init][Main]
[I][VK  ] Vulkan memory info: [GrManagerImpl.cpp:1132][initMemory][Main]
[I][VK  ]       Heap 0 size 12718178304 [GrManagerImpl.cpp:1135][initMemory][Main]
[I][VK  ]       Heap 1 size 17111273472 [GrManagerImpl.cpp:1135][initMemory][Main]
[I][VK  ]       Heap 2 size 224395264 [GrManagerImpl.cpp:1135][initMemory][Main]
[I][VK  ]       Mem type 0 points to heap 1, flags 00000000000000000000000000000000 [GrManagerImpl.cpp:1141][initMemory][Main]
[I][VK  ]       Mem type 1 points to heap 0, flags 00000000000000000000000000000001 [GrManagerImpl.cpp:1141][initMemory][Main]
[I][VK  ]       Mem type 2 points to heap 1, flags 00000000000000000000000000000110 [GrManagerImpl.cpp:1141][initMemory][Main]
[I][VK  ]       Mem type 3 points to heap 1, flags 00000000000000000000000000001110 [GrManagerImpl.cpp:1141][initMemory][Main]
[I][VK  ]       Mem type 4 points to heap 2, flags 00000000000000000000000000000111 [GrManagerImpl.cpp:1141][initMemory][Main]
[I][VK  ] R8G8B8, R16G16B16 and R32G32B32 image formats are not supported [GrManagerImpl.cpp:194][initInternal][Main]
[I][CORE] Executable path is: D:\workspace\anki\build\Bin\Debug\Sponza.exe [App.cpp:299][initInternal][Main]
[I][RSRC] Added new data path "D:\workspace\anki\build\Bin\Debug" that contains 20 files [ResourceFilesystem.cpp:353][addNewPath][Main]
[I][RSRC] Added new data path "D:/workspace/anki" that contains 10922 files [ResourceFilesystem.cpp:353][addNewPath][Main]
[I][RSRC] Added new data path "D:/workspace/anki/Samples/Sponza" that contains 222 files [ResourceFilesystem.cpp:353][addNewPath][Main]
[I][RSRC] Initializing resource manager [ResourceManager.cpp:43][init][Main]
[I][RSRC] Will use 256MB of memory for transfer scratch [TransferGpuAllocator.cpp:55][init][Main]
[I][REND] Initializing main renderer. Swapchain resolution 2560x1440 [MainRenderer.cpp:41][init][Main]
[I][REND] Initializing offscreen renderer. Resolution 2560x1440. Internal resolution 2560x1440 [Renderer.cpp:135][initInternal][Main]
[E][UTIL] Failed to open file "ShaderBinaries/ClearTextureCompute.ankiprogbin", open mode "rb" [File.cpp:116][openCFile][Main]
[E][RSRC] Resource file not found: ShaderBinaries/ClearTextureCompute.ankiprogbin [ResourceFilesystem.cpp:374][openFile][Main]
[E][RSRC] Failed to load resource: ShaderBinaries/ClearTextureCompute.ankiprogbin [ResourceManager.cpp:113][loadResource][Main]
[E][REND] Failed to initialize the renderer [Renderer.cpp:114][init][Main]
[E][CORE] App initialization failed. Shutting down [App.cpp:164][init][Main]
[I][REND] Destroying main renderer [MainRenderer.cpp:28][~MainRenderer][Main]
[I][RSRC] Destroying resource manager [ResourceManager.cpp:34][~ResourceManager][Main]
[I][VK  ] Destroying Vulkan backend [GrManagerImpl.cpp:23][~GrManagerImpl][Main]
[I][VK  ] Dumped 36 bytes of the pipeline cache [PipelineCache.cpp:111][destroyInternal][Main]
[I][CORE] Destroying application [App.cpp:110][~App][Main]
[E][N/A ] Error reported. Bye!! [Main.cpp:39][myMain][Main]
dmitrykolesnikovich commented 1 year ago

It works when I run Debug\Sponza.exe under d:\workspace\anki\build\Bin though.

godlikepanos commented 1 year ago

Hi thanks for the report.

You are getting an error because the engine can't find the shader binaries. AnKi's CMake copies the .exe to a bin directory along with the shader binaries. When running a .exe the engine tries to load the shader binaries by looking at the same directory the .exe is in.

I guess you used CMake from the command line to build it right? I should change the documentation.