-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
base: main
Are you sure you want to change the base?
Conversation
…param for the associated transform matrix
…to track if the ubo needs to be updated.
… path can also update the transform in the shader.
@@ -18,6 +18,7 @@ | |||
#define TNT_FILAMENT_BACKEND_PRIVATE_ACQUIREDIMAGE_H | |||
|
|||
#include <backend/DriverEnums.h> | |||
#include "math/mat3.h" |
There was a problem hiding this comment.
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] = {}; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
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.