These are chat archives for bjz/gfx-rs

19th
Jul 2014
Dzmitry Malyshau
@kvark
Jul 19 2014 00:13
@bjz I'm getting build notifications from Travis on noise-rs every day. Pretty sure that's abnormal.
Corey Richardson
@cmr
Jul 19 2014 00:31
@kvark that happens if you fix the build and then do nothing else.
(ie, no other commits)
since it re-runs the same build every night
and travis thinks every build "fixes" it
Dzmitry Malyshau
@kvark
Jul 19 2014 00:55
@cmr well it broke after that
Corey Richardson
@cmr
Jul 19 2014 00:55
oh, heh
Dzmitry Malyshau
@kvark
Jul 19 2014 01:10
rust is like the time: you have to keep moving to stand still...
Dzmitry Malyshau
@kvark
Jul 19 2014 02:44
I think we need a blog. "gfx-rs.github.io". I don't like the reddit discoverability, yet we can post links to our posts there if we want
Corey Richardson
@cmr
Jul 19 2014 02:45
Sounds good.
Dzmitry Malyshau
@kvark
Jul 19 2014 03:19
Anyone knows how to assign a symbol for a lifetime of a local?
Corey Richardson
@cmr
Jul 19 2014 03:19
can't
Dzmitry Malyshau
@kvark
Jul 19 2014 03:19
technical limitation? I mean, the local has lifetime, it's just implicit. I want to access it explicitly.
Corey Richardson
@cmr
Jul 19 2014 03:20
yes, just isn't implemented at all.
Dzmitry Malyshau
@kvark
Jul 19 2014 03:20
dong....
well I got a problem, need some advice. There is a TraitDef<'a> that I'm constructing without specifying 'a. Rust thinks that a == static and refuses to accept any lifetime of a local thing.
Dzmitry Malyshau
@kvark
Jul 19 2014 03:37
better code: http://is.gd/7g8mkG
resolved now
Corey Richardson
@cmr
Jul 19 2014 03:39
how did you fix it?
I've been looking at it trying to figure out why and failing
Dzmitry Malyshau
@kvark
Jul 19 2014 03:40
LifetimeBounds::empty() was at fault. Not a bug, just obscure problem
thanks for help regardless!
empty() returns static lifetime, and I'm not sure if it could do better
Corey Richardson
@cmr
Jul 19 2014 03:40
ah
Dzmitry Malyshau
@kvark
Jul 19 2014 03:41
even though, I'd expect Rust to choose the narrowest lifetimes, so any static thing would not affect it
Corey Richardson
@cmr
Jul 19 2014 06:58
Ok, I think texturing is done
well, "done"
doesn't support multisampling or cube maps at all
Corey Richardson
@cmr
Jul 19 2014 07:08
bjz/gfx-rs#112
Dzmitry Malyshau
@kvark
Jul 19 2014 13:51
@cmr I've left tons of comments there. I like how pedantic and structural you are with the code ;)
Dzmitry Malyshau
@kvark
Jul 19 2014 16:40

Yay, shader link generation is kinda working (the structure definition, not the contents yet):

struct Params {
    b: gfx::BufferHandle,
    x: int,
    t: gfx::TextureHandle,
}
struct _ParamsLink {
    b: ::gfx::BlockVarId,
    x: ::gfx::UniformVarId,
    t: ::gfx::TextureVarId,
}
#[automatically_derived]
impl ::gfx::ShaderParam<_ParamsLink> for Params {
    fn create_link<S: ::gfx::ParameterSink>(__arg_0: &S) ->
     Result<_ParamsLink, ::gfx::ParameterLinkError> {
        ::std::result::Err(::gfx::ParameterLinkError)
    }
}

That's after 3 days of hacking... but the biggest part is still ahead

