These are chat archives for bjz/gfx-rs

29th
Jun 2014
Brendan Zabarauskas
@brendanzab
Jun 29 2014 00:21
yayy, getting some key events in the triangle example
Dzmitry Malyshau
@kvark
Jun 29 2014 00:40
@bjz are you in the SFO first floor commons?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 01:31
I am now upstairs :)
Coraline Sherratt
@removed~csherratt
Jun 29 2014 01:36
haha, have fun bjz?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 01:37
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
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
yeah it's nice
nicer upstairs
Coraline Sherratt
@removed~csherratt
Jun 29 2014 01:44
I'm use to gray drab office buildings.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 01:44
we have the seventh floor - amazing view of the bay
Coraline Sherratt
@removed~csherratt
Jun 29 2014 01:50
Do you like it over Aussieland?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 01:52
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
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
@kvark doing some docs on your shader stuff
Dzmitry Malyshau
@kvark
Jun 29 2014 02:07
@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
I was at the back
on a couch
grey shirt, orange/brown pants
Dzmitry Malyshau
@kvark
Jun 29 2014 02:09
@bjz near @erickt?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:09
yup
Dzmitry Malyshau
@kvark
Jun 29 2014 02:09
ah, ok, that young guy :)
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:10
with a mac, facing the camera
hehe, yup
Dzmitry Malyshau
@kvark
Jun 29 2014 02:22
@bjz has anyone actually got the spinning triangle?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:22
yes! erickt and a few others did
Dzmitry Malyshau
@kvark
Jun 29 2014 02:22
did they use bare gl-rs? or hgl-rs?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:22
I was mainly just helping out with cgmath and stuff
hgl
Dzmitry Malyshau
@kvark
Jun 29 2014 02:23
was @cmr there too?
Coraline Sherratt
@removed~csherratt
Jun 29 2014 02:23
bjz, did you see common traps people were falling into?
Dzmitry Malyshau
@kvark
Jun 29 2014 02:26
@csherratt @bjz has anyone looked at #24 ?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:28
What about a lookup table?
Dzmitry Malyshau
@kvark
Jun 29 2014 02:29
@bjz lookup table of strings? will suffer from the same data cache miss
Coraline Sherratt
@removed~csherratt
Jun 29 2014 02:43
I was going to suggest std::str::MaybeOwned, but that is 32 bytes...
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:45
@kvark yeah :(
Coraline Sherratt
@removed~csherratt
Jun 29 2014 02:46
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
@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
@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
why do you need the formula?
Dzmitry Malyshau
@kvark
Jun 29 2014 02:49
to do it in one case instead of 3
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:50
I think in this case it might be clearer to do multiple cases
Dzmitry Malyshau
@kvark
Jun 29 2014 02:50
gonna be bulky
ok, bbl
Brendan Zabarauskas
@brendanzab
Jun 29 2014 02:51
o/
Coraline Sherratt
@removed~csherratt
Jun 29 2014 03:01
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
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
I meant gfx-rs as a pipeline, not any one object in the pipeline.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 03:09
ah ok
Coraline Sherratt
@removed~csherratt
Jun 29 2014 03:11
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
@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
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
nice!
it was interesting watching people use cgmath today -_-
:P
Coraline Sherratt
@removed~csherratt
Jun 29 2014 03:17
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
yeah that would be cool
Coraline Sherratt
@removed~csherratt
Jun 29 2014 03:19
I mean, reactions to cgmath :P
Brendan Zabarauskas
@brendanzab
Jun 29 2014 03:20
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
matrix::Matrix is a bit noisy, I can see that
Dzmitry Malyshau
@kvark
Jun 29 2014 04:08
@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

@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
@kvark for sure.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:25
@kvark fixed #25!
Dzmitry Malyshau
@kvark
Jun 29 2014 04:27
@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
cheers!
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:32
o/
Coraline Sherratt
@removed~csherratt
Jun 29 2014 04:44
bjz, have you thought about what type of render you want to build?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:48
@csherratt we will mainly wanting to be doing procedural stuff
@csherratt ^
Coraline Sherratt
@removed~csherratt
Jun 29 2014 04:52
how did you make these bjz?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:52
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
So how photo realistic do you want?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:54
stuff like reflections and stars were added in later
Coraline Sherratt
@removed~csherratt
Jun 29 2014 04:54
or do you want a specific style
Brendan Zabarauskas
@brendanzab
Jun 29 2014 04:55
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
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
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
Have you played anything by "That game company" ?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:01
the demo of flower and the old flash version of flow
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:03
So like the grass in flower?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:04
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
I'm not sure procedural generation will work well with the architecture of snowmew
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:09
yeah, that is the issue
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:09
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
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
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.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:22
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
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
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
hmm
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:26
it is tricky
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:26
I think the issue is making the world expand at the edges.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:26
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
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
Step one, make something you can walk around in
Brendan Zabarauskas
@brendanzab
Jun 29 2014 05:33
exactly
ok, I gotta head home
ty for seeing :cat2: again!
^_^
Coraline Sherratt
@removed~csherratt
Jun 29 2014 05:37
np
Coraline Sherratt
@removed~csherratt
Jun 29 2014 15:45
Yay it compiles. So many warnings :o
Dzmitry Malyshau
@kvark
Jun 29 2014 15:48
@csherratt what have you just done there exactly?..
Coraline Sherratt
@removed~csherratt
Jun 29 2014 15:56
nothing more then create dummy render and add gfx to snowmew's build.
Brendan Zabarauskas
@brendanzab
Jun 29 2014 15:58
yeek - so much errors with the *const change
Dzmitry Malyshau
@kvark
Jun 29 2014 15:59
@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
@csherratt \o/
@kvark ack, gonna have to fix all my ffi libs
Dzmitry Malyshau
@kvark
Jun 29 2014 16:00
@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
we could just merge #27, then I can fix get_*_iv later?
Dzmitry Malyshau
@kvark
Jun 29 2014 16:01
sure
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:02
@kvark understood.
Dzmitry Malyshau
@kvark
Jun 29 2014 16:03
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
ok, sax and glfw-rs are fixed
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:11
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
who is Andrey?
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:12
https://github.com/ozkriff A russian gamedev
Dzmitry Malyshau
@kvark
Jun 29 2014 16:12
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
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
@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
It might be enough just to send a frame-swaped ack
Brendan Zabarauskas
@brendanzab
Jun 29 2014 16:21
@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
link?
Dzmitry Malyshau
@kvark
Jun 29 2014 16:30
#29, we'll need to add the link there too
Brendan Zabarauskas
@brendanzab
Jun 29 2014 16:30
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
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
still yet to fix gl-rs
@csherratt yeah, we need a struct-based generator
Coraline Sherratt
@removed~csherratt
Jun 29 2014 16:32
I guess that is all in good time
Brendan Zabarauskas
@brendanzab
Jun 29 2014 16:33
it is important to note
and something to plan for
Coraline Sherratt
@removed~csherratt
Jun 29 2014 17:51
:/
How the command thread is broken up from render server is a bit awkward.
Dzmitry Malyshau
@kvark
Jun 29 2014 18:04
@csherratt please explain in a bit more words?
Coraline Sherratt
@removed~csherratt
Jun 29 2014 18:10
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
@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
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
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
hmm
Dzmitry Malyshau
@kvark
Jun 29 2014 18:20
@bjz may answer that better, he architected this mostly
Coraline Sherratt
@removed~csherratt
Jun 29 2014 18:20
can't we move the thread using make_context_current ?
ah ok
when he gets back.
Dzmitry Malyshau
@kvark
Jun 29 2014 18:38
@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
Leave it up to the api user?
Dzmitry Malyshau
@kvark
Jun 29 2014 18:41
created #30 to address this
Dzmitry Malyshau
@kvark
Jun 29 2014 18:49
sorry, bbl
Dzmitry Malyshau
@kvark
Jun 29 2014 23:51
@csherratt I assume #31 and #32 are blocking you?
Brendan Zabarauskas
@brendanzab
Jun 29 2014 23:52
back!
sorry, was out for the day