Closed guycook closed 8 years ago
@guycook Nice work!
I see the problem with the output format. There can be several solutions:
Renderer
generic over the output format. Is it supposed to be drawing to surfaces of different formats?Rgba8
and Srgba8
, which use different PSOs.output_format -> PSO
in either a typed form (AnyMap
? Haven't used it so I don't know), or raw form:pub fn draw<T: gfx::format::RenderFormat>(..., target: gfx::RenderTargetView<R, T>) {
use gfx::core::factory::Typed;
self.draw_raw(..., target.raw(), T::get_format());
}
fn draw_raw(..., target: gfx::RawRenderTargetView<R>, format: gfx::format::Format) {
// have a map of `Format -> PSO`, pick the PSO from there and draw
}
Ping @guycook Is this PR dead? gfx-0.10 is out
Not dead (in my mind), I just haven't really had the time to attack the problem above due to baby/uni/work etc. Sorry about that.
That said, probably there is no need for this now if gfx 0.10 is out - I would say that if gfx were > 1.0 it would make sense to support minor revisions but while it's 0.* may as well just track head. Depending on how different 0.9 and 0.10 is maybe this would be a better base to work from than the existing 0.8 code
@guycook no worries! You can't just jump right to 0.10 anyway. The difference between 0.9 and 0.10 is small, but you've still got to do the 0.8 to 0.9 step, so your PR needs to be completed in some way.
Closing in favor of #41
Fixes #37
This isn't quite ready to merge yet, I think it's ok except for one issue - draw isn't generic over the RenderTargetView format, i.e if in example/style.rs you try to init with an Srgb8 output format it won't build.
I'm not sure what the right approach is here, paging @kvark, @sectopod