These are chat archives for bjz/gfx-rs

19th
Jun 2014
Chip Collier
@photex
Jun 19 2014 00:07
@kvark sure, but then how do we spit out an error from the glsl compiler when people are developing?
Dzmitry Malyshau
@kvark
Jun 19 2014 00:07
the error with GLSL comes up through Shader/Program Info Log
Chip Collier
@photex
Jun 19 2014 00:07
that isn't what I'm doing?
been a while since I grabbed it
Dzmitry Malyshau
@kvark
Jun 19 2014 00:08
I'm talking about glGetError usage, not the info log
Chip Collier
@photex
Jun 19 2014 00:08
gotcha, we don't have to use it :)
Dzmitry Malyshau
@kvark
Jun 19 2014 00:09
:shipit:
Chip Collier
@photex
Jun 19 2014 00:09
it honestly bothers me that glsl can't be pre-compiled to bytecode
Dzmitry Malyshau
@kvark
Jun 19 2014 00:09
@photex I recall seeing an extension for that... didn't happen to use it myself though
Chip Collier
@photex
Jun 19 2014 00:09
it's just crazy to expect applications to always work this way
I've seen validators too which will be useful
Dzmitry Malyshau
@kvark
Jun 19 2014 00:10
it depends on how faster the game is going to load with pre-compiled shaders. If the difference is low, then keeping it in text is a win
doesn't affect framerate, which is way more important
Chip Collier
@photex
Jun 19 2014 00:11
I guess I'm thinking more about the workflow issues, but that's something solvable with tools
should probably put together a shader toy for working on them
Dzmitry Malyshau
@kvark
Jun 19 2014 00:11
@photex what do you think about passing BufferHandle for the index buffer as a part of a slice instead of including it into the Mesh (see code above)?
Chip Collier
@photex
Jun 19 2014 00:14
So a mesh maps to a single vertex buffer?
and a slice is a subrange of that buffer that represents a specific submesh?
in the SubMesh struct: the slice can either be an index slice or a vertex slice
Dzmitry Malyshau
@kvark
Jun 19 2014 00:17
@photex visited ShaderToy, which crashed my firefox...
Chip Collier
@photex
Jun 19 2014 00:17
so in the case of an IndexSlice, that's just saying that the mesh component is indexed and provides a handle to the index buffer
otherwise you're drawing a range
do I understand it so far?
Dzmitry Malyshau
@kvark
Jun 19 2014 00:18
No, a Mesh is a collection of Attribute, each refers to its own BufferHandle (all can belong to a single buffer, as a case)
In both index/vertex slice we are drawing a range, but the former case is a range of indices, and the latter is a range of vertices.
@photex does that make a bit more sence?
Chip Collier
@photex
Jun 19 2014 00:20
yeah
I like it as part of the slice
conceptually it makes more sense to me there
at least for now! :)
Dzmitry Malyshau
@kvark
Jun 19 2014 00:22
@photex Awesome! now I'm concerned about where each of those things lives. Buffers are obviously managed by the platform thread, but Mesh manager is supposed to be on the render thread, right?
Chip Collier
@photex
Jun 19 2014 00:22
I would agree with that
Dzmitry Malyshau
@kvark
Jun 19 2014 00:23
I'm gonna take off for an hour. Thanks for help!
Chip Collier
@photex
Jun 19 2014 00:23
thank you for the great hacking!
Brendan Zabarauskas
@brendanzab
Jun 19 2014 00:44
<3 @kvark
Brendan Zabarauskas
@brendanzab
Jun 19 2014 01:48
@kvark Mesh on render thread probs
@kvark think of how it would be used - the mesh data would come in via the user's game thread right?
ie. via the render::Client
Dzmitry Malyshau
@kvark
Jun 19 2014 02:24
@bjz The interaction between game thread and render thread is beyond my scope at the moment, sorry, but I'll be happy to see any ideas from you about this protocol ;)
Brendan Zabarauskas
@brendanzab
Jun 19 2014 02:24
yeah sure thing
at last!
time to start porting bits to gfx-rs
Dzmitry Malyshau
@kvark
Jun 19 2014 03:44
o/ @Sleaker
Nick Minkler
@Sleaker
Jun 19 2014 03:44
hi!
Dzmitry Malyshau
@kvark
Jun 19 2014 03:45
do you see past messages on this channel?
Nick Minkler
@Sleaker
Jun 19 2014 03:45
yah
It loads in history when I scroll up
Brendan Zabarauskas
@brendanzab
Jun 19 2014 03:57
@Sleaker o/
@kvark yay triangle!
Dzmitry Malyshau
@kvark
Jun 19 2014 04:05
@bjz what does unimplemented! do? I'm getting "task '<unnamed>' failed at 'receiving on a closed channel'" when just trying out your example code
Brendan Zabarauskas
@brendanzab
Jun 19 2014 04:07
Which example is that?
Dzmitry Malyshau
@kvark
Jun 19 2014 04:08
@bjz ok, found the answer. The proc() needs to loop indefinitely for the channel to live
I'll fix the example (in lib.rs)
Brendan Zabarauskas
@brendanzab
Jun 19 2014 04:08
unimplemented!() just fails with an error
just a placeholder
Dzmitry Malyshau
@kvark
Jun 19 2014 04:09
@bjz thanks, I see
Brendan Zabarauskas
@brendanzab
Jun 19 2014 04:10
you can do .try_recv
also rx.iter() is useful
kvark @kvark wonders if Gitter could post any incoming commits here as messages...
Dzmitry Malyshau
@kvark
Jun 19 2014 04:12
@bjz Organization-wise, I got a simple Makefile here but I suppose you want to roll something standard (like rust-empty?), so I left my thing unsubmitted
@bjz I hope you can take care of it (I didn't happen to work with rust-empty)
Brendan Zabarauskas
@brendanzab
Jun 19 2014 04:13
yeah, I dunno why it doesn't do commit messages
Dzmitry Malyshau
@kvark
Jun 19 2014 04:13
@bjz that's certainly better than doing loop { xx.recv() ... }
Brendan Zabarauskas
@brendanzab
Jun 19 2014 04:14
the issue is that it blocks :(
it either blocks, or breaks on disconnect
I'm thinking we should probably start to go via PRs. I will too - just wanted to quickly get a skeleton for you guys.
Dzmitry Malyshau
@kvark
Jun 19 2014 04:15
how should I call Call/Cast/Reply items?
Brendan Zabarauskas
@brendanzab
Jun 19 2014 04:16
what's that?
ok, I don't know about call/cast - it's what erlang calls them.
Dzmitry Malyshau
@kvark
Jun 19 2014 04:16
@bjz agreed. I submitted this one since it's a very basic stuff that doesn't (supposedly) needs a review. Please correct me if I'm mistaken
Brendan Zabarauskas
@brendanzab
Jun 19 2014 04:17
no worries, I will look
Dzmitry Malyshau
@kvark
Jun 19 2014 04:18

what's that?

I'm going to populate Call, Cast and Reply enums. What should be the naming convention for its variants? E.g. should all calls start with Call... ?

Brendan Zabarauskas
@brendanzab
Jun 19 2014 04:18
yeah looks good :+1:
Ahhh!
hmm
lets try that for now
we can pick better names later
Dzmitry Malyshau
@kvark
Jun 19 2014 04:20
@bjz I recall some RFC about enum names being namespaces
that would be great...
Brendan Zabarauskas
@brendanzab
Jun 19 2014 04:20
yeah :(
enum mod
yeah I have to figure out how rust-empty works...
:P
Dzmitry Malyshau
@kvark
Jun 19 2014 04:23
that's it for me for today... glad I got the triangle, but porting it to gfx seems to be much more time consuming than I felt.
will come up with some nice PRs tomorrow night ;)
Brendan Zabarauskas
@brendanzab
Jun 19 2014 04:25
I will try to do some more of my platformy stuff
now
thanks for your awesomeness @kvark!
brendanzab @bjz has so much stuff to do
Dzmitry Malyshau
@kvark
Jun 19 2014 12:10
@bjz I'm thinking to implement GL device as a separate crate on path "src/devices/gl/", which is going to produce a crate lib called device for the gfx to link to. Now there is one question I have unresolved - about the interface between gfx and dev_*. Optimally, I'd like any device to implement some trait (Device trait seems unoccupied), but if this trait is a part of gfx, then any device would have to depend on gfx, and we'll get cross-dependency. I'm not sure if this is even supported by rust... An alternative is to have dev_common crate with this interface in (Device) that both dev_* and gfx will depend on.
Dzmitry Malyshau
@kvark
Jun 19 2014 12:49
another issue with common Device trait (the first one was the need to a separate common trait) is dependent types, such as BufferRaw, ShaderRaw, etc, which it has to return in the creation methods. Since Rust doesn't support them yet, it would have to be a big generic definition like that: trait Device<TB,TAB,TS,TSP,TF,TS,TT> or something along these lines, which looks pretty crappy... and considering the little benefit that we have from this trait, we may want to avoid it at all.
Dzmitry Malyshau
@kvark
Jun 19 2014 12:59
@bjz ok, sorry, screw that. No need to care about a common interface until we get more than a single device. At this time we have precisely 0. Question is solved/postponed.
Dzmitry Malyshau
@kvark
Jun 19 2014 13:43
@photex please see the comments to your data.rs gist
Dzmitry Malyshau
@kvark
Jun 19 2014 14:03
Created #1 with a milestone
Hope you don't mind ;)
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:09
@trevorah ohai! o/
Andy Trevorah
@trevorah
Jun 19 2014 15:10
hey!
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:10
@kvark awesome!
Dzmitry Malyshau
@kvark
Jun 19 2014 15:10
@bjz please add the GitHub hook. The automatic one seems to have failed, and I don't have permissions to do that...
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:10
hmm, so in the repo settings?
Andy Trevorah
@trevorah
Jun 19 2014 15:11
nope, the cog in the top right
but if you could go to https://github.com/bjz/gfx-rs/settings/hooks, I would love to know what you can see
it should show if the old hooks are there, and if they have failed or not
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:14
done!
@trevorah Is there a way to test it?
Dzmitry Malyshau
@kvark
Jun 19 2014 15:16
@trevorah Side note: it's weird that in REPO INFO tab on top-right there is no actual link to the repo...
Andy Trevorah
@trevorah
Jun 19 2014 15:16
only by creating activity on your github repo
@kvark yeah, that is kinda odd
Dzmitry Malyshau
@kvark
Jun 19 2014 15:19
I've updated #1 description. No activity is observed..
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:19
@trevorah seems a little weird to have such a massive bar with not much in there
@kvark I will try making an issue about something...
Dzmitry Malyshau
@kvark
Jun 19 2014 15:20
@bjz I looked at gitter room (the Gitter project itself) and the right massive bar shows ACTIVITY very nicely
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:21
ohhhh
nice
/me 's mind goes blank trying to think of an issue
o_o
brendanzab @bjz 's status failed
Dzmitry Malyshau
@kvark
Jun 19 2014 15:22
@bjz lol "implement abstract platform support" ? potentially with GLFW?
Andy Trevorah
@trevorah
Jun 19 2014 15:23
on github itself, does it mention gitter in the settings -> hook page?
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:25
@trevorah I just re-added git via the cog - it shows up now
\o/
Dzmitry Malyshau
@kvark
Jun 19 2014 15:26
yay! it's a win
Andy Trevorah
@trevorah
Jun 19 2014 15:27
:sparkles:
really weird how the first set failed
Dzmitry Malyshau
@kvark
Jun 19 2014 15:28
@trevorah thanks for your help!
Andy Trevorah
@trevorah
Jun 19 2014 15:28
@kvark no problem!
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:29
o_o
Andy Trevorah
@trevorah
Jun 19 2014 15:34
so far you guys have reported gitterHQ/gitter#289 and gitterHQ/gitter#290
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:35
weird
Andy Trevorah
@trevorah
Jun 19 2014 15:35
if you see anything else that seems weird, please let us know
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:35
hopefully we helped or something
Dzmitry Malyshau
@kvark
Jun 19 2014 15:35
@bjz I can see issues by @cmr here that belong to gl-rs. I think you should limit the scope of activity to gfx-rs
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:35
:P
@kvark yeah its annoying that it doesn't say which repo
Dzmitry Malyshau
@kvark
Jun 19 2014 15:36
@bjz When I try to add a Github hook, I'm asked to select repos. Did you just select all of them, or did you not have this window?
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:37
@kvark I selected the ones relevant
Andy Trevorah
@trevorah
Jun 19 2014 15:37
@bjz gitterHQ/gitter#215 for that one
Dzmitry Malyshau
@kvark
Jun 19 2014 15:38
@bjz ok so gl-rs is included intentionally. Makes sense, yeah
Brendan Zabarauskas
@brendanzab
Jun 19 2014 15:45
@trevorah cool - glad to know that is a known bug
@kvark gfx-rs/#2
Brendan Zabarauskas
@brendanzab
Jun 19 2014 17:05
@kvark check out #4 - might not be the best - but its a start
@Sleaker yoho!
Nick Minkler
@Sleaker
Jun 19 2014 17:19
what's up bjz?
Brendan Zabarauskas
@brendanzab
Jun 19 2014 17:23
just being friendly :)
Are you just curiously lurking?
:)
Nick Minkler
@Sleaker
Jun 19 2014 17:24
mostly yah
still reading through rust tutorials
Brendan Zabarauskas
@brendanzab
Jun 19 2014 17:24
ah cool
are you interested in 3d graphics stuff?
Nick Minkler
@Sleaker
Jun 19 2014 17:25
yah I've done stuff with unknownloner/lonelib
hmm gitter doesn't autolink other repos
previously helped with https://github.com/flow/Caustic
Brendan Zabarauskas
@brendanzab
Jun 19 2014 17:27
Awesome!
would be great to have your input on this
needs some proof reading in the last paragraph though

