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

Add a way to pass a transform matrix along with Stream::setAcquiredImage #8496

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ajmalk
Copy link

@ajmalk ajmalk commented Mar 6, 2025

Followup to #8493

Streams in OpenGL are either backed by SurfaceTexture (Native in filament) or ImageReader (Acquired in filament). SurfaceTextures have a transform attached to the image that's updated every frame but have to be read from the GL thread. The ImageReader path has the same transform but is read from the main thread. The transform in the SurfaceTexture path can be optionally requested in the shader (see #8490). This PR adds a way for the ImageReader path to also update this transform.

@@ -18,6 +18,7 @@
#define TNT_FILAMENT_BACKEND_PRIVATE_ACQUIREDIMAGE_H

#include <backend/DriverEnums.h>
#include "math/mat3.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

use <>

@@ -176,7 +176,7 @@ class DriverBase : public Driver {
CallbackData(CallbackData&&) = delete;
CallbackData& operator=(CallbackData const &) = delete;
CallbackData& operator=(CallbackData&&) = delete;
void* storage[8] = {};
void* storage[13] = {};
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can't change that, it was very much chosen to be 64 bytes. there should have been a comment.

@@ -2087,7 +2087,7 @@ Handle<HwStream> OpenGLDriver::createStreamAcquired() {
// called only once per frame. If the user pushes images to the same stream multiple times in a
// single frame, we emit a warning and honor only the final image, but still invoke all callbacks.
void OpenGLDriver::setAcquiredImage(Handle<HwStream> sh, void* hwbuffer,
CallbackHandler* handler, StreamCallback cb, void* userData) {
CallbackHandler* handler, StreamCallback cb, void* userData, math::mat3f transform) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

since we have access to the stream here, why do we need to receive the transform? can't we just ask the stream?

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