-
Notifications
You must be signed in to change notification settings - Fork 681
Implement Vulkan renderer #1330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JKSunny
wants to merge
50
commits into
JACoders:master
Choose a base branch
from
JKSunny:openjk-dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
1271068
Vulkan: Add vulkan renderer
JKSunny f5cef91
Vulkan: If the level has a global fog and fastsky is not enabled,
JKSunny 2110ff2
Vulkan: Fix skybox images being compressed even when noTC is in the s…
JKSunny 4882743
Merge remote-tracking branch 'rend2/rend2'
JKSunny 1d13398
Vulkan: Update to latest beta branch
JKSunny a710cc3
Vulkan: Restructure model_t to use union
JKSunny f83fd00
Vulkan: model_t union causes some artifacts, use struct
JKSunny 68f719d
Vulkan: Fix newly introduced x86 compiler error
JKSunny e7a811a
Merge branch 'heads/rend2'
JKSunny 58d4f5e
Merge branch 'heads/rend2'
JKSunny 1b53fd3
Merge branch 'heads/rend2'
JKSunny 992a39f
Merge branch 'heads/rend2'
JKSunny f3a9bb1
Merge branch 'heads/rend2'
JKSunny 69166cb
Merge branch 'heads/rend2'
JKSunny 36de129
Merge branch 'heads/rend2'
JKSunny a6924c2
Merge branch 'heads/rend2'
JKSunny 49c827e
Vulkan: Fix inaccurate descriptorset layout bindings
JKSunny 3c50667
Vulkan: Refactor glsl compiler and restructure md3 to mdv struct
JKSunny 343f973
Vulkan: Fix undefined store operation warning
JKSunny d07cc95
Vulkan: Use vanilla method of shaded flares
JKSunny 0029cbc
Vulkan: Remove flare fade out and modify distance test bias
JKSunny 748265b
Vulkan: Merge latest changes from beta
JKSunny f0cb3b5
Vulkan: Merge latest changes from beta
JKSunny f31afa1
Vulkan: Insignificant refactoring & define guarding
JKSunny 6c0d257
Merge remote-tracking branch 'master/master'
JKSunny f0587cf
Vulkan: Merge latest changes from beta
JKSunny 96ad3e6
Merge remote-tracking branch 'master/master'
JKSunny ededf24
Vulkan: Merge latest changes from beta
JKSunny f128f1e
Merge remote-tracking branch 'master/master'
JKSunny a108402
Vulkan: Merge latest changes from beta
JKSunny 8f987de
Merge remote-tracking branch 'master/master'
JKSunny 574ad47
Vulkan: Merge latest changes from beta
JKSunny 2ea56cc
Merge remote-tracking branch 'master/master'
JKSunny 15cc247
Merge remote-tracking branch 'master/master'
JKSunny 92eef09
Vulkan: Merge latest changes from master
JKSunny 709fb37
Merge remote-tracking branch 'master/master'
JKSunny d729ce9
Vulkan: Merge latest changes from beta
JKSunny f3ec6fc
Merge remote-tracking branch 'master/master'
JKSunny e6f3983
Vulkan: Disable vbo model caching by default
JKSunny 5f1f2dd
Merge remote-tracking branch 'master/master'
JKSunny 5d04dce
Vulkan: Merge latest changes from master
JKSunny 312018e
CICD: Update macos runners
JKSunny 9d9c4dc
Vulkan: Merge latest changes from master
JKSunny 0211315
Vulkan: Merge latest changes from master
JKSunny 7fdaf3d
Vulkan: Merge latest changes from master
JKSunny d6d6bb7
Apply fix from https://github.com/pnggroup/libpng/commit/893b8113f04d…
taysta b31da7d
Vulkan: Fix potential invalid memory access in tess.xstages
JKSunny 20fa0b7
Vulkan: Move contribution notice section to rd-vulkan README.md
JKSunny 2e9feb8
Vulkan: Rework renderer memory management
JKSunny 2892ae3
Vulkan: Disable VK_OBJECT_TRACKER and cleanup commented API calls
JKSunny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,203 @@ | ||
| #============================================================================ | ||
| # Copyright (C) 2013 - 2018, OpenJK contributors | ||
| # | ||
| # This file is part of the OpenJK source code. | ||
| # | ||
| # OpenJK is free software; you can redistribute it and/or modify it | ||
| # under the terms of the GNU General Public License version 2 as | ||
| # published by the Free Software Foundation. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
| #============================================================================ | ||
|
|
||
| # Make sure the user is not executing this script directly | ||
| if(NOT InOpenJK) | ||
| message(FATAL_ERROR "Use the top-level cmake script!") | ||
| endif(NOT InOpenJK) | ||
|
|
||
| # Check for dependencies first | ||
|
|
||
| set(MPVulkanRendererIncludeDirectories ${MPDir}) | ||
| set(MPVulkanRendererIncludeDirectories | ||
| ${MPVulkanRendererIncludeDirectories} | ||
| ${SharedDir} | ||
| ${MPDir} | ||
| "${MPDir}/rd-vulkan" | ||
| "${GSLIncludeDirectory}" | ||
| ) | ||
|
|
||
| set(MPVulkanRendererFiles | ||
| "${MPDir}/rd-vulkan/G2_API.cpp" | ||
| "${MPDir}/rd-vulkan/G2_bolts.cpp" | ||
| "${MPDir}/rd-vulkan/G2_bones.cpp" | ||
| "${MPDir}/rd-vulkan/G2_gore_r2.cpp" | ||
| "${MPDir}/rd-vulkan/G2_gore_r2.h" | ||
| "${MPDir}/rd-vulkan/G2_misc.cpp" | ||
| "${MPDir}/rd-vulkan/G2_surfaces.cpp" | ||
| "${MPDir}/rd-vulkan/tr_backend.cpp" | ||
| "${MPDir}/rd-vulkan/tr_bsp.cpp" | ||
| "${MPDir}/rd-vulkan/tr_cache.h" | ||
| "${MPDir}/rd-vulkan/tr_cache.cpp" | ||
| "${MPDir}/rd-vulkan/tr_cmds.cpp" | ||
| "${MPDir}/rd-vulkan/tr_curve.cpp" | ||
| "${MPDir}/rd-vulkan/tr_decals.cpp" | ||
| "${MPDir}/rd-vulkan/tr_ghoul2.cpp" | ||
| "${MPDir}/rd-vulkan/tr_image.cpp" | ||
| "${MPDir}/rd-vulkan/tr_init.cpp" | ||
| "${MPDir}/rd-vulkan/tr_light.cpp" | ||
| "${MPDir}/rd-vulkan/tr_local.h" | ||
| "${MPDir}/rd-vulkan/tr_main.cpp" | ||
| "${MPDir}/rd-vulkan/tr_marks.cpp" | ||
| "${MPDir}/rd-vulkan/tr_mesh.cpp" | ||
| "${MPDir}/rd-vulkan/tr_model.cpp" | ||
| "${MPDir}/rd-vulkan/tr_quicksprite.cpp" | ||
| "${MPDir}/rd-vulkan/tr_quicksprite.h" | ||
| "${MPDir}/rd-vulkan/tr_scene.cpp" | ||
| "${MPDir}/rd-vulkan/tr_shade.cpp" | ||
| "${MPDir}/rd-vulkan/tr_shader.cpp" | ||
| "${MPDir}/rd-vulkan/tr_shade_calc.cpp" | ||
| "${MPDir}/rd-vulkan/tr_shadows.cpp" | ||
| "${MPDir}/rd-vulkan/tr_skin.cpp" | ||
| "${MPDir}/rd-vulkan/tr_sky.cpp" | ||
| "${MPDir}/rd-vulkan/tr_subs.cpp" | ||
| "${MPDir}/rd-vulkan/tr_surface.cpp" | ||
| "${MPDir}/rd-vulkan/tr_surfacesprites.cpp" | ||
| "${MPDir}/rd-vulkan/tr_world.cpp" | ||
| "${MPDir}/rd-vulkan/tr_WorldEffects.cpp" | ||
| "${MPDir}/rd-vulkan/tr_WorldEffects.h" | ||
| "${MPDir}/rd-vulkan/vk_attachments.cpp" | ||
| "${MPDir}/rd-vulkan/vk_bloom.cpp" | ||
| "${MPDir}/rd-vulkan/vk_cmd.cpp" | ||
| "${MPDir}/rd-vulkan/vk_debug.cpp" | ||
| "${MPDir}/rd-vulkan/vk_dynamic_glow.cpp" | ||
| "${MPDir}/rd-vulkan/vk_flares.cpp" | ||
| "${MPDir}/rd-vulkan/vk_frame.cpp" | ||
| "${MPDir}/rd-vulkan/vk_image.cpp" | ||
| "${MPDir}/rd-vulkan/vk_image_process.cpp" | ||
| "${MPDir}/rd-vulkan/vk_info.cpp" | ||
| "${MPDir}/rd-vulkan/vk_init.cpp" | ||
| "${MPDir}/rd-vulkan/vk_instance.cpp" | ||
| "${MPDir}/rd-vulkan/vk_local.h" | ||
| "${MPDir}/rd-vulkan/vk_pipelines.cpp" | ||
| "${MPDir}/rd-vulkan/vk_shaders.cpp" | ||
| "${MPDir}/rd-vulkan/vk_shade_geometry.cpp" | ||
| "${MPDir}/rd-vulkan/vk_swapchain.cpp" | ||
| "${MPDir}/rd-vulkan/vk_vbo.cpp" | ||
| "${MPDir}/rd-vulkan/vk_vbo_surfacesprites.cpp" | ||
| ) | ||
| source_group("renderer" FILES ${MPVulkanRendererFiles}) | ||
|
|
||
| set(MPVulkanRendererGhoul2Files | ||
| "${MPDir}/ghoul2/g2_local.h" | ||
| "${MPDir}/ghoul2/ghoul2_shared.h" | ||
| "${MPDir}/ghoul2/G2_gore.cpp" | ||
| "${MPDir}/ghoul2/G2_gore.h") | ||
| source_group("ghoul2" FILES ${MPVulkanRendererGhoul2Files}) | ||
| set(MPVulkanRendererFiles ${MPVulkanRendererFiles} ${MPVulkanRendererGhoul2Files}) | ||
|
|
||
| set(MPVulkanRendererRdCommonFiles | ||
| "${MPDir}/rd-common/mdx_format.h" | ||
| "${MPDir}/rd-common/tr_common.h" | ||
| "${MPDir}/rd-common/tr_font.cpp" | ||
| "${MPDir}/rd-common/tr_font.h" | ||
| "${MPDir}/rd-common/tr_image_load.cpp" | ||
| "${MPDir}/rd-common/tr_image_jpg.cpp" | ||
| "${MPDir}/rd-common/tr_image_tga.cpp" | ||
| "${MPDir}/rd-common/tr_image_png.cpp" | ||
| "${MPDir}/rd-common/tr_noise.cpp" | ||
| "${MPDir}/rd-common/tr_public.h" | ||
| "${MPDir}/rd-common/tr_types.h") | ||
| source_group("rd-common" FILES ${MPVulkanRendererRdCommonFiles}) | ||
| set(MPVulkanRendererFiles ${MPVulkanRendererFiles} ${MPVulkanRendererRdCommonFiles}) | ||
|
|
||
| set(MPVulkanRendererVulkanAssets | ||
| "${MPDir}/rd-vulkan/vulkan/vk_platform.h" | ||
| "${MPDir}/rd-vulkan/vulkan/vulkan.h" | ||
| "${MPDir}/rd-vulkan/vulkan/vulkan_core.h" | ||
| "${MPDir}/rd-vulkan/vulkan/vulkan_win32.h" | ||
| "${MPDir}/rd-vulkan/vulkan/vulkan_xlib.h" | ||
| "${MPDir}/rd-vulkan/vulkan/vulkan_xlib_xrandr.h") | ||
| source_group("renderer\\vulkan" FILES ${MPVulkanRendererVulkanAssets}) | ||
| set(MPVulkanRendererFiles ${MPVulkanRendererFiles} ${MPVulkanRendererVulkanAssets}) | ||
|
|
||
| set(MPVulkanRendererUtils | ||
| "${MPDir}/rd-vulkan/utils/stb_dxt.h") | ||
| source_group("renderer\\utils" FILES ${MPVulkanRendererUtils}) | ||
| set(MPVulkanRendererFiles ${MPVulkanRendererFiles} ${MPVulkanRendererUtils}) | ||
|
|
||
| set(MPVulkanRendererCommonFiles | ||
| "${MPDir}/qcommon/matcomp.cpp" | ||
| "${MPDir}/qcommon/q_shared.cpp" | ||
|
|
||
| ${SharedCommonFiles}) | ||
| source_group("common" FILES ${MPVulkanRendererCommonFiles}) | ||
| set(MPVulkanRendererFiles ${MPVulkanRendererFiles} ${MPVulkanRendererCommonFiles}) | ||
|
|
||
| set(MPVulkanRendererCommonSafeFiles | ||
| ${SharedCommonSafeFiles} | ||
| ) | ||
| source_group("common/safe" FILES ${MPVulkanRendererCommonSafeFiles}) | ||
| set(MPVulkanRendererFiles ${MPVulkanRendererFiles} ${MPVulkanRendererCommonSafeFiles}) | ||
|
|
||
| # Transparently use either bundled or system libjpeg. | ||
| list(APPEND MPVulkanRendererIncludeDirectories ${JPEG_INCLUDE_DIR}) | ||
| list(APPEND MPVulkanRendererLibraries ${JPEG_LIBRARIES}) | ||
|
|
||
| # Transparently use either bundled or system libpng. Order is important -- | ||
| # libpng used zlib, so it must come before it on the linker command line. | ||
| list(APPEND MPVulkanRendererIncludeDirectories ${PNG_INCLUDE_DIRS}) | ||
| list(APPEND MPVulkanRendererLibraries ${PNG_LIBRARIES}) | ||
|
|
||
| # Transparently use either bundled or system zlib. | ||
| list(APPEND MPVulkanRendererIncludeDirectories ${ZLIB_INCLUDE_DIR}) | ||
| list(APPEND MPVulkanRendererLibraries ${ZLIB_LIBRARIES}) | ||
|
|
||
| # Transparently use our bundled minizip. | ||
| list(APPEND MPVulkanRendererIncludeDirectories ${MINIZIP_INCLUDE_DIRS}) | ||
| list(APPEND MPVulkanRendererLibraries ${MINIZIP_LIBRARIES}) | ||
|
|
||
| #find_package(OpenGL REQUIRED) | ||
| #set(MPVulkanRendererIncludeDirectories ${MPVulkanRendererIncludeDirectories} ${OPENGL_INCLUDE_DIR}) | ||
| #set(MPVulkanRendererLibraries ${MPVulkanRendererLibraries} ${OPENGL_LIBRARIES}) | ||
|
|
||
| set(MPVulkanRendererIncludeDirectories ${MPVulkanRendererIncludeDirectories} ${OpenJKLibDir}) | ||
| add_library(${MPVulkanRenderer} SHARED ${MPVulkanRendererFiles}) | ||
|
|
||
| if(NOT MSVC) | ||
| # remove "lib" prefix for .so/.dylib files | ||
| set_target_properties(${MPVulkanRenderer} PROPERTIES PREFIX "") | ||
| endif() | ||
|
|
||
| if(WIN32) | ||
| install(TARGETS ${MPVulkanRenderer} | ||
| RUNTIME | ||
| DESTINATION ${JKAInstallDir} | ||
| COMPONENT ${JKAMPClientComponent}) | ||
| else(WIN32) | ||
| if(MakeApplicationBundles AND BuildMPEngine) | ||
| install(TARGETS ${MPVulkanRenderer} | ||
| LIBRARY | ||
| DESTINATION "${JKAInstallDir}/${MPEngine}.app/Contents/MacOS/" | ||
| COMPONENT ${JKAMPClientComponent}) | ||
| else() | ||
| install(TARGETS ${MPVulkanRenderer} | ||
| LIBRARY | ||
| DESTINATION ${JKAInstallDir} | ||
| COMPONENT ${JKAMPClientComponent}) | ||
| endif() | ||
| endif() | ||
|
|
||
| set_target_properties(${MPVulkanRenderer} PROPERTIES COMPILE_DEFINITIONS "${SharedDefines}") | ||
|
|
||
| # Hide symbols not explicitly marked public. | ||
| set_property(TARGET ${MPVulkanRenderer} APPEND PROPERTY COMPILE_OPTIONS ${OPENJK_VISIBILITY_FLAGS}) | ||
|
|
||
| set_target_properties(${MPVulkanRenderer} PROPERTIES INCLUDE_DIRECTORIES "${MPVulkanRendererIncludeDirectories}") | ||
| set_target_properties(${MPVulkanRenderer} PROPERTIES PROJECT_LABEL "MP Vulkan Renderer") | ||
| target_link_libraries(${MPVulkanRenderer} ${MPVulkanRendererLibraries}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, where does this come from?
Should this be in the project gitignore, or your local?
Compiled versions of bin2hex and bindshader have been committed. All or nothing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing,
When developers want to compile
GLSL->SPIR-V, compile_threaded.bat uses cl.exe to compile it.Same for the other two.
I added it to .gitignore cus Windows Firewall/Github Desktop was whining about something.
The other compiled executables are tiny, thats why I left them.
I can add a .gitignore to the tools folder and remove it from the root one.
or a global *.exe, w/e you prefer, let me know :)