These are chat archives for bjz/gfx-rs

17th
Jul 2014
Dzmitry Malyshau
@kvark
Jul 17 2014 00:39
@bjz where did you get the GITTER pin for the README?
Brendan Zabarauskas
@brendanzab
Jul 17 2014 00:40
cog button in the top right -> share this room
Dzmitry Malyshau
@kvark
Jul 17 2014 00:44
@trevorah Is there a way to customize gitter chat icon?
@cmr rebased #109
Corey Richardson
@cmr
Jul 17 2014 00:51
@kvark merged!
Working on texture stuff now.
Dzmitry Malyshau
@kvark
Jul 17 2014 00:53
@cmr awesome, thanks!
Corey Richardson
@cmr
Jul 17 2014 01:04
I feel like it should be Backend instead of BackEnd...
it's usually one word I think, and Back End means something else in english ;)
Brendan Zabarauskas
@brendanzab
Jul 17 2014 01:20
hahaha
so true
we should call it GlButt
GlGluteusMaximus
there has got to be an emoji for that...
Dzmitry Malyshau
@kvark
Jul 17 2014 01:31
how dare you talk like that about mighty GL?!
the gods of graphics curse you!
Corey Richardson
@cmr
Jul 17 2014 01:38
@kvark different types for each dimension of texture, or a single one with Option for height/depth?
d3d uses different types, metal uses a single type.
and opengl is opengl
I lean toward different types, I don't like using the options to find out what a simple enum can tell you
Dzmitry Malyshau
@kvark
Jul 17 2014 01:41
@cmr that's a good question... GL doesn't distinct between texture types too hard, i.e. a Texture1D(w) is the same thing as Texture2D(w,1), etc
Corey Richardson
@cmr
Jul 17 2014 01:42
the backend obviously doesn't care much, but for constructing the texture the types might be nice.
Dzmitry Malyshau
@kvark
Jul 17 2014 01:43
What I used to do is just keep the number of rows, columns, depth layers, and MSAA samples as uints, with 0 meaning no dimension. I realize this is not very rustic, and that corresponds to your variant with options.
However, one of the problems with distinct types is that how do you know when to stop? I mean, we have 1D, 2D, 2D arrays, 3D, cubes, all of the above with MSAA, and maybe some more
Corey Richardson
@cmr
Jul 17 2014 01:44
Yeah, there is a lot of combinations.
Dzmitry Malyshau
@kvark
Jul 17 2014 01:44
you'll need around 10 different types
I wonder how that would complicate the implementation...
how many types does Mantle have?
oops, Metal?
Corey Richardson
@cmr
Jul 17 2014 01:45
7
Dzmitry Malyshau
@kvark
Jul 17 2014 01:45
link?
1D, 1DArray, 2D, 2DArray, 2DMultisample, Cube, 3D
Dzmitry Malyshau
@kvark
Jul 17 2014 01:46
interesting
Corey Richardson
@cmr
Jul 17 2014 01:46
I imagine the restricted multisampling is due to mobile GPU restrictions.
There is also the question of how to expose immutable texture data, ARB_texture_view and ARB_texture_storage
Dzmitry Malyshau
@kvark
Jul 17 2014 01:48
GL also has Texture2DArrayMultisample and TextureBuffer
brendanzab @bjz 's eyes glaze over at these terms
Corey Richardson
@cmr
Jul 17 2014 01:50
Texturing is really awful
Dzmitry Malyshau
@kvark
Jul 17 2014 01:50
@bjz don't worry, I haven't been able to work with these extensions either yet. But I do see how they came from DX land though
Corey Richardson
@cmr
Jul 17 2014 01:51
There are a billion knobs to play with.
brendanzab @bjz resolves to have good documentation
Brendan Zabarauskas
@brendanzab
Jul 17 2014 01:51
but a nice api would be nice too
Corey Richardson
@cmr
Jul 17 2014 01:51
I am hoping we can come up with a simple model for textures.
But I am not sure that is possible!
opengl now has two ways of uploading texture data, and they can't be used with each other, and this is not at all reflected in the types
(for immutable and mutable texture storage, respectively)
(mutable being old, immutable being recent)
Dzmitry Malyshau
@kvark
Jul 17 2014 01:53
@cmr you mean glTexStorage*?
Corey Richardson
@cmr
Jul 17 2014 01:53
and glTexImage*, yes.
Dzmitry Malyshau
@kvark
Jul 17 2014 01:55
Can a macro (like deriving) add fields to a struct?
Corey Richardson
@cmr
Jul 17 2014 01:55
yes.
it can modify the item in any way it likes.
Dzmitry Malyshau
@kvark
Jul 17 2014 01:55
is there a way to make them inaccessible by the user?
Corey Richardson
@cmr
Jul 17 2014 01:56
you can name them something like "!foo", which you can do with libsyntax, but can never type as a valid identifier.
Dzmitry Malyshau
@kvark
Jul 17 2014 01:57
whoa, interesting
I need more info and examples on how to write those syntax extensions on the structs... (to implement shader parameters prototype N3)
Corey Richardson
@cmr
Jul 17 2014 01:58
I can make an example later.
I am out of gfx-rs time for today though :(
Dzmitry Malyshau
@kvark
Jul 17 2014 01:58
but there should be existing examples (outside of Rust source), no?
Corey Richardson
@cmr
Jul 17 2014 01:59
I do not think there is any example of adding fields.
Dzmitry Malyshau
@kvark
Jul 17 2014 01:59
@cmr sorry that I have no definite answer on texture typing. We need to think/discuss it more.
I'll try to copy the source of deriving first, and see how it goes
it's just... navigating rust sources is painful without a good IDE
Corey Richardson
@cmr
Jul 17 2014 02:00
In short, modify the fields ... field of the StructDef, and you can create an Ident with syntax::parse::token::str_to_ident
You want to be an ItemModifier I think?
if you are just changing fields
Dzmitry Malyshau
@kvark
Jul 17 2014 02:01
I can not both create new items and modify existing ones?
(be an ItemDecorator and ItemModifier)
I wanted to add fields as well as an implementation for some trait
Corey Richardson
@cmr
Jul 17 2014 02:02
If you are an ItemDecorator you can modify the item you get and also create it.
... I think
Not sure :(
Dzmitry Malyshau
@kvark
Jul 17 2014 02:02
ok, will try
Corey Richardson
@cmr
Jul 17 2014 02:02
g2g, back later!
Dzmitry Malyshau
@kvark
Jul 17 2014 02:02
ty, see you
Dzmitry Malyshau
@kvark
Jul 17 2014 02:42

@bjz Do you know why Rust wants to see self namespace here:

unresolved import syntax::ast. Did you mean self::syntax

Dzmitry Malyshau
@kvark
Jul 17 2014 03:31
@Kimundi are you here?
Dzmitry Malyshau
@kvark
Jul 17 2014 03:44
@bjz since plugins require to be in dynamic libs, should we switch gfx-rs to be a dynamic lib, or have the plugin crate to be imported by the user separately?
Corey Richardson
@cmr
Jul 17 2014 04:42
@kvark the plugins should be in a separate crate.
Brendan Zabarauskas
@brendanzab
Jul 17 2014 05:21
@kvark did you import the crate into a submodule?
Marvin Löbel
@Kimundi
Jul 17 2014 08:47
@kvark: I'm here now
Andy Trevorah
@trevorah
Jul 17 2014 09:20
@kvark gitter chat icon?
Dzmitry Malyshau
@kvark
Jul 17 2014 11:42
@trevorah sorry, I mean the badger. Any way to customize it?
Andy Trevorah
@trevorah
Jul 17 2014 11:45
well, the image and the link are separate, so you could use something like this: https://badges.gitter.im/whatevertextyouwant.png
other than that, you would have to create your own image
Dzmitry Malyshau
@kvark
Jul 17 2014 11:46
@trevorah interesting, thanks!
@bjz @cmr do we have quasi-citation in macros? please tell me we do.... writing expressions in the ast is a pain
Dzmitry Malyshau
@kvark
Jul 17 2014 14:21
@bjz morning!
Brendan Zabarauskas
@brendanzab
Jul 17 2014 14:39
@kvark morning!
I am taking the train soon - but will be in the office later
@cmr heading to mountain view today!
Dzmitry Malyshau
@kvark
Jul 17 2014 14:53
@bjz exciting! meeting everyone before heading back home?
Brendan Zabarauskas
@brendanzab
Jul 17 2014 16:51
@kvark indeed!
Corey Richardson
@cmr
Jul 17 2014 17:06
@kvark we have quote_expr etc macros.
you can grep for it to find the others.
Dzmitry Malyshau
@kvark
Jul 17 2014 17:16
@cmr awesome, thanks!
@cmr hmmm I don't actually see any real usage of quote_expr
Corey Richardson
@cmr
Jul 17 2014 17:19
@kvark yeah, we can't use it in the compiler due to staging issues... in short, you can just say quote_expr!(some_function_call(1, 2, $foo)) and it will capture$foo from the environment. You also need an ExtCx in scope with the appropriate name... it's pretty bad. I think libregex uses it once? rust-phf and others might as well...
Dzmitry Malyshau
@kvark
Jul 17 2014 17:22
@cmr found it, thanks! btw, this is what I got so far
it can make constructing some ast nodes easier
Dzmitry Malyshau
@kvark
Jul 17 2014 17:31
@cmr I'm confused about TraitDef. It seems to be used to implement a trait for something, not to define the trait itself.
Dzmitry Malyshau
@kvark
Jul 17 2014 18:42
I'm wondering... we are relying on GH, Travis, Gitter, Waffle in the day-to-day work, yet they are free and have great support. At what point will we need to actually pay for them?..
Brendan Zabarauskas
@brendanzab
Jul 17 2014 18:46
github and travis are free for public OSS projects
I do pay for private repos on GH though
also Travis requires you to pay for private repos
you can also pay for better support for your OSS projects
not sure about Gitter
@trevorah might be able to give more info
I'm guessing they might use the same model
Dzmitry Malyshau
@kvark
Jul 17 2014 18:55
@bjz so unless we switch to closed projects, these services will remain free? I kinda feel like we are ripping them off...
Brendan Zabarauskas
@brendanzab
Jul 17 2014 18:56
yeah...
at least I am supporting github - I want these services to survive
Dzmitry Malyshau
@kvark
Jul 17 2014 18:59
As an idea, it would be nice to have a personal contribution pool, where you put money at will. Then, if you ever decide to use their payed services, the money of your pool would be used first.
Dzmitry Malyshau
@kvark
Jul 17 2014 23:54
What is a MethodDef::combine_substructure?