-
-
Notifications
You must be signed in to change notification settings - Fork 537
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
Add vulkan renderer #710
base: main
Are you sure you want to change the base?
Add vulkan renderer #710
Conversation
a0883ef
to
3e41b76
Compare
Copied from vkQuake3 which is in turn based on Quake III Kenny Edition
3e41b76
to
15ff484
Compare
Managed to get this PR to compile / run on a M4 Pro under MoltenVK just fine, seems like the existing vkQuake3 port didn't add one tiny little flag that's needed though: diff --git a/code/renderervk/vk_instance.c b/code/renderervk/vk_instance.c
index df8ef2b2..3f7b1433 100644
--- a/code/renderervk/vk_instance.c
+++ b/code/renderervk/vk_instance.c
@@ -194,7 +194,7 @@ static void vk_createInstance(void)
// pNext is NULL or a pointer to an extension-specific structure.
instanceCreateInfo.pNext = NULL;
// flags is reserved for future use.
- instanceCreateInfo.flags = 0;
+ instanceCreateInfo.flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
// pApplicationInfo is NULL or a pointer to an instance of
// VkApplicationInfo. If not NULL, this information helps
// implementations recognize behavior inherent to classes
diff --git a/code/renderervk/vulkan/vulkan_core.h b/code/renderervk/vulkan/vulkan_core.h
index d5110159..6a1dd2ab 100644
--- a/code/renderervk/vulkan/vulkan_core.h
+++ b/code/renderervk/vulkan/vulkan_core.h
@@ -207,6 +207,7 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
+ VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR = 395,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES = 1000094000,
VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO = 1000157000,
VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO = 1000157001, Probably not a very kosher way of adding this to the codebase, but always nice to go from not booting, to a perfectly fine running game, in a two line patch. Just a heads up! Thought this made sense to leave here rather than just keeping this to myself. |
@jackharrhy great thanks for the input. Wondering if you could also share the logs of the error / vulkan headers version for my own investigation? |
@runlevel5 np, here's how I can reproduce the error: build for macos arm64: works just fine run game: output
with my tiny patch, runs just fine
|
@jackharrhy wondering if you could re-produce the same issue with the vkQuake3 port? |
Following up on the green light given in the forum, I take liberty in extracting the vulkan renderer from vkQuake3 port (commit 5300b32803c1c61bc3b6bdf86a084c1db1a217ad) (all credits go to @suijingfeng)