offtopic

woah! h1!
brendanzab @bjz forgot about markdown
Dzmitry Malyshau
@kvark
Jun 19 2014 17:36
@bjz ouch! I didn't give permission to publish that! it's a translation (apparently, not the best one) from my post on Habrahabr (in russian)... These days though I'd also include this list: https://gist.github.com/kvark/06c96ef8081e2239955b
@bjz sorry for not reviewing your PR, work happens... Will catch up shortly
Brendan Zabarauskas
@brendanzab
Jun 19 2014 18:02
Dzmitry Malyshau
@kvark
Jun 19 2014 18:03
@bjz errr I don't have a reddit account...
Nick Minkler
@Sleaker
Jun 19 2014 18:05
make one?
Dzmitry Malyshau
@kvark
Jun 19 2014 18:14
@Sleaker done! I wonder if I can get a "contributor" badge, since I'm there ;)
Brendan Zabarauskas
@brendanzab
Jun 19 2014 18:22
@kvark if you have contributed to the rust repo you can - ask bstrie on IRC
@kvark made some comments
Dzmitry Malyshau
@kvark
Jun 19 2014 18:26
@bjz still haven't fixed device.update(); // update platform :)
Brendan Zabarauskas
@brendanzab
Jun 19 2014 18:26
woops
Brendan Zabarauskas
@brendanzab
Jun 19 2014 18:33
@trevorah yo, gitter isn't notifying on replies to comments on outdated diffs: https://github.com/bjz/gfx-rs/pull/4#discussion_r13985186
or wait - that's not it
@trevorah it's not updating for comments on lines
Dzmitry Malyshau
@kvark
Jun 19 2014 18:41
@bjz I finished scanning through it, just waiting for your last comments
Brendan Zabarauskas
@brendanzab
Jun 19 2014 20:38
@kvark updated #4 again
Dzmitry Malyshau
@kvark
Jun 19 2014 21:05
@bjz does what I propose about naming make any sense?
Brendan Zabarauskas
@brendanzab
Jun 19 2014 21:05
semi
yeah, it's hard
I would like @photex to look at it
naming is always hard
kvark @kvark thinks: with the activity stream, full chat history, proper notifications, github-derived icons, ability to reference issues plus other markdown goodies, and finally clean interface - Gitter becomes really useful in comparison to IRC
Brendan Zabarauskas
@brendanzab
Jun 19 2014 22:13
yep
Dzmitry Malyshau
@kvark
Jun 19 2014 22:15
@bjz oh hey, I've almost forgot to ask one thing! What is a preferred method to collaborate on gfx for us: fork the project and make PRs from the forked branch, or just create the branches and make PRs from them (without forking)?
Brendan Zabarauskas
@brendanzab
Jun 19 2014 22:16
fork probably
Nick Minkler
@Sleaker
Jun 19 2014 22:16
branching and forking are pretty identical.
the only difference is where the code changes reside
Dzmitry Malyshau
@kvark
Jun 19 2014 22:16
@Sleaker except that forking does not pollute the main repo
Nick Minkler
@Sleaker
Jun 19 2014 22:16
neither does branching?
Brendan Zabarauskas
@brendanzab
Jun 19 2014 22:16
that's what I normally have people do on my other libs - get people to fork it
Nick Minkler
@Sleaker
Jun 19 2014 22:16
unless you don't like to have branches I guess
:D
Dzmitry Malyshau
@kvark
Jun 19 2014 22:17
@bjz that's the only way to collaborate when you don't give ppl the push access. But I do have it, so I'm wondering if I need to fork it at all or not...
Brendan Zabarauskas
@brendanzab
Jun 19 2014 22:17
@kvark but by being a collaborator it means you can merge things into the main repo if we have agreed on it
and stuff like updating to latest rustc often doesn't need the repo owner's permission to merge
Dzmitry Malyshau
@kvark
Jun 19 2014 22:18
@bjz yeah, but that's orthogonal since it applies to both fork-based PRs and native PRs
Brendan Zabarauskas
@brendanzab
Jun 19 2014 22:20
I would rather that collaborators use the fork method though, seeing as that is pretty much standard on github
I'm thinking I might remove the hooks to the other repos
it gets abit noisy
Dzmitry Malyshau
@kvark
Jun 19 2014 22:21
@bjz agreed. will fork then
kvark @kvark wonders if he can push changes from the fork into the origin directly, in case they are rust-updates and such