Skip to content
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

Fix remote decoration drawing on OpenGL #1036

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dangelog
Copy link
Contributor

On Qt 6.8 enabling the "decorate target" button doesn't do anything. If we have to inject custom GL commands, we have to inform QtQuick that we're doing so, so wrap our after-rendering screengrab and overlay drawing in the appropriate calls.
Also, apparently can only be done while a pass is being recorded, so switch the connect() from afterRendering (pass has been recorded and finished, but not submitted) to afterRenderPassRecording (QQ2 has drawn itself but the pass is still active).

dangelog and others added 2 commits January 17, 2025 12:53
On Qt 6.8 enabling the "decorate target" button doesn't do anything.
If we have to inject custom GL commands, we have to inform QtQuick
that we're doing so, so wrap our after-rendering screengrab and overlay
drawing in the appropriate calls.
Also, apparently can only be done while a pass is being recorded, so
switch the connect() from afterRendering (pass has been recorded and
finished, but not submitted) to afterRenderPassRecording (QQ2 has
drawn itself but the pass is still active).
@dangelog dangelog requested review from Cuperino and Waqar144 January 17, 2025 12:59
@Cuperino
Copy link
Member

With this, realtime changes to QSG_VISUALIZE stop showing on the scene inspector, but they continue to work on the program's window. There must be something about the order of operations, or the scope being delimited by beginExternalCommands and endExternalCommands.

It might be okay to not show QSG_VISUALIZE changes in the inspector, considering there's some latency in the visuals. Tho not showing them would impact remote workflows.

@dangelog
Copy link
Contributor Author

Uhm, so it's a bit of a catch 22:

  • if we want decorations to be drawn on the target, we need to do it before the rendering pass is complete;
  • if we want to capture the special QSG drawing modes, we need to capture after. However, if we do this, we also end up capturing our own decorations (d'oh)...

Any idea how to solve this?

@dangelog
Copy link
Contributor Author

This is also likely to be relevant for RHI. While maybe with GL we can ignore Qt docs and capture+draw after the render pass is complete, we 100% will not be able to do so there.

@Cuperino
Copy link
Member

I'd like for us to move towards an RHI agnostic implementation at some point, so my inclination is towards capturing and drawing before the render pass is complete. The usability of looking at some of the special QSG drawing modes from the inspector is a bit questionable due to the low frame rate. Things should be good as long as users are able to view them from the application.

@dangelog
Copy link
Contributor Author

Well, that's the other problem I'm facing with the RHI implementation :)

I'd like to trigger a capture and then draw the target decorations, but I can't find a way to do so using RHI APIs. (In particular the "triggering a capture" part. I have a patch that "works", but captures after the render pass, thus it also gets the target decorations.)

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