Use of XrSwapchainCreateFlags for OpenXRCompositionLayer#108644
Use of XrSwapchainCreateFlags for OpenXRCompositionLayer#108644Repiteo merged 1 commit intogodotengine:masterfrom
XrSwapchainCreateFlags for OpenXRCompositionLayer#108644Conversation
|
Thanks! I don't think it makes sense to have "static" as an option, because we already support that for Also, you need to make sure that this flag is used for |
|
I've changed the enum to a simple bool. Also tested it and it still works. Off = pink screen, On = video is shown Also a question regarding the viewport based layers. Is there even the need to create a protected layer? I don't think it can be used properly but idk. I just added an extra if. |
|
I think I have to change something in this pr.. as I rebased based on the docs and now it wanna also merge the other files. |
0501d88 to
a9c31b1
Compare
There was a problem hiding this comment.
Thanks!
At a high-level, this is looking good. I've mostly got notes about naming, and one functional note with regard to recreating the swapchain when the source of the content is a subviewport
Oh, and in the end, you'll need to squash everything into a single commit per Godot's pull request worflow. See https://docs.godotengine.org/en/latest/contributing/workflow/pr_workflow.html#the-interactive-rebase
modules/openxr/extensions/openxr_composition_layer_extension.cpp
Outdated
Show resolved
Hide resolved
|
tried to address all of your feedback. Will squash if youre satisfied at the end |
m4gr3d
left a comment
There was a problem hiding this comment.
Haven't tested the changes but the code looks good.
|
What does the one failed Linux / Editor with Mono mean? |
It wants you to change the order if the property in the XML docs - I think it alphabetizes them? Here's the patch it gives: diff --git a/modules/openxr/doc_classes/OpenXRCompositionLayer.xml b/modules/openxr/doc_classes/OpenXRCompositionLayer.xml
index 38ade44..8921f8e 100644
--- a/modules/openxr/doc_classes/OpenXRCompositionLayer.xml
+++ b/modules/openxr/doc_classes/OpenXRCompositionLayer.xml
@@ -49,6 +49,10 @@
<member name="layer_viewport" type="SubViewport" setter="set_layer_viewport" getter="get_layer_viewport">
The [SubViewport] to render on the composition layer.
</member>
+ <member name="protected_content" type="bool" setter="set_protected_content" getter="is_protected_content" default="false">
+ If enabled, the OpenXR swapchain will be created with the [code]XR_SWAPCHAIN_CREATE_PROTECTED_CONTENT_BIT[/code] flag, which will protect its contents from CPU access.
+ When used with an Android Surface, this may allow DRM content to be presented, and will only take effect when the Surface is first created; later changes to this property will have no effect.
+ </member>
<member name="sort_order" type="int" setter="set_sort_order" getter="get_sort_order" default="1">
The sort order for this composition layer. Higher numbers will be shown in front of lower numbers.
[b]Note:[/b] This will have no effect if a fallback mesh is being used.
@@ -102,10 +106,6 @@
See [method get_android_surface] for information about how to get the surface so that your application can draw to it.
[b]Note:[/b] This will only work in Android builds.
</member>
- <member name="protected_content" type="bool" setter="set_protected_content" getter="is_protected_content" default="false">
- If enabled, the OpenXR swapchain will be created with the [code]XR_SWAPCHAIN_CREATE_PROTECTED_CONTENT_BIT[/code] flag, which will protect its contents from CPU access.
- When used with an Android Surface, this may allow DRM content to be presented, and will only take effect when the Surface is first created; later changes to this property will have no effect.
- </member>
</members>
<constants>
<constant name="FILTER_NEAREST" value="0" enum="Filter">So, just moving that section up to be below |
dsnopek
left a comment
There was a problem hiding this comment.
Thanks, this looks great! Just two tiny notes, and this needs to be squashed, but after that I'd be happy to approve :-)
98e59cf to
7f7e96a
Compare
|
I'm stupid.. forgot to remove the old part in the docs |
1bfb6d4 to
bc60036
Compare
|
OKay.. squashing annoyed me so much because it reverted some changes, but I think every proposed change is in there.. I hope i didn't miss anything. |
dsnopek
left a comment
There was a problem hiding this comment.
Thanks! I haven't tested, but the code looks great to me :-)
XrSwapchainCreateFlags for OpenXRCompositionLayer
- Introduced SwapchainCreateFlags enum to control swapchain creation (NORMAL, STATIC, PROTECTED) in OpenXR composition layers. - Allows creation of static layers (never change after creation) and protected layers (for DRM-protected content). - Changed internal logic from enum to bool for simplicity; users now select "protected" or not. - Added support for protected content in viewport-based layers. - Refactored naming, documentation, and improved reusability. - Minor cleanup: removed unused variable and added missing space.
beef8e3 to
ecfb962
Compare
|
Done.. i hope 🫡 |
|
Thanks! Congratulations on your first merged contribution! 🎉 |
Introduces SwapchainCreateFlags enum to control swapchain creation (NORMAL, STATIC, PROTECTED) in OpenXR composition layers.
This allows the user to set SwapChainCreate Flags to either have one static image on the composition layer or set the protected content flag which allows stuff like Widevine DRM protected videos to be displayed on the composition layer
As this is the first time ever creating something with c++, i am open for feedback, will try my best to answer to your guys' feedback and improve the code.
A question I have already: Should I rename the values in the enum, as "normal", "static" and "protected" are not that informative and "normal" is just not normal. it just sets a 0 as bit
Thanks ^^