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 bind function to avoid texture copy #34

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

Conversation

MartinHN
Copy link

@MartinHN MartinHN commented Dec 11, 2016

Hi guys,
first thanks for your awesome work!

I've recently discovered that syphon copy texture if used via publish texture,
osx openGL profiler (and the code comments) says a second texture is used internally in syphon servers.

So I've tried to add a true bind functionality to draw directly in embedded syphon FBO using syphon's bindToDrawFrameOfSize method to avoid texture copy from openframeworks to syphonn.
few comments :

  • I'm not an objective-C coder, so the few bits I've added there can be wrongly implemented
  • I presume that having one texture instead of two is best but I'm not completly aware of syphon inner-mechanisms (texture allocation cost,safety of accessing texture from servers, multi threading ....)

if the above sounds right i think it can be seen as a possibility to reduce graphics memory by two for ofxSyphon projects isn't it?
furthermore using textureID from syphon we can have the texture back in oF for further use (using syphon as a simple ofFbo)

[EDIT]
the typical use case is :
oF generates a big texture for a client and still want to display it

let me know what you think

if(!mSyphon) return ;
@autoreleasepool{
SyphonImage * Img =[(SyphonServer *)mSyphon newFrameImage] ;
Copy link
Collaborator

@bangnoise bangnoise May 3, 2018

Choose a reason for hiding this comment

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

This is a leak - newFrameImage returns the image retained, and it needs to live for the lifetime of mTex (or until the next call to updateCurrentTexture()) but then be released

@@ -10,14 +10,19 @@
#include "ofMain.h"

class ofxSyphonServer {
public:
public:
Copy link
Collaborator

Choose a reason for hiding this comment

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

avoid formatting-only changes please (also further down)

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