Dzmitry Malyshau
@kvark
Jul 19 2014 16:51
Also I figured we don't need an Uploader, instead the ShaderParam::upload method may accept closures:
fn upload(&self, link: &L,
    |BlockVarId, super::BufferHandle|,
    |UniformVarId, UniformValue|,
    |TextureVarId, super::TextureHandle|
);
Corey Richardson
@cmr
Jul 19 2014 18:33
@kvark I've updated bjz/gfx-rs#112, should be ready for next round of review
cmr @cmr closes 23 tabs open to metal, d3d11, and opengl references...
Coraline Sherratt
@removed~csherratt
Jul 19 2014 18:55
@cmr are you becoming a Raster Pipeline ninja?
Corey Richardson
@cmr
Jul 19 2014 18:55
@csherratt gradually
Coraline Sherratt
@removed~csherratt
Jul 19 2014 18:55
has anyone thought about adding Cargo support for gfx-rs yet?
removed~csherratt @csherratt is adding Cargo support to snowmew today
Corey Richardson
@cmr
Jul 19 2014 18:56
yes, it still needs some features in cargo before we can really make use of it, due to our use of #[cfg]
Coraline Sherratt
@removed~csherratt
Jul 19 2014 18:56
Ah
Cargo can call a build script, would that be useful?
Corey Richardson
@cmr
Jul 19 2014 18:57
Not particularly, because it still wants to build the rust crates manually.
in the short term we can just remove the cfgs
they aren't useful right now
Coraline Sherratt
@removed~csherratt
Jul 19 2014 18:58
mmk
Coraline Sherratt
@removed~csherratt
Jul 19 2014 19:42
hmm, cargo does not even work for gl-rs
Corey Richardson
@cmr
Jul 19 2014 19:43
It should, what is broken?
Coraline Sherratt
@removed~csherratt
Jul 19 2014 19:43
It does not fetch the submodule that contains gl.xml
Corey Richardson
@cmr
Jul 19 2014 19:44
Fail..
Coraline Sherratt
@removed~csherratt
Jul 19 2014 19:44
I have no idea how to add that support w/o a build script.
Corey Richardson
@cmr
Jul 19 2014 19:45
A "build" script that does git submodule {init,update} --recursive should work.
Should definitely open an issue though
Brendan Zabarauskas
@brendanzab
Jul 19 2014 20:10
hurro!
brendanzab @bjz has been silent for a while
Brendan Zabarauskas
@brendanzab
Jul 19 2014 20:10
sorry
Corey Richardson
@cmr
Jul 19 2014 20:14
@kvark last feedback needed on #112 is if texture target should be in the handle
Brendan Zabarauskas
@brendanzab
Jul 19 2014 20:31
@cmr no idea
sorry
Corey Richardson
@cmr
Jul 19 2014 20:50
I think we are going to end up with 2 GL backends.
One for what we have now, and another for really-really modern GL, 4+
With EXT_direct_state_access
Keeping having to add branches for these various opengl features isn't very nice
Coraline Sherratt
@removed~csherratt
Jul 19 2014 21:36
Probably want an OpenGL Es backend someday too
Dzmitry Malyshau
@kvark
Jul 19 2014 21:52
@csherratt #110 is about cargo
Brendan Zabarauskas
@brendanzab
Jul 19 2014 21:53
@cmr yep
Dzmitry Malyshau
@kvark
Jul 19 2014 21:56
bbl, please resolve the texture target in/out handle without me
Corey Richardson
@cmr
Jul 19 2014 21:58
I'm putting it in the handle.
Corey Richardson
@cmr
Jul 19 2014 22:22
@bjz do those docs look good?
Brendan Zabarauskas
@brendanzab
Jul 19 2014 22:38
@cmr looks great
can I merge it?
Corey Richardson
@cmr
Jul 19 2014 22:38
no
Brendan Zabarauskas
@brendanzab
Jul 19 2014 22:38
ok
wait for @kvark?
Corey Richardson
@cmr
Jul 19 2014 22:38
I still need to add support to render, and also an example.
Brendan Zabarauskas
@brendanzab
Jul 19 2014 22:38
ah good
Corey Richardson
@cmr
Jul 19 2014 22:38
I haven't tested it at all :P
:shipit:
Corey Richardson
@cmr
Jul 19 2014 23:16
I don't quite understand how envir etc work.
but, bbl.