These are chat archives for bjz/gfx-rs

29th
Jun 2014
Brendan Zabarauskas
@brendanzab
Jun 29 2014 00:21 UTC
yayy, getting some key events in the triangle example
Dzmitry Malyshau
@kvark
Jun 29 2014 00:40 UTC
@bjz are you in the SFO first floor commons?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 01:31 UTC
I am now upstairs :)
Coraline Sherratt
@removed~csherratt
Jun 29 2014 01:36 UTC
haha, have fun bjz?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 01:37 UTC
yep!
trying to fix some unstableness in the gfx startup/shutdown
you?
thanks for showing your cat!
I miss mine :(
Coraline Sherratt
@removed~csherratt
Jun 29 2014 01:43 UTC
it was fun. I wasted most of the event attempting to get my box with an AMD gpu to work with linux, and had no luck in the end. It looked to be a pretty neat office.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 01:44 UTC
yeah it's nice
nicer upstairs
Coraline Sherratt
@removed~csherratt
Jun 29 2014 01:44 UTC
I'm use to gray drab office buildings.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 01:44 UTC
we have the seventh floor - amazing view of the bay
Coraline Sherratt
@removed~csherratt
Jun 29 2014 01:50 UTC
Do you like it over Aussieland?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 01:52 UTC
dunno if I'd want to live here - if mozilla asked, I would but yeah... dunno.
Portland/Melbourne are more my style
The SF office is super cool though with all the smart folks around - it's really awesome in that way
Coraline Sherratt
@removed~csherratt
Jun 29 2014 02:04 UTC
I have quite a bit of respect for Mozilla. They do more R&D then I have seen out of companies 10 times their size.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:06 UTC
@kvark doing some docs on your shader stuff
Dzmitry Malyshau
@kvark
Jun 29 2014 02:07 UTC
@bjz awesome, thanks man!
any luck with a hackaton?
kvark @kvark wonders if he actually saw @bjz on the camera...
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:07 UTC
I was at the back
on a couch
grey shirt, orange/brown pants
Dzmitry Malyshau
@kvark
Jun 29 2014 02:09 UTC
@bjz near @erickt?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:09 UTC
yup
Dzmitry Malyshau
@kvark
Jun 29 2014 02:09 UTC
ah, ok, that young guy :)
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:10 UTC
with a mac, facing the camera
hehe, yup
Dzmitry Malyshau
@kvark
Jun 29 2014 02:22 UTC
@bjz has anyone actually got the spinning triangle?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:22 UTC
yes! erickt and a few others did
Dzmitry Malyshau
@kvark
Jun 29 2014 02:22 UTC
did they use bare gl-rs? or hgl-rs?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:22 UTC
I was mainly just helping out with cgmath and stuff
hgl
Dzmitry Malyshau
@kvark
Jun 29 2014 02:23 UTC
was @cmr there too?
Coraline Sherratt
@removed~csherratt
Jun 29 2014 02:23 UTC
bjz, did you see common traps people were falling into?
Dzmitry Malyshau
@kvark
Jun 29 2014 02:26 UTC
@csherratt @bjz has anyone looked at #24 ?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:28 UTC
What about a lookup table?
Dzmitry Malyshau
@kvark
Jun 29 2014 02:29 UTC
@bjz lookup table of strings? will suffer from the same data cache miss
Coraline Sherratt
@removed~csherratt
Jun 29 2014 02:43 UTC
I was going to suggest std::str::MaybeOwned, but that is 32 bytes...
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:45 UTC
@kvark yeah :(
Coraline Sherratt
@removed~csherratt
Jun 29 2014 02:46 UTC
How often do we actually need the uniform name? Can we 'link' the pipeline and avoid the names all togather?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:47 UTC
@csherratt you mean build up a pipeline once, then reuse it?
@csherratt like Metal?
@kvark what does storage+2-gl::FLOAT_VEC2 do?
Dzmitry Malyshau
@kvark
Jun 29 2014 02:48 UTC
@csherratt sure, we can match the input-outputs and store just indices, but this caching spawns more questions than it solves
@bjz it's the number at the end of the definition: FLOAT_VEC? (2,3,4)
which is the number of components that we extract from it
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:49 UTC
why do you need the formula?
Dzmitry Malyshau
@kvark
Jun 29 2014 02:49 UTC
to do it in one case instead of 3
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:50 UTC
I think in this case it might be clearer to do multiple cases
Dzmitry Malyshau
@kvark
Jun 29 2014 02:50 UTC
gonna be bulky
ok, bbl
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:51 UTC
o/
Coraline Sherratt
@removed~csherratt
Jun 29 2014 03:01 UTC
bjz, I think your symbol table is actually a great idea.
If every string in the pipeline that is the same always points to the same memory address, we can avoid the cache miss in the case for a string compare. Pointer A == Pointer B, no point in comparing their content.
This is also 8 bytes, vs 24 that @kvark has proposed.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 03:06 UTC
these cached pipelines would be immutable?
like, once you commit to building them, you can't alter them?
Coraline Sherratt
@removed~csherratt
Jun 29 2014 03:08 UTC
I meant gfx-rs as a pipeline, not any one object in the pipeline.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 03:09 UTC
ah ok
Coraline Sherratt
@removed~csherratt
Jun 29 2014 03:11 UTC
I think this might be preemptive, but if we place everything behind a type that looks feels and acts like a String. We can play with optimizing it via inline strings like @kvark has proposed or some other mechanism.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 03:12 UTC
@csherratt what would be your transition plan in terms of moving snowmew to gfx-rs?
oh, btw - tried an oculus rift today - not with Rust, just the bundled demo.... <3 <3 awesome
Coraline Sherratt
@removed~csherratt
Jun 29 2014 03:16 UTC
Snowmew is broken up into half a dozen crates, the render sits in it's own crate. So I just need to add a new crate and write a render for gfx-rs separately of the old one.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 03:16 UTC
nice!
it was interesting watching people use cgmath today -_-
:P
Coraline Sherratt
@removed~csherratt
Jun 29 2014 03:17 UTC
I had plans on adding an OpenGL ES render at some point, so I had the feeling I would needs some flexibility.
Good, bad, reactions?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 03:18 UTC
yeah that would be cool
Coraline Sherratt
@removed~csherratt
Jun 29 2014 03:19 UTC
I mean, reactions to cgmath :P
Brendan Zabarauskas
@brendanzab
Jun 29 2014 03:20 UTC
ohh
yeah, just some confusion
traits and stuff
I think it might be better to re-export things at the top level
Coraline Sherratt
@removed~csherratt
Jun 29 2014 03:22 UTC
matrix::Matrix is a bit noisy, I can see that
Dzmitry Malyshau
@kvark
Jun 29 2014 04:08 UTC
@csherratt the experience itself that you may get through porting to gfx-rs is going to be extremely valuable for us
Dzmitry Malyshau
@kvark
Jun 29 2014 04:23 UTC

@csherratt sure, we can match the input-outputs and store just indices, but this caching spawns more questions than it solves

That's half-truth. In fact, we don't want (of course) to match these strings at runtime, even if the comparison cost is low, because we'd still need to walk those mesh attributes for each shader attribute. instead, we just need to have that target index baked in somewhere. Perhaps, a single HashMap<(ProgramHandle,MeshHandle), IndexSequence> will suffice.

Coraline Sherratt
@removed~csherratt
Jun 29 2014 04:23 UTC
@kvark for sure.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:25 UTC
@kvark fixed #25!
Dzmitry Malyshau
@kvark
Jun 29 2014 04:27 UTC
@bjz awesome! next one is the real issue - binding that at runtime
kvark @kvark is off for today
Dzmitry Malyshau
@kvark
Jun 29 2014 04:32 UTC
cheers!
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:32 UTC
o/
Coraline Sherratt
@removed~csherratt
Jun 29 2014 04:44 UTC
bjz, have you thought about what type of render you want to build?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:48 UTC
@csherratt we will mainly wanting to be doing procedural stuff
@csherratt ^
Coraline Sherratt
@removed~csherratt
Jun 29 2014 04:52 UTC
how did you make these bjz?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:52 UTC
the first two are in photoshop
the last one is a mockup over an old screenshot
like, this is all my little thing could do: http://38.media.tumblr.com/tumblr_lxm7q4mHQi1qgurm4o1_1280.png
Coraline Sherratt
@removed~csherratt
Jun 29 2014 04:54 UTC
So how photo realistic do you want?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:54 UTC
stuff like reflections and stars were added in later
Coraline Sherratt
@removed~csherratt
Jun 29 2014 04:54 UTC
or do you want a specific style
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:55 UTC
basically what you see in the first one, but I think I could push it further, and add more detail
I am heavily pushing 'ambiance' though, so it would be awesome if big mountains cast shadows that moved during the day
I mean, fields of grass waving around would be amazing
Coraline Sherratt
@removed~csherratt
Jun 29 2014 04:58 UTC
Part of the long term goals of snowmew is to build a None-photo realistic render. I have an artist friend who is pushing his dream of how he wants and some of it is a pretty difficult problem.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:59 UTC
a vast plain of long grass, shimmering in the breeze - cloud systems, with layers up into the stratosphere, little villages
this is not the quality of render I want, but it gives a rough idea of a village http://38.media.tumblr.com/tumblr_lvelb6mVgz1qgurm4o1_500.png
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:01 UTC
Have you played anything by "That game company" ?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:01 UTC
the demo of flower and the old flash version of flow
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:03 UTC
So like the grass in flower?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:04 UTC
simple-houses.png
not sure - I think I have seen similar in miyazaki films
I just want a beautiful place to explore, would be awesome in VR
to transform my art into generative systems that take on a life of their own
perhaps snowmew could be useful - I dunno
but definitely we would need to figure out a way to handle content generation - how top-down/bottom-up we wanted to be
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:08 UTC
I'm not sure procedural generation will work well with the architecture of snowmew
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:09 UTC
yeah, that is the issue
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:09 UTC
It can be done, but I think that requires more direct buffer accesses which are not really possible in a deeply pipelines architecture.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:10 UTC
we need something that will work well with procedural stuff - folks have the same trouble with unity
not sure if you have any ideas regarding that
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:16 UTC
I have not read to much up on it.
So what is needed for fast procedural generation?
I imagine it is trying to work just a few objects ahead of what is being drawn, but that is a wild guess.
yeah, I have yet to get my head around that
I was going to try for this first, but I don't know beyond that
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:23 UTC
How vertex buffers are handled is something I want to look at in snowmew, they are all static right now which is not great.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:25 UTC
I am thinking maybe we might have to just do a bottom up generation of the world, then fill in details lazily
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:26 UTC
hmm
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:26 UTC
it is tricky
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:26 UTC
I think the issue is making the world expand at the edges.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:26 UTC
yep
and exploding cache sizes
I don't want an infinite world
I definitely want something finite - I think the idea of an infinite world can overwhelm players a little
well 'infinite'
the scaling of things would be smaller than reality - distances between interesting things shorter
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:31 UTC
the tricky thing is doing stuff so that interest is maintained - possibly only a subset of all possible things could be found in each world - also thinking of ways for procedural rules to build on themselves so that new, unexpected things could be 'inferred'
I dunno - a bit of blabbering there. I would really like the crudest thing in the short term
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:33 UTC
Step one, make something you can walk around in
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:33 UTC
exactly
ok, I gotta head home
ty for seeing :cat2: again!
^_^
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:37 UTC
np
Coraline Sherratt
@removed~csherratt
Jun 29 2014 15:45 UTC
Yay it compiles. So many warnings :o
Dzmitry Malyshau
@kvark
Jun 29 2014 15:48 UTC
@csherratt what have you just done there exactly?..
Coraline Sherratt
@removed~csherratt
Jun 29 2014 15:56 UTC
nothing more then create dummy render and add gfx to snowmew's build.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 15:58 UTC
yeek - so much errors with the *const change
Dzmitry Malyshau
@kvark
Jun 29 2014 15:59 UTC
@csherratt Sorry for the amount of warnings. I'm mostly hacking it through, so cleaning them up is in my backlog...
Brendan Zabarauskas
@brendanzab
Jun 29 2014 15:59 UTC
@csherratt \o/
@kvark ack, gonna have to fix all my ffi libs
Dzmitry Malyshau
@kvark
Jun 29 2014 16:00 UTC
@bjz so all we need for #27 is 1) fix the get_*_iv, and 2) fix the *const usage. Then we can go through #28. Right?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 16:01 UTC
we could just merge #27, then I can fix get_*_iv later?
Dzmitry Malyshau
@kvark
Jun 29 2014 16:01 UTC
sure
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:02 UTC
@kvark understood.
Dzmitry Malyshau
@kvark
Jun 29 2014 16:03 UTC
A lot of these warnings are something that was intended short-term placeholders until we get the handle management...
Brendan Zabarauskas
@brendanzab
Jun 29 2014 16:04 UTC
ok, sax and glfw-rs are fixed
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:11 UTC
I'm always shocked how long bjz's parts are actually broken for. Andrey or someone always comes in within 12 hours of the nightly and fixes them.
Dzmitry Malyshau
@kvark
Jun 29 2014 16:11 UTC
who is Andrey?
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:12 UTC
https://github.com/ozkriff A russian gamedev
Dzmitry Malyshau
@kvark
Jun 29 2014 16:12 UTC
oh, this guy :)
@bjz I've got the merge changes ready locally for #28, but would want to combine it with possible rust-latest fixes. Perhaps, you could have a look at it while I'm waiting for my rust to compile?
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:16 UTC
if gfx-rs can't keep up with the main() what will happen? A queue that just gets deeper and deeper?
Dzmitry Malyshau
@kvark
Jun 29 2014 16:18 UTC
@csherratt I don't think that was thought-through. I'll create an issue for that
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:20 UTC
It might be enough just to send a frame-swaped ack
Brendan Zabarauskas
@brendanzab
Jun 29 2014 16:21 UTC
@csherratt reminds me of a slide in the metal presentation :P
they explained that pretty nicely
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:23 UTC
link?
Dzmitry Malyshau
@kvark
Jun 29 2014 16:30 UTC
#29, we'll need to add the link there too
Brendan Zabarauskas
@brendanzab
Jun 29 2014 16:30 UTC
https://developer.apple.com/videos/wwdc/2014/ "Working with Metal: Fundamentals" 18:45
a slightly different thing, but similar
ok, I gotta go
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:31 UTC
This might be a bad time to point this out, but the way glfw-rs does get_proc_address is not entierly correct. get_proc_address address is only valid for the the thread local opengl context, if you create multiple contexts there is a case where get_proc_address with the same arguments can return different results based on which context that thread is using. It has worked fine since gl-rs has been using global memory space, so almost by design you cant fix this problem without a redesign of more then one library.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 16:31 UTC
still yet to fix gl-rs
@csherratt yeah, we need a struct-based generator
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:32 UTC
I guess that is all in good time
Brendan Zabarauskas
@brendanzab
Jun 29 2014 16:33 UTC
it is important to note
and something to plan for
Coraline Sherratt
@removed~csherratt
Jun 29 2014 17:51 UTC
:/
How the command thread is broken up from render server is a bit awkward.
Dzmitry Malyshau
@kvark
Jun 29 2014 18:04 UTC
@csherratt please explain in a bit more words?
Coraline Sherratt
@removed~csherratt
Jun 29 2014 18:10 UTC
of course @kvark . The fact that the 'Device.update()' needs to be called from the main thread makes using it a bit awkward, since it is the main thread that I would assume is sending the rendering commands to begin with. You can't send the device to another thread either, since it does not support the Send trait.
The triangles demo has the game task live off of the main thread. Which inverts my tasks.
Is there any reason the Render task is designed to live on the main thread?
Dzmitry Malyshau
@kvark
Jun 29 2014 18:15 UTC
@csherratt not really, I believe it should be able to live wherever user wants. Do you know what prevents Render from being sendable?
Coraline Sherratt
@removed~csherratt
Jun 29 2014 18:15 UTC
error: cannot capture variable of type gfx::device::Server<snowmew::io::Window>, which does not fulfill Send, in a bounded closure
Ah there is a delibrate NoSend market added to it.
Dzmitry Malyshau
@kvark
Jun 29 2014 18:19 UTC
device server is a platform task (not the render task, if I understand the terminology correctly). It has to live on the main thread because that's where GL context is created. I assume that to be the reason.
Coraline Sherratt
@removed~csherratt
Jun 29 2014 18:20 UTC
hmm
Dzmitry Malyshau
@kvark
Jun 29 2014 18:20 UTC
@bjz may answer that better, he architected this mostly
Coraline Sherratt
@removed~csherratt
Jun 29 2014 18:20 UTC
can't we move the thread using make_context_current ?
ah ok
when he gets back.
Dzmitry Malyshau
@kvark
Jun 29 2014 18:38 UTC
@csherratt we might be able to do that, technically, it just needs to be implemented somehow.
Coraline Sherratt
@removed~csherratt
Jun 29 2014 18:40 UTC
Leave it up to the api user?
Dzmitry Malyshau
@kvark
Jun 29 2014 18:41 UTC
created #30 to address this
Dzmitry Malyshau
@kvark
Jun 29 2014 18:49 UTC
sorry, bbl
Dzmitry Malyshau
@kvark
Jun 29 2014 23:51 UTC
@csherratt I assume #31 and #32 are blocking you?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 23:52 UTC
back!
sorry, was out for the day