Skip to content

feature/enable vulkan raytracing extensions #1827

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
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

YunmaoLeo
Copy link

ScreenNode: add vulkan device extensions when initializing vulkan instances

@jcelerier
Copy link
Member

Change looks good but what happens if the user does not have a device that supports raytracing ? will it just safely ignore the changes?

@YunmaoLeo YunmaoLeo force-pushed the feat/patch_for_raytracing branch 3 times, most recently from 9b7c6a1 to 858107b Compare July 14, 2025 08:41
@YunmaoLeo YunmaoLeo force-pushed the feat/patch_for_raytracing branch from 858107b to 7962fb8 Compare July 14, 2025 08:43
@YunmaoLeo
Copy link
Author

@jcelerier

Change looks good but what happens if the user does not have a device that supports raytracing ? will it just safely ignore the changes?

Yes it will be safe. According to Qt documententation, it is safe to add deviceExtensions even if the physical device might not support them.

QRhiVulkanInitParams::deviceExtensions
Optional, empty by default. The list of Vulkan device extensions to enable. Unsupported extensions are ignored gracefully.

Also, I've moved the code for creating the vulkan device and enabling raytracing extensions to vulkan.cpp. Please review the commit when you get a chance. Thank you!

@jcelerier
Copy link
Member

thanks! will take some time to review it today

@@ -55,5 +56,188 @@ QVulkanInstance* staticVulkanInstance(bool create)

return g_staticVulkanInstance;
}

// Returns true if the device supports ray tracing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the vulkan code should be in the

#if defined(QT_FEATURE_vulkan) && QT_CONFIG(vulkan) && __has_include(<vulkan/vulkan.h>)

guard as some platforms don't have vulkan

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not really sure, but I think all the vulkan related code here is fully wrapped in the guard.
Let me know if I missed anything, happy to adjust further.

@@ -1,6 +1,7 @@
#include <score/gfx/Vulkan.hpp>

#if defined(QT_FEATURE_vulkan) && QT_CONFIG(vulkan) && __has_include(<vulkan/vulkan.h>)
#include "QRhiGles2.hpp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should go in here, and it should be with <qrhigles2.hpp> header formata

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I've made a mistake here. I've changed it to correct header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants