These are chat archives for bjz/gfx-rs

14th
Jul 2014
Brendan Zabarauskas
@brendanzab
Jul 14 2014 00:33
@cmr #98, #99
Corey Richardson
@cmr
Jul 14 2014 00:36
Hm I think I merged the wrong one.
Nope
Brendan Zabarauskas
@brendanzab
Jul 14 2014 00:37
Okiedokie, well now we have test targets it will make it harder for us to ignore writing them :D
a shame though that we can't really test the actual gl stuff
still, better than nothing
Corey Richardson
@cmr
Jul 14 2014 00:44
I'm testing using a headless X + software rasterizer now.
mesa's llvm pipe does gl 3.1 I believe
Corey Richardson
@cmr
Jul 14 2014 00:53
2.1, good enough.
travis has an older mesa
shame
Brendan Zabarauskas
@brendanzab
Jul 14 2014 01:05
ooh, nice @cmr!
I noticed the new branch :)
@cmr bjz/gfx-rs#100
The rustc --print-*-name flags are pretty nice :)
Brendan Zabarauskas
@brendanzab
Jul 14 2014 01:10
@cmr oh just a sec
found a typo
@cmr fixed! #100
Corey Richardson
@cmr
Jul 14 2014 01:29
@bjz bjz/gfx-rs#101
:D
You even deleted the branch for me :heartpulse:
Brendan Zabarauskas
@brendanzab
Jul 14 2014 02:02
:)
Corey Richardson
@cmr
Jul 14 2014 02:07
@kvark mind if I take #49?
Dzmitry Malyshau
@kvark
Jul 14 2014 02:49
How do I implement Send or make sure something has it?

I've got:

pub trait Blob: Send {
    fn get_address(&self) -> uint;
    fn get_size(&self) -> uint;
}

And then it's boxed as a part of Request:

CreateBuffer(Option<Box<Blob>>),

And Rust doesn't like it:

instantiating a type parameter with an incompatible type Request<T>, which does not fulfill Send

Corey Richardson
@cmr
Jul 14 2014 02:50
the only way right now is to have a function like fn assert_send<T: Send>() { } and then assert_send::<ThatType>()
Ah
Box<Blob>:Send
I think
or possible Box<Blob:Send>:Send
inherting from built-in traits is basically broken
Dzmitry Malyshau
@kvark
Jul 14 2014 02:50
I'd think that Box is always sendable... also my Blob requires Send, so I don't understand why rust complains
Corey Richardson
@cmr
Jul 14 2014 02:51
Box<T> is only Send if T is
Dzmitry Malyshau
@kvark
Jul 14 2014 02:51
@cmr sure feel free to take on #49. Thanks for the heads up :)
Corey Richardson
@cmr
Jul 14 2014 02:51
I'm working on a patch for rust that will tell you why something is not Send etc
should be done tomorrow
Dzmitry Malyshau
@kvark
Jul 14 2014 02:52

Box<T> is only Send if T is

But my Blob requires Send. It doesn't count?

Corey Richardson
@cmr
Jul 14 2014 02:52
No, trait inheritance + trait objects for that is broken :(
Dzmitry Malyshau
@kvark
Jul 14 2014 02:52
eh :(
@cmr hmm it doesn't like Send to be inserted anywhere within this line:
CreateBuffer(Option<Box<Blob:Send>>),
Corey Richardson
@cmr
Jul 14 2014 02:54
Oh
Blob+Send
or Box<Blob> + Send
or the combination
I forgot about the syntax changes
Dzmitry Malyshau
@kvark
Jul 14 2014 02:54
yeah, I recall it changed recently (to the better)
Ok this kinda works. Thanks @cmr!
Dzmitry Malyshau
@kvark
Jul 14 2014 03:07
r? #102
(yay, we crossed the 100 issue mark!)
Dzmitry Malyshau
@kvark
Jul 14 2014 03:13
ok, I'm off for tonight
Corey Richardson
@cmr
Jul 14 2014 03:14
Night!
Brendan Zabarauskas
@brendanzab
Jul 14 2014 06:42
@cmr #103
Corey Richardson
@cmr
Jul 14 2014 06:46
@bjz much nicer!
Dzmitry Malyshau
@kvark
Jul 14 2014 11:13
#102 is updated ({:#x} and removed : Send from the Blob declaration)
Dzmitry Malyshau
@kvark
Jul 14 2014 14:53
@bjz I'll only be able to fix the spaces tonight...
Brendan Zabarauskas
@brendanzab
Jul 14 2014 16:00
@kvark can I rename rast to pixel?
kvark @kvark is thinking
Dzmitry Malyshau
@kvark
Jul 14 2014 16:02
most of the states fall just fine under the pixel name, but Primitive does not... How does pixel::Primitive sound to you?
take the cull mode for example. It's not the "pixel" cull mode, it has nothing to do with pixels.
Dzmitry Malyshau
@kvark
Jul 14 2014 16:07
so, unless you want to move Primitive state outside completely, rast names it better. May I wonder why in particular you dislike the rast name?
Brendan Zabarauskas
@brendanzab
Jul 14 2014 18:36
rast sounds ugly as. like rasp.
Corey Richardson
@cmr
Jul 14 2014 19:01
raster?
Dzmitry Malyshau
@kvark
Jul 14 2014 19:02
that sounds better, I just didn't want to have any suffixes on modules. But hey, we got render anyway
Dzmitry Malyshau
@kvark
Jul 14 2014 22:12
@bjz Sorry, I don't know why rasp sounds ugly either... There is raspberry, right? I know, I know, it's the cultural difference. Please feel free to adopt the better naming (e.g. raster)
Brendan Zabarauskas
@brendanzab
Jul 14 2014 22:13
Screen Shot 2014-07-14 at 3.13.09 pm.png
:P
eh, it is a minor bikeshed though
cmr @cmr prefers raster
Corey Richardson
@cmr
Jul 14 2014 22:14
although tbh that makes less sense than rast
Brendan Zabarauskas
@brendanzab
Jul 14 2014 22:14
why?
Corey Richardson
@cmr
Jul 14 2014 22:14
rast at least isn't a word, but raster and rasterization are very separate concepts
One is a bitmapped pixel format thingy, the other is the process of creating the former :P
Brendan Zabarauskas
@brendanzab
Jul 14 2014 22:15
we could do pixel, then move Primitive into a different module

bikeshed!

Corey Richardson
@cmr
Jul 14 2014 22:18
heh
Dzmitry Malyshau
@kvark
Jul 14 2014 22:21
The problem with pixel is that it only implies pixel operations. Clearly, Primitive Assembly state does not belong to pixel ops. But that's not just it. Take Stencil state, for example. There is a notion of back-face and front-face mode, which are not pixel-space terms at all... In other words, I believe that PA state deserves to be where it is now, and the pixel term is a bit too narrow to cover the current rast.
Corey Richardson
@cmr
Jul 14 2014 22:22
d3d calls it the "output-merger" stage.
Dzmitry Malyshau
@kvark
Jul 14 2014 22:23
no
OM is just blending and pixel export
raster is much more than that
Corey Richardson
@cmr
Jul 14 2014 22:23
ah, that was the only part of rast I've reviewed