-
Notifications
You must be signed in to change notification settings - Fork 439
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
GL::Context: pass InternalFlags as parameter #494
Conversation
Is there a way to see CircleCI results without giving them access to my entire GitHub account? |
Codecov Report
@@ Coverage Diff @@
## master #494 +/- ##
==========================================
- Coverage 79.50% 79.49% -0.01%
==========================================
Files 490 490
Lines 29436 29439 +3
==========================================
+ Hits 23403 23404 +1
- Misses 6033 6035 +2
Continue to review full report at Codecov.
|
You should only need to log in via GitHub. There's one a bit weird "first time use" behavior -- if you log in, it doesn't redirect you to the actual build log afterwards, but jumps to some "add watched repositories" page, which kinda looks like it wants access to your everything, yeah. Opening the link again when you're already logged in works. (Unfortunately Travis CI commited suicide and doesn't bother answering my e-mails so I had to switch providers... but this login requirement is the only major downside of CircleCI so far, another is buggy console color rendering but that's a minor wart compared to what I had to regularly go through with Travis.) The failed build was just some OOM error, and it works after a restart. I get 36 cores but anywhere between 8 and 32 GB RAM for each build, and sometimes the ultra-parallel jobs won't fit.
Yeah 😅 Because this API needs to be public and documented, it should be something else, and without the internal flags that are really not meant to be touched by users :) Give me some time to come up with acceptable naming. Apart from that, the change looks good in general. |
Nope AFAIK you actually need to give write access to every public repo you own just to log in:
Nevermind that I don't want to use it on my repos, I just wanted to view a build output on another user's repo... Anyway, I did that and revoked it immediately afterwards, no problem.
I actually thought it would be nice to be able to manipulate the logging flags. What I'm doing at the moment to be able to switch off logging for one context is: // Hide Magnum context initialization for this context
std::vector<const char*> argv{ "dummy",
"--magnum-log", "quiet"
};
int argc = argv.size();
Platform::GLContext context(argc, argv.data()); and I thought if I could directly un-set the DisplayInitializationLog flag that would be somehow cleaner: // A silent context without framebuffer.
Platform::GLContext context(GL::Context::InternalFlag::NoFramebuffer); So in my opinion renaming |
I'm not ignoring you, just having a big pile of things to get through 😅
Yep, that's one of the very common pain points. I realized the remaining So that expands the scope a bit. I'll try to implement and merge this until the end of the week, hope it doesn't stall you too much. Additionally, while working on something unrelated, I realized there's another potential race here: magnum/src/Magnum/GL/Framebuffer.cpp Lines 130 to 134 in df6da79
Will fix that as well, by just resetting the viewport to zero instead. |
Yes, using a Configuration-style setup sounds good! No worries, I'm fine working with my hacky patch for now :) |
Oookay, this is one of the "fixing the lightbulb" moments, because...
Nevertheless, I stopped the recursion at level 5 for now, I'm done with the base work on the Configuration, so the next step should finally be introducing the new flag 😅 |
Wow, I feel honored to have kicked off that chain ;) Let me know if I can help in any way. |
Okay, finally landed the last bit -- 8aceb25. It's still in the Thank you! |
Sorry for the lag ;) It seems to work just fine (tested I can test my full setup with streaming data tomorrow when I'm back in the lab, but I expect no issues there. |
... actually, there is something missing in /* GPU validation is enabled if either enables it */
[...]
/* Same for windowless contexts */
if(configuration.flags() & Configuration::Flag::Windowless)
_configurationFlags |= Configuration::Flag::Windowless; Some more info on my usage of the API, in case you need it (or I'm using something wrong): Main thread: worker.glContext = Platform::WindowlessGlxContext{
Platform::WindowlessGlxContext::Configuration{}
.setSharedContext(glxContext)
}; Worker thread: // Init our own GL context
worker.glContext.makeCurrent();
Platform::GLContext context(GL::Context::Configuration{}.addFlags(
GL::Context::Configuration::Flag::Windowless | GL::Context::Configuration::Flag::QuietLog
)); If I add the snippet above, everything works fine. |
That omission caused races on Fixed in abd07b6 ( |
No, actually you check magnum/src/Magnum/GL/Context.cpp Lines 990 to 991 in f357dde
I'll test again. |
Works fine 👍 |
Ah, haha, stupid me. The fix uncovered another stupid bug in my change that broke ES2 builds, fixed that now as well. When the CIs get green, I'll merge to master. |
Okay, the |
Here's a possible way to resolve #493 (GL::defaultFramebuffer gets clobbered when you create a second context).
I'm using the already existent InternalFlags enum set, adding a new
NoFramebuffer
flag, which skips initialization ofdefaultFramebuffer
. Additionally, the flags are exposed as additional parameters of theGL::Context
andPlatform::GLContext
constructors, allowing users to pass in the new flag.Coincidentally, this also allows to control the other flags without creating dummy argc/argv for
Platform::GLContext
, which feels much cleaner to me.In detail, the passed
flags
are applied before parsing the command line arguments.@mosra do you feel this is a good solution? Exposing a parameter called
InternalFlags
feels a bit daring, but I guess the Application classes already use that type ;)