Switch to using zvulkan

This commit is contained in:
Magnus Norddahl 2022-11-07 21:36:27 +01:00
parent 001a936994
commit 8427e4c98d
153 changed files with 1800 additions and 158 deletions

View file

@ -1,11 +1,10 @@
cmake_minimum_required( VERSION 2.4 )
if( COMMAND cmake_policy )
cmake_policy( SET CMP0003 NEW )
endif( COMMAND cmake_policy )
cmake_minimum_required(VERSION 3.11)
include( CheckFunctionExists )
include( CheckCXXCompilerFlag )
add_subdirectory( thirdparty/ZVulkan )
project( ZDRay )
SET( CMAKE_CXX_STANDARD 17 )
@ -175,17 +174,6 @@ set( SOURCES
src/lightmap/collision.h
src/lightmap/delauneytriangulator.cpp
src/lightmap/delauneytriangulator.h
src/lightmap/vulkandevice.cpp
src/lightmap/vulkandevice.h
src/lightmap/vulkanobjects.h
src/lightmap/vulkanbuilders.cpp
src/lightmap/vulkanbuilders.h
src/lightmap/vulkancompatibledevice.cpp
src/lightmap/vulkancompatibledevice.h
src/lightmap/vulkaninstance.cpp
src/lightmap/vulkaninstance.h
src/lightmap/vulkansurface.cpp
src/lightmap/vulkansurface.h
src/lightmap/stacktrace.cpp
src/lightmap/stacktrace.h
src/lightmap/surfaceclip.cpp
@ -225,131 +213,6 @@ set(THIRDPARTY_SOURCES
${CMAKE_SOURCE_DIR}/thirdparty/dp_rect_pack/dp_rect_pack.h
${CMAKE_SOURCE_DIR}/thirdparty/miniz/miniz.h
${CMAKE_SOURCE_DIR}/thirdparty/miniz/miniz.c
${CMAKE_SOURCE_DIR}/thirdparty/vk_mem_alloc/vk_mem_alloc.h
${CMAKE_SOURCE_DIR}/thirdparty/vk_mem_alloc/vk_mem_alloc.cpp
${CMAKE_SOURCE_DIR}/thirdparty/volk/volk.c
${CMAKE_SOURCE_DIR}/thirdparty/volk/volk.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/SymbolTable.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/propagateNoContraction.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/PoolAlloc.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/Intermediate.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/gl_types.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/parseVersions.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/attribute.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/Scan.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/iomapper.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/ParseHelper.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/glslang_tab.cpp.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/SymbolTable.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/RemoveTree.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/Versions.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/reflection.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/LiveTraverser.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/iomapper.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/intermOut.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/Versions.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/Initialize.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/linkValidate.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/InfoSink.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/Constant.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/IntermTraverse.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/propagateNoContraction.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/glslang_tab.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/ShaderLang.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/preprocessor/Pp.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/preprocessor/PpTokens.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/preprocessor/PpAtom.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/preprocessor/PpContext.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/preprocessor/PpTokens.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/preprocessor/PpScanner.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/preprocessor/PpContext.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/attribute.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/localintermediate.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/parseConst.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/Initialize.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/limits.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/ParseContextBase.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/RemoveTree.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/ParseHelper.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/Scan.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/reflection.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/ScanContext.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/pch.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/MachineIndependent/SpirvIntrinsics.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/OSDependent/osinclude.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/GenericCodeGen/Link.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/GenericCodeGen/CodeGen.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Public/ShaderLang.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/ConstantUnion.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/InitializeGlobals.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/Common.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/PoolAlloc.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/arrays.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/ShHandle.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/InfoSink.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/ResourceLimits.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/Types.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/BaseTypes.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/intermediate.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/Include/SpirvIntrinsics.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/Logger.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/GlslangToSpv.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/SPVRemapper.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/GLSL.ext.EXT.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/hex_float.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/doc.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/disassemble.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/SpvPostProcess.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/bitutils.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/InReadableOrder.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/GLSL.ext.AMD.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/GLSL.ext.NV.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/SPVRemapper.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/SpvBuilder.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/GLSL.ext.KHR.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/disassemble.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/SpvBuilder.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/GlslangToSpv.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/doc.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/SpvTools.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/spvIR.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/Logger.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/SpvTools.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/spirv/GLSL.std.450.h
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/OGLCompilersDLL/InitializeDll.cpp
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/OGLCompilersDLL/InitializeDll.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vk_sdk_platform.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_fuchsia.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_win32.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_ios.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vk_icd.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vk_layer.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_xcb.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_macos.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vk_layer_dispatch_table.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_ggp.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_core.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_wayland.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_metal.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_android.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_vi.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vk_platform.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_mir.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_xlib_xrandr.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_xlib.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vk_enum_string_helper.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_beta.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_directfb.h
${CMAKE_SOURCE_DIR}/thirdparty/vulkan/vulkan_screen.h
)
set(THIRDPARTY_WIN32_SOURCES
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/OSDependent/Windows/ossource.cpp
)
set(THIRDPARTY_UNIX_SOURCES
${CMAKE_SOURCE_DIR}/thirdparty/ShaderCompiler/glslang/OSDependent/Unix/ossource.cpp
)
if( SSE_MATTERS )
@ -385,10 +248,6 @@ if( WIN32 )
else( CMAKE_COMPILER_IS_GNUCXX )
set( SOURCES ${SOURCES} src/platform/windows/resource.rc )
endif( CMAKE_COMPILER_IS_GNUCXX )
set(THIRDPARTY_SOURCES ${THIRDPARTY_SOURCES} ${THIRDPARTY_WIN32_SOURCES})
else()
set(THIRDPARTY_SOURCES ${THIRDPARTY_SOURCES} ${THIRDPARTY_UNIX_SOURCES})
endif( WIN32 )
if(MSVC)
@ -425,8 +284,8 @@ set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${REL_C_F
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEB_C_FLAGS} -D_DEBUG" )
add_executable( zdray ${SOURCES} ${THIRDPARTY_SOURCES} )
target_link_libraries( zdray ${ZDRAY_LIBS} ${PROF_LIB} ${PLATFORM_LIB} )
include_directories( src "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty" )
target_link_libraries( zdray zvulkan ${ZDRAY_LIBS} ${PROF_LIB} ${PLATFORM_LIB} )
include_directories( src "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/ZVulkan/include" "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty" )
source_group("Sources" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/src/.+")
source_group("Sources\\BlockmapBuilder" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/src/blockmapbuilder/.+")
@ -444,8 +303,4 @@ source_group("Sources\\Models" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/
source_group("thirdparty" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/.+")
source_group("thirdparty\\dp_rect_pack" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/dp_rect_pack/.+")
source_group("thirdparty\\ShaderCompiler" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/ShaderCompiler/.+")
source_group("thirdparty\\vk_mem_alloc" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/vk_mem_alloc/.+")
source_group("thirdparty\\volk" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/volk/.+")
source_group("thirdparty\\vulkan" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/vulkan/.+")
source_group("thirdparty\\miniz" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/miniz/.+")

View file

@ -6,8 +6,8 @@
#include "framework/binfile.h"
#include "framework/templates.h"
#include "framework/halffloat.h"
#include "vulkanbuilders.h"
#include "vulkancompatibledevice.h"
#include <zvulkan/vulkanbuilders.h>
#include <zvulkan/vulkancompatibledevice.h>
#include "renderdoc_app.h"
#include "stacktrace.h"
#include <map>

View file

@ -1,8 +1,8 @@
#pragma once
#include "vulkandevice.h"
#include "vulkanobjects.h"
#include <zvulkan/vulkandevice.h>
#include <zvulkan/vulkanobjects.h>
class LevelMesh;

198
thirdparty/ZVulkan/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,198 @@
cmake_minimum_required(VERSION 3.11)
project(zvulkan)
set(ZVULKAN_SOURCES
src/vulkanbuilders.cpp
src/vulkancompatibledevice.cpp
src/vulkandevice.cpp
src/vulkaninstance.cpp
src/vulkansurface.cpp
src/vulkanswapchain.cpp
src/vk_mem_alloc/vk_mem_alloc.cpp
src/vk_mem_alloc/vk_mem_alloc.natvis
src/volk/volk.c
src/glslang/glslang/MachineIndependent/SymbolTable.h
src/glslang/glslang/MachineIndependent/propagateNoContraction.cpp
src/glslang/glslang/MachineIndependent/PoolAlloc.cpp
src/glslang/glslang/MachineIndependent/Intermediate.cpp
src/glslang/glslang/MachineIndependent/gl_types.h
src/glslang/glslang/MachineIndependent/parseVersions.h
src/glslang/glslang/MachineIndependent/attribute.cpp
src/glslang/glslang/MachineIndependent/Scan.cpp
src/glslang/glslang/MachineIndependent/iomapper.h
src/glslang/glslang/MachineIndependent/ParseHelper.h
src/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
src/glslang/glslang/MachineIndependent/SymbolTable.cpp
src/glslang/glslang/MachineIndependent/RemoveTree.cpp
src/glslang/glslang/MachineIndependent/Versions.h
src/glslang/glslang/MachineIndependent/reflection.cpp
src/glslang/glslang/MachineIndependent/LiveTraverser.h
src/glslang/glslang/MachineIndependent/iomapper.cpp
src/glslang/glslang/MachineIndependent/intermOut.cpp
src/glslang/glslang/MachineIndependent/Versions.cpp
src/glslang/glslang/MachineIndependent/Initialize.h
src/glslang/glslang/MachineIndependent/linkValidate.cpp
src/glslang/glslang/MachineIndependent/InfoSink.cpp
src/glslang/glslang/MachineIndependent/Constant.cpp
src/glslang/glslang/MachineIndependent/IntermTraverse.cpp
src/glslang/glslang/MachineIndependent/propagateNoContraction.h
src/glslang/glslang/MachineIndependent/glslang_tab.cpp
src/glslang/glslang/MachineIndependent/ShaderLang.cpp
src/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp
src/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h
src/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp
src/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp
src/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp
src/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp
src/glslang/glslang/MachineIndependent/preprocessor/PpContext.h
src/glslang/glslang/MachineIndependent/attribute.h
src/glslang/glslang/MachineIndependent/localintermediate.h
src/glslang/glslang/MachineIndependent/parseConst.cpp
src/glslang/glslang/MachineIndependent/Initialize.cpp
src/glslang/glslang/MachineIndependent/limits.cpp
src/glslang/glslang/MachineIndependent/ParseContextBase.cpp
src/glslang/glslang/MachineIndependent/RemoveTree.h
src/glslang/glslang/MachineIndependent/ParseHelper.cpp
src/glslang/glslang/MachineIndependent/Scan.h
src/glslang/glslang/MachineIndependent/reflection.h
src/glslang/glslang/MachineIndependent/ScanContext.h
src/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp
src/glslang/glslang/OSDependent/osinclude.h
src/glslang/glslang/GenericCodeGen/Link.cpp
src/glslang/glslang/GenericCodeGen/CodeGen.cpp
src/glslang/glslang/Public/ShaderLang.h
src/glslang/glslang/Include/ConstantUnion.h
src/glslang/glslang/Include/InitializeGlobals.h
src/glslang/glslang/Include/Common.h
src/glslang/glslang/Include/PoolAlloc.h
src/glslang/glslang/Include/arrays.h
src/glslang/glslang/Include/ShHandle.h
src/glslang/glslang/Include/InfoSink.h
src/glslang/glslang/Include/ResourceLimits.h
src/glslang/glslang/Include/Types.h
src/glslang/glslang/Include/BaseTypes.h
src/glslang/glslang/Include/intermediate.h
src/glslang/glslang/Include/SpirvIntrinsics.h
src/glslang/glslang/Include/build_info.h
src/glslang/glslang/OSDependent/osinclude.h
src/glslang/spirv/Logger.h
src/glslang/spirv/GlslangToSpv.cpp
src/glslang/spirv/SPVRemapper.h
src/glslang/spirv/GLSL.ext.EXT.h
src/glslang/spirv/hex_float.h
src/glslang/spirv/doc.cpp
src/glslang/spirv/disassemble.cpp
src/glslang/spirv/SpvPostProcess.cpp
src/glslang/spirv/bitutils.h
src/glslang/spirv/InReadableOrder.cpp
src/glslang/spirv/GLSL.ext.AMD.h
src/glslang/spirv/GLSL.ext.NV.h
src/glslang/spirv/SPVRemapper.cpp
src/glslang/spirv/SpvBuilder.h
src/glslang/spirv/GLSL.ext.KHR.h
src/glslang/spirv/disassemble.h
src/glslang/spirv/SpvBuilder.cpp
src/glslang/spirv/GlslangToSpv.h
src/glslang/spirv/doc.h
src/glslang/spirv/SpvTools.cpp
src/glslang/spirv/spvIR.h
src/glslang/spirv/Logger.cpp
src/glslang/spirv/SpvTools.h
src/glslang/spirv/GLSL.std.450.h
src/glslang/spirv/NonSemanticDebugPrintf.h
src/glslang/OGLCompilersDLL/InitializeDll.cpp
src/glslang/OGLCompilersDLL/InitializeDll.h
)
set(ZVULKAN_INCLUDES
include/zvulkan/vulkanbuilders.h
include/zvulkan/vulkancompatibledevice.h
include/zvulkan/vulkandevice.h
include/zvulkan/vulkaninstance.h
include/zvulkan/vulkanobjects.h
include/zvulkan/vulkansurface.h
include/zvulkan/vulkanswapchain.h
include/zvulkan/volk/volk.h
include/zvulkan/vk_mem_alloc/vk_mem_alloc.h
)
set(ZVULKAN_WIN32_SOURCES
src/glslang/glslang/OSDependent/Windows/ossource.cpp
)
set(ZVULKAN_UNIX_SOURCES
src/glslang/glslang/OSDependent/Unix/ossource.cpp
)
set(VULKAN_INCLUDES
include/vulkan/vk_enum_string_helper.h
include/vulkan/vk_icd.h
include/vulkan/vk_layer.h
include/vulkan/vk_layer_dispatch_table.h
include/vulkan/vk_platform.h
include/vulkan/vk_sdk_platform.h
include/vulkan/vulkan.h
include/vulkan/vulkan_android.h
include/vulkan/vulkan_beta.h
include/vulkan/vulkan_core.h
include/vulkan/vulkan_directfb.h
include/vulkan/vulkan_fuchsia.h
include/vulkan/vulkan_ggp.h
include/vulkan/vulkan_ios.h
include/vulkan/vulkan_macos.h
include/vulkan/vulkan_metal.h
include/vulkan/vulkan_mir.h
include/vulkan/vulkan_screen.h
include/vulkan/vulkan_vi.h
include/vulkan/vulkan_wayland.h
include/vulkan/vulkan_win32.h
include/vulkan/vulkan_xcb.h
include/vulkan/vulkan_xlib.h
include/vulkan/vulkan_xlib_xrandr.h
)
source_group("src" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/.+")
source_group("src\\glslang" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/.+")
source_group("src\\glslang\\glslang" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/glslang/.+")
source_group("src\\glslang\\glslang\\GenericCodeGen" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/glslang/GenericCodeGen/.+")
source_group("src\\glslang\\glslang\\Include" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/glslang/Include/.+")
source_group("src\\glslang\\glslang\\MachineIndependent" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/glslang/MachineIndependent/.+")
source_group("src\\glslang\\glslang\\MachineIndependent\\preprocessor" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/glslang/MachineIndependent/preprocessor/.+")
source_group("src\\glslang\\glslang\\OSDependent" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/glslang/OSDependent/.+")
source_group("src\\glslang\\glslang\\OSDependent\\Unix" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/glslang/OSDependent/Unix/.+")
source_group("src\\glslang\\glslang\\OSDependent\\Web" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/glslang/OSDependent/Web/.+")
source_group("src\\glslang\\glslang\\OSDependent\\Windows" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/glslang/OSDependent/Windows/.+")
source_group("src\\glslang\\glslang\\Public" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/glslang/Public/.+")
source_group("src\\glslang\\OGLCompilersDLL" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/OGLCompilersDLL/.+")
source_group("src\\glslang\\spirv" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/spirv/.+")
source_group("src\\vk_mem_alloc" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/vk_mem_alloc/.+")
source_group("src\\volk" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/src/volk/.+")
source_group("include" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/include/zvulkan/.+")
source_group("include\\vk_mem_alloc" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/include/zvulkan/vk_mem_alloc/.+")
source_group("include\\volk" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/include/zvulkan/volk/.+")
source_group("example" REGULAR_EXPRESSION "${CMAKE_CURRENT_SOURCE_DIR}/example/.+")
include_directories(include include/zvulkan src)
if(WIN32)
set(ZVULKAN_SOURCES ${ZVULKAN_SOURCES} ${ZVULKAN_WIN32_SOURCES})
add_definitions(-DUNICODE -D_UNICODE)
else()
set(ZVULKAN_SOURCES ${ZVULKAN_SOURCES} ${ZVULKAN_UNIX_SOURCES})
set(ZVULKAN_LIBS ${CMAKE_DL_LIBS} -ldl)
add_definitions(-DUNIX -D_UNIX)
add_link_options(-pthread)
endif()
if(MSVC)
# Use all cores for compilation
set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS}")
# Ignore warnings in third party code
#set_source_files_properties(${ZVULKAN_SOURCES} PROPERTIES COMPILE_FLAGS "/wd4244 /wd4267 /wd4005 /wd4018 -D_CRT_SECURE_NO_WARNINGS")
endif()
add_library(zvulkan STATIC ${ZVULKAN_SOURCES} ${ZVULKAN_INCLUDES} ${VULKAN_INCLUDES})
target_link_libraries(zvulkan ${ZVULKAN_LIBS})
set_target_properties(zvulkan PROPERTIES CXX_STANDARD 17)

90
thirdparty/ZVulkan/LICENSE.md vendored Normal file
View file

@ -0,0 +1,90 @@
# License information
## License for ZVulkan itself
// Copyright (c) 2016-2022 Magnus Norddahl
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
## License for src/vk_mem_alloc
// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
## License for src/volk
/**
* Copyright (c) 2018-2019 Arseny Kapoulkine
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
## License for include/zvulkan/vulkan
/*
** Copyright (c) 2015-2019 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
## License for src/glslang
See src/glslang/LICENSE.txt

2
thirdparty/ZVulkan/README.md vendored Normal file
View file

@ -0,0 +1,2 @@
# ZVulkan
A framework for building vulkan applications

View file

@ -11,13 +11,15 @@
#include "volk/volk.h"
#include "vk_mem_alloc/vk_mem_alloc.h"
#if defined(_WIN32)
#undef min
#undef max
#include "ShaderCompiler/glslang/Public/ShaderLang.h"
#include "ShaderCompiler/spirv/GlslangToSpv.h"
#endif
#include <functional>
#include <memory>
#include <string>
class VulkanDeviceFeatures
{

View file

@ -0,0 +1,50 @@
#pragma once
#include "vulkandevice.h"
class VulkanSemaphore;
class VulkanFence;
class VulkanSwapChain
{
public:
VulkanSwapChain(VulkanDevice *device, bool vsync);
~VulkanSwapChain();
uint32_t acquireImage(int width, int height, bool exclusivefullscreen, VulkanSemaphore *semaphore = nullptr, VulkanFence *fence = nullptr);
void queuePresent(uint32_t imageIndex, VulkanSemaphore *semaphore = nullptr);
bool vsync;
VkSwapchainKHR swapChain = VK_NULL_HANDLE;
VkSurfaceFormatKHR swapChainFormat;
VkPresentModeKHR swapChainPresentMode;
std::vector<VkImage> swapChainImages;
std::vector<VkImageView> swapChainImageViews;
VkExtent2D actualExtent;
bool newSwapChain = true;
private:
void selectFormat();
void selectPresentMode(bool fullscreen);
bool createSwapChain(int width, int height, bool fullscreen, VkSwapchainKHR oldSwapChain = VK_NULL_HANDLE);
void createViews();
void getImages();
void releaseResources();
void releaseViews();
void recreate(int width, int height, bool fullscreen);
std::vector<VkSurfaceFormatKHR> getSurfaceFormats();
std::vector<VkPresentModeKHR> getPresentModes(bool exclusivefullscreen);
VulkanDevice *device = nullptr;
int lastSwapWidth = 0;
int lastSwapHeight = 0;
bool lastFullscreen = false;
VulkanSwapChain(const VulkanSwapChain &) = delete;
VulkanSwapChain &operator=(const VulkanSwapChain &) = delete;
};

1016
thirdparty/ZVulkan/src/glslang/LICENSE.txt vendored Normal file

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more