These are chat archives for bjz/gfx-rs

11th
Jul 2014
Marvin Löbel
@Kimundi
Jul 11 2014 01:13
Okay, after a frustrated failed attempt to hack together something locally, I've decided that I'd much rather have a Cargo.toml for gfx right now :P
Dzmitry Malyshau
@kvark
Jul 11 2014 03:03
r? #92
Corey Richardson
@cmr
Jul 11 2014 03:04
thanks
I couldn't get gfx-rs to build last night :( did'nt have time to get to it after trying to fix
we need a macro like rustc uses that we run per-crate
Dzmitry Malyshau
@kvark
Jul 11 2014 03:05
for the dependencies?
Corey Richardson
@cmr
Jul 11 2014 03:05
yes
instead of writing it out each time
Dzmitry Malyshau
@kvark
Jul 11 2014 03:05
ideally, yeah. We don't have that much of a tree to miss anything yet
Corey Richardson
@cmr
Jul 11 2014 03:06
right
Dzmitry Malyshau
@kvark
Jul 11 2014 03:07
Just a soft warning to everyone - I'm revamping the message passing between render and device. Async loading is getting there.
Corey Richardson
@cmr
Jul 11 2014 03:08
what is async loading, precisely?
Dzmitry Malyshau
@kvark
Jul 11 2014 03:09
user asks gfx to create something (a buffer, a program, etc), gets the handle instantly, even though the resource is not there. Once the resource is needed, Render makes sure it's loaded. Device is free to send replies at any point in any order.
Corey Richardson
@cmr
Jul 11 2014 03:10
And what is the benefit? Can we do multithreaded loading?
Dzmitry Malyshau
@kvark
Jul 11 2014 03:10
OpenGL can NOT
D3D though can spawn more loading threads at will
But the main thing - user is not blocked by resource loading
So on the initialization instead of waiting for each and every resource for each call, user will get back the control instantly, and resources are gonna be loaded in the background.
Corey Richardson
@cmr
Jul 11 2014 03:13
ok
Dzmitry Malyshau
@kvark
Jul 11 2014 03:13
by "initialization" I mean a loading stage of a hypothetical application based on gfx-rs. I hope we'll get there ;)
Corey Richardson
@cmr
Jul 11 2014 03:13
right :)
Dzmitry Malyshau
@kvark
Jul 11 2014 03:13
@cmr Does it make sense?
Corey Richardson
@cmr
Jul 11 2014 03:13
yes
Dzmitry Malyshau
@kvark
Jul 11 2014 03:13
cool :hamster:
it's not quite required now (from the user perspective), but since this deeply affects our architecture, I consider it important to get early
Brendan Zabarauskas
@brendanzab
Jul 11 2014 03:51
So it's kind of 'lazy' loading?
Corey Richardson
@cmr
Jul 11 2014 03:56
@bjz yeah
Marvin Löbel
@Kimundi
Jul 11 2014 12:03
Figures that trying to cargo-cult a Makefile doesn't work on first attempt :P
But now I'm clueless what I did wrong...
Ironically, building gfx as a dependency in a submodule worked on first try :P
Dzmitry Malyshau
@kvark
Jul 11 2014 13:57
@Kimundi lol, git submodules + make ftw
Marvin Löbel
@Kimundi
Jul 11 2014 14:09
@kvark: It still doesn't work :D
@kvark What I have so far successfully builds gfx as a submodule, but then my crate doesn't find the transitive dependencies like the gl crate
@kvark: If you have any idea how that might be fixed... Here's my makefile: https://gist.github.com/Kimundi/4f6529575ff5d7831bbd
(Shamelessly adapted from gfx's one)
Dzmitry Malyshau
@kvark
Jul 11 2014 14:14
@Kimundi how does your main.rs look like?
Also, please post the make output
Marvin Löbel
@Kimundi
Jul 11 2014 14:14
literally just a extern crate gfx; fn main() {}
This message was deleted
rustc -L lib -L deps/gfx-rs/lib --out-dir=lib -O src/main.rs
src/main.rs:1:1: 1:18 error: can't find crate for `gl` which `gfx` depends on
src/main.rs:1 extern crate gfx;
              ^~~~~~~~~~~~~~~~~
error: aborting due to previous error
Makefile:37: recipe for target 'lib/main' failed
make: *** [lib/main] Error 101
This message was deleted
Well, that paste didn't work :P
Dzmitry Malyshau
@kvark
Jul 11 2014 14:16
Try editing it
Marvin Löbel
@Kimundi
Jul 11 2014 14:18
rustc obviously doesn't get passed the -L lines for the sub-submodule libraries, but I'm not sure how to change that.
Dzmitry Malyshau
@kvark
Jul 11 2014 14:19
what do you have in deps/gfx-rs/lib?
Marvin Löbel
@Kimundi
Jul 11 2014 14:20
Whats there in a regular gfx build: libcomm.rlib, libdevice.rlib, libglfw_platform.rlib, librender.rlib
Dzmitry Malyshau
@kvark
Jul 11 2014 14:21
well it is certainly clear why it's unable to fine libgl-rs
since it's not in the -L paths
Marvin Löbel
@Kimundi
Jul 11 2014 14:22
yeah
Dzmitry Malyshau
@kvark
Jul 11 2014 14:23
Not sure what's the best practice to this... @bjz or @cmr should be able to answer
Marvin Löbel
@Kimundi
Jul 11 2014 14:25
I think I have to change the DEPS_LIB_DIRS = $(wildcard $(DEPS_DIR)/*/lib) line to something that recursively searches for lib directories?
Dzmitry Malyshau
@kvark
Jul 11 2014 14:25
that'd work, if you know how to do it. To get started though, you can hard-code these paths
Marvin Löbel
@Kimundi
Jul 11 2014 14:29
Yeah, no idea how to change that line sadly. Hardcoding I should manage, but part of my motivation for using a makefile was that I don't have to do that for everything. :(
Dzmitry Malyshau
@kvark
Jul 11 2014 14:30
but... you only need to do it once
Marvin Löbel
@Kimundi
Jul 11 2014 14:30
And change it each time if gfx changes stuff about its dependency structure, no?
Dzmitry Malyshau
@kvark
Jul 11 2014 14:34
@Kimundi that doesn't happen very often ;) I bet we are stuck with gl and glfw for a long while
Marvin Löbel
@Kimundi
Jul 11 2014 14:52
@kvark: Found a solution. It involves defining a recursive wildcard function of make
Dzmitry Malyshau
@kvark
Jul 11 2014 14:54
nice!
Brendan Zabarauskas
@brendanzab
Jul 11 2014 16:21
@kvark #93
Dzmitry Malyshau
@kvark
Jul 11 2014 17:05
travis doesn't have LD_LIBRARY_PATH set...
@bjz responded on #93
Dzmitry Malyshau
@kvark
Jul 11 2014 17:26
@bjz so will you fix the pub struct Version or that's the final?
Brendan Zabarauskas
@brendanzab
Jul 11 2014 17:26
I am fixing it :)
Dzmitry Malyshau
@kvark
Jul 11 2014 17:26
cool
no way - someone left this room yesterday?..
Brendan Zabarauskas
@brendanzab
Jul 11 2014 17:38
@kvark @Kimundi updated #93
Dzmitry Malyshau
@kvark
Jul 11 2014 18:02
@bjz :heart: thanks!
Brendan Zabarauskas
@brendanzab
Jul 11 2014 18:02
Awesome
I would like to start adding more docs to other stuff that you have done so that I can make sense of it - sorry
links to wikipedia articles and such
Dzmitry Malyshau
@kvark
Jul 11 2014 18:03
haha, my bad though
Brendan Zabarauskas
@brendanzab
Jul 11 2014 18:03
np
Marvin Löbel
@Kimundi
Jul 11 2014 18:03
Whoops, just noticed that my window creation fallback stuff in its current form prevents users to give additional hints like Resizable(true). Yay dogfooding!
Corey Richardson
@cmr
Jul 11 2014 18:03
I actually think that's the best way to do
it
Brendan Zabarauskas
@brendanzab
Jul 11 2014 18:03
@kvark but yeah, I definitely agree that where possible we should use types
Corey Richardson
@cmr
Jul 11 2014 18:04
Someone who isn't familiar with the code writes the docs -- the person who writes the code has too much assumptions
@bjz one of my annoyances is that there are a lot of type FooHandle = u32; instead of a newtype, is that what you are refering to?
Dzmitry Malyshau
@kvark
Jul 11 2014 18:07
@cmr that was meant to be temporary until we have a resource manager. Apparently, it's still not clear if/when we'll have it.
Corey Richardson
@cmr
Jul 11 2014 18:08
Ah
Marvin Löbel
@Kimundi
Jul 11 2014 18:08
I still find type weird in general - it does not provide additional type safety, and causes indirection while trying to make sense of the types involved.
That is not to say that I think the current use of them should be changed just because of that though :P
Dzmitry Malyshau
@kvark
Jul 11 2014 18:08
@Kimundi do you think we should avoid typedefs?
Corey Richardson
@cmr
Jul 11 2014 18:09
I certainly think that newtypes should be preferred for user-facing API
Marvin Löbel
@Kimundi
Jul 11 2014 18:09
@kvark As they are used they are better than bare uints. This is more a complain on the levle of Rust-the-language ;)
Kimundi @Kimundi keeps working on his agenda to remove type by merging it with use
Marvin Löbel
@Kimundi
Jul 11 2014 20:14
Is the triangles example meant to be as simple as possible?
Dzmitry Malyshau
@kvark
Jul 11 2014 20:53
@Kimundi I suppose, yeah, it's the simplest of all examples.
Marvin Löbel
@Kimundi
Jul 11 2014 21:02
@kvark: Okay
Marvin Löbel
@Kimundi
Jul 11 2014 21:28
@bjz: What happens if you try to create a glfw window under OS X without giving any ContextHints?
Brendan Zabarauskas
@brendanzab
Jul 11 2014 21:30
It'll give you a 2.1 context
Marvin Löbel
@Kimundi
Jul 11 2014 21:31
Hm okay
(Trying to make the context creation fallback hints a bit more versatile)
Brendan Zabarauskas
@brendanzab
Jul 11 2014 21:32
^_^
Marvin Löbel
@Kimundi
Jul 11 2014 21:50
@bjz: Does your machine have OpenGL 4.1 support (or 3.3)? What happens if gfx requests 3.2 core forward compatible, do you get exactly that, or something higher?
Corey Richardson
@cmr
Jul 11 2014 21:51
(I have both intel and nvidia proprietary drivers on my linux box, btw, and the nvidia one supports up to 4.4, if you need testing there)
Brendan Zabarauskas
@brendanzab
Jul 11 2014 21:51
@Kimundi for the triangle I get 4.1 it seems
Corey Richardson
@cmr
Jul 11 2014 21:52
Due to the "forward compatible" I think it is allowed to give you the highest it supports
Brendan Zabarauskas
@brendanzab
Jul 11 2014 21:52
ah
Corey Richardson
@cmr
Jul 11 2014 21:52
Marvin Löbel
@Kimundi
Jul 11 2014 21:58
@cmr: Hm, glfw recommends it on OSX, but according to that wiki it would do nothing anyway? @bjz: What happens if you remove the forward compatible hints?
Dzmitry Malyshau
@kvark
Jul 11 2014 22:51
@bjz I've just finished Knytt. That's a nice little game, but I don't quite see strong relation to the game that you want to make
1) there are no patterns to learn, there is an explicit pointer to follow
2) no procedural geometry