Perl 6 - the future is here, just unevenly distributed

IRC log for #pogl, 2016-12-17

| Channels | #pogl index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
02:30 chm joined #pogl
18:44 chm joined #pogl
22:54 chm Mithaldu: I'm not sure about glGetIntegerv_p or the 3 indent, this Helpers.pm has been repurposed as in its pod
22:54 chm Mithaldu: ok, now I'm less confused.  I thought I was the one messed up---still learning containers and windows in irssi
22:55 Mithaldu chm: the 3 indent is only for the two introductury blocks, the rest is normal 4 indent
22:55 Mithaldu so yeah, you wanna fix that
22:55 Mithaldu well you have also talked in #pdl instead of #pogl and i just hadn't noticed it
22:55 Mithaldu glGetIntegerv_p missing is an annoyance to me, as OpenGL.pm had it
22:56 Mithaldu and reading helpers.pm i guess it is not "BYOB" territory regarding that?
22:57 Mithaldu also not looking forward to trying to replace OpenGL::Image
22:58 chm Mithaldu: ok
22:58 chm glGetIntegerv_p is still in OpenGL
22:58 chm The work on OpenGL::Modern is to move forward.
22:59 Mithaldu is the expectation to have both loaded in the meantime?
22:59 chm My plan is that the default would be less explicit re _c, _s, _p but still similar to the raw C API
22:59 chm That is pretty much the same as OpenGL did but without the _c, _p, or _s
23:00 CandyAngel So is the goal to make it Perl-ish or stay with the C interface?
23:00 Mithaldu for raisins of optimization i think we do need all variants
23:00 chm In the interim, you can load some of both from OpenGL and OpenGL::Modern
23:00 CandyAngel Sure, could always wrap it with Modern::OpenGL::Perlish :P
23:01 Mithaldu chm: ok, loading both for now, works for me
23:01 chm The plan is to provide optimized routines as _x or whatever as needed.
23:01 chm I don't think with the use of buffers and programmable shaders that the overhead is as important as for OpenGL
23:02 chm And OpenGL was pretty good at performance.
23:02 CandyAngel As long as it is fast enough for my (VR enabled) game engine :P
23:03 chm Per discussion on the pogl-devel list, I'll be splitting out OpenGL::GLUT, OpenGL::Array, OpenGL::Matrix and OpenGL::RPN
23:03 Mithaldu chm: particularly due to perl being what it is, having high control and choice in matters of buffer handling is paramount
23:03 Mithaldu mainly due to the hard perl data | c data barrier
23:04 Mithaldu i had somewhat recently started an experiment based on sawyer's work to be able to write and read C buffers in perl with less cost than from simple XS calls just because of that
23:04 Mithaldu the resulting code is fairly mental
23:04 chm The perl interfaces I'll be targeting are ones using packed buffers a la SDL bitplanes, PDL arrays,...
23:05 Mithaldu pdl arrays are not useful if you're doing arbitrary perl accesses on the data in the meantime
23:05 Mithaldu thought experiment for you
23:06 Mithaldu rendering a simple 2d view, how many sprites can you render at 1280x800, moving based on rules implemented in perl
23:06 chm Since I'm working on improved type suppport for PDL::NG (Next Generation), the plan was to have PDL data seamlessly integrated with OpenGL::Modern buffers and all.
23:06 Mithaldu in my case i got stuck around 1000 sprites at 60 fps
23:07 chm Mithaldu: What are you using to render the sprites, instanced rendering calls?
23:07 Mithaldu this doesn't help if read-write on those buffers is still done via xs calls
23:07 Mithaldu sec, getting you the function
23:08 chm The idea was get the functions working, then add optimizations for performance.
23:08 Mithaldu chm: https://github.com/wchristian/Microidium/blob/master/lib/Microidium/SDLRole.pm#L657-L690
23:09 Mithaldu iirc the OpenGL::Array->new call takes the most time
23:09 chm Part of the tie-in with PDL::NG is the plan for JIT compilation and being able to push perl ops down to the C level.
23:09 Mithaldu and is necessitated because modifying a C buffer in perl is even slower
23:10 Mithaldu ok, the ::NG stuff is entirely beyond my understanding
23:10 chm Re OpenGL::Array, the idea would be to have an optimized set of PDL type, data, compute operation routines.
23:11 Mithaldu you are not grokking it
23:11 Mithaldu imagine an array with 1000 elements, containing 10 numbers each
23:12 Mithaldu it is faster to stuff that into an GL array each draw call than having it be a C buffer and doing 10000 read+write ops every frame
23:12 Mithaldu due to each read write operation, implemented as XS carrying a constant time cost of ~1µs
23:13 Mithaldu a specific PDL type may be useful for some use cases
23:13 Mithaldu but not for the one i described
23:14 chm Mithaldu: I'm sorry but I'm not up to speed with the modern OpenGL to understand where the problem is.
23:14 Mithaldu this isn't even opengl
23:14 Mithaldu it's perl and xs, plain and simple
23:15 chm Mithaldu: well any suggestions with performance issues and solutions are welcome.
23:15 chm Mithaldu: The intial focus was getting things to work first.
23:16 Mithaldu if you have 1000 elements, consisting of 10 values each; it's faster to have them be a perl array you dump into a C one in one operation; as compared to having it a C buffer you update with individual xs calls to read/write individual values
23:16 Mithaldu frankly
23:16 Mithaldu i don't understand which part of that is hard to understand
23:16 CandyAngel Mithaldu: Are you worried that performance optimisations might be blocked due to having to change the API?
23:16 Mithaldu 1 xs call = 1µs + <processing time of the actual code>
23:17 Mithaldu 1 xs call to dump 10000 perl numbers into a c buffer = 1µs + <dump time>
23:17 chm I don't understand what operations you're talking about here---the current every pointer is a T_PV implementation?
23:17 Mithaldu 20000 xs calls to read/write each value in a c buffer = 20ms + 20000 * <processing time>
23:18 chm That is definitely not the way things will be working.  It is a quick hack Max used to get running code fast.
23:18 Mithaldu my concern is the api itself
23:18 chm Just looking at the manual pack/unpack and direct use of perl arrays screams s-l-o-w!
23:18 Mithaldu as far as i can tell having the options for _c _s _p are needed for the end user
23:19 Mithaldu chm: right, but individual xs calls are even slower
23:19 Mithaldu this is an inescapable reality
23:19 chm Mithaldu: This discussion seems better to have with working code and timings.
23:20 Mithaldu i just told you the timings
23:20 chm Mithaldu: right now, things don't even work as well as the OpenGL _c, _s, and maybe even _p!
23:20 Mithaldu 1µs minimum cost per xs call
23:20 Mithaldu in addition to what you're actually doing
23:20 Mithaldu this cost is imposed by perl itself
23:21 Mithaldu there's only one way to shave a little of that off, getting a link
23:21 chm Mithaldu: Am familiar with interpreter overhead and XS overhead.
23:21 chm Mithaldu: Why are we optimizing something that doesn't even work without a lot of pack/unpack hacking?
23:23 chm If we're discussion legacy Perl OpenGL performance, I would rather see that the API and bindings in OpenGL::Moder work as good or better.
23:23 Mithaldu https://github.com/wchristian/ref-util/blob/distance/World.xs
23:23 Mithaldu this is the only way to speed them up
23:23 Mithaldu look
23:24 Mithaldu this is getting annoying because i'm trying to make a simple statement and it's getting ignored because you keep getting lost in questioning my premises
23:24 chm Mithaldu: I'm not questioning your premises, just not understanding them.
23:24 Mithaldu my statement is: due to inability to usefully predict optimization required by the end user, all the _* apis are worthwhile having around
23:25 chm Mithaldu: As I said before, the plan was to support all the existing capability.
23:25 Mithaldu you said above "as needed", which is different
23:26 Mithaldu all existing capability support is fine
23:26 chm Mithaldu: I'm not sure what the problem with the plan as stated.  I we/you need a _c or whatever explicit binding for performance then just add it.
23:27 chm I don't think we should implement anything for OpenGL::Modern if it is not needed.
23:27 chm The "not needed" stuff can always be used from the legacy OpenGL module.
23:27 Mithaldu my point is
23:28 Mithaldu you lack the knowledge to usefully assess what may be needed (as do i, for that matter), and i doubt there is anyone doing opengl in perl who has it
23:28 Mithaldu to my knowledge there are only two people who've actually delved into writing performant perl opengl
23:28 CandyAngel I'm not one (yet)
23:29 chm I'm not one as I'm just coming up to speed with the shader stuff.
23:29 Mithaldu and both the author of https://metacpan.org/release/Games-Construder and me have only begun to scratch the surface
23:30 Mithaldu (and i should note i am doing modern opengl, vertex, pixel, geometry shaders and all)
23:31 Mithaldu altho to be fair, i have not yet found a good use for _s apis
23:31 CandyAngel I'm totally tricking^Wrecruiting Mithaldu into WAID development at some point >.>
23:32 Mithaldu https://en.wikipedia.org/wiki/WAID ??? :D
23:32 CandyAngel Maybe one day!
23:32 chm Mithaldu: I like the idea of performance optimizations.  Right now, I don't have a complete OpenGL::Modern to even use.
23:32 CandyAngel Oh wait
23:32 CandyAngel It's actually a page :P
23:32 CandyAngel Maybe one day it will be disambiguation page then!
23:33 chm This discussion seems like premature optimization when the functionality isn't present.
23:33 Mithaldu CandyAngel: so what is it?
23:34 CandyAngel WAID is a game engine
23:34 Mithaldu chm: not an assessment i am happy with, but i am too exhausted
23:34 Mithaldu CandyAngel: definitely curious regarding that since it's also a thing that's scope of my project
23:35 chm Mithaldu: I'm a bit disappointed myself since I thought I would be able to get OpenGL::Modern working soon.
23:35 Mithaldu well that is orthogonal to this
23:35 CandyAngel Oh coolies
23:36 CandyAngel Can't promise it will be any good, it's name is "What Am I Doing" for a reason ^_^
23:36 chm With 476 problematic XS routines for the Core to fix and more than 1300 for ARB, EXT,... to fix, it is going to take much longer to finish than I thought.
23:36 chm Regarding non-XS approaches, that would be useful with the caveat of requiring a more modern version of perl5.
23:37 chm I don't know about perl6 implications.
23:37 Mithaldu fix?
23:37 Mithaldu perl6 is not something we should be thinking about given it's a completely different language
23:37 chm The current implementation for any argument with * in the declaration is T_PV.  See the pod in Helpers.pm from git pushed today.
23:37 Mithaldu CandyAngel: that's fine, i don't know what i'm doing engine-wise either
23:38 CandyAngel \o/
23:38 CandyAngel I'm not alone!
23:38 Mithaldu helpers does not mention T_PV in master branch
23:38 chm Mithaldu: The T_PV is in the typemap file which is why it is so messy to fix...
23:40 chm Mithaldu: It is problematic because it hides the information about types from the perl level.
23:40 Mithaldu that seems like something i am completely ignorant about
23:41 Mithaldu hm, this is annoying
23:41 Mithaldu glUniform2f $uniforms->{camera}, @{ $self->client_game_state->{camera}{pos} }{qw( x y )};
23:41 Mithaldu claims not enough arguments
23:42 chm See the discussion in the latest OpenGL-Modern in the pod of Helpers.pm.  https://github.com/devel-chm/OpenGL-Modern/blob/master/lib/OpenGL/Modern/Helpers.pm
23:43 chm Got to go...later o/
23:43 Mithaldu not awake enough to grok that at the moment
23:43 Mithaldu i'm just smashing ::Modern into my code to see how badly it breaks
23:43 Mithaldu and afraid because you're talking about removing things
23:44 CandyAngel Baibai chm
23:44 Mithaldu ciao o/
23:44 chm Mithaldu: Then make sure you perldoc Helpers.pm before you continue and you'll see what I mean.
23:44 chm o/
23:48 Mithaldu glCreateShader not available on this machine at lib/Microidium/SDLRole.pm line 878.
23:48 Mithaldu hm.
23:48 Mithaldu glCreateShaderObjectARB not available on this machine at lib/Microidium/SDLRole.pm line 878.
23:48 Mithaldu hm!
23:49 Mithaldu this is definitely wrong
23:49 chm Mithaldu: Make sure you've set up an OpenGL 3+ context
23:49 Mithaldu i think i'm using whatever SDL is giving me
23:52 Mithaldu ok, maybe i can smash that on top of that
23:57 Mithaldu of course not, shit

| Channels | #pogl index | Today | | Search | Google Search | Plain-Text | summary