Skip to content

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

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.

#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.

@jcelerier jcelerier force-pushed the master branch 4 times, most recently from a402674 to c16c15a Compare December 31, 2025 15:14
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