Add BlendTargets to PSO#411
Conversation
|
Add blender targets to the |
|
|
||
| for blend in self.out_blends.iter() { | ||
| let mut meta_blend = <BlendTarget as DataLink<'d>>::new(); | ||
| for info in info.outputs.iter() { |
There was a problem hiding this comment.
Nit: no need for iter, use reference instead.
| if let Some(res) = meta_blend.link_output(info, blend) { | ||
| let d = res.map_err(|e| InitError::PixelExport(info.name.as_str(), Some(e)))?; | ||
| desc.color_targets[info.slot as usize] = Some(d); | ||
| break; |
There was a problem hiding this comment.
You could just use find instead of a for loop.
There was a problem hiding this comment.
This ends up being less efficient, as you then have to call link_output twice.
| meta.out_colors.push(meta_color); | ||
| } | ||
|
|
||
| for blend in self.out_blends.iter() { |
|
r? @omni-viral I added the blend targets to the effects and addressed @torkleyy 's nits. |
|
Is this still WIP? |
|
So, I have limited understanding of gfx so I'm not entirely certain if what I've provided is adequate to make passes with blending, but I think it is. The end goal of the PR is to make a UI pass possible. |
| .expect("Failed to update buffer (TODO: replace expect)"); | ||
| } | ||
| None => { | ||
| eprintln!("WARNING: Buffer update for effect failed! Buffer not found: {:?}", |
There was a problem hiding this comment.
two whitespaces ("failed! Buffer")?
| enc.update_constant_buffer::<T>(unsafe { mem::transmute(raw) }, &data) | ||
| } | ||
| None => { | ||
| eprintln!("WARNING: Buffer update for effect failed! Buffer not found: {:?}", |
|
Btw, the |
|
Hmm, seems something went wrong :( |
|
@torkleyy Sometimes I rebase onto the wrong thing and stuff looks funny. I think I fixed it now. |
| data.out_colors | ||
| .extend(self.out.color_bufs().iter().map(|cb| cb.as_output.clone())); | ||
| data.out_blends | ||
| .extend(self.out.color_bufs().iter().map(|cb| cb.as_output.clone())); |
|
bors r+ |
This PR has the intention of adding blending targets to the pipeline. While this is a good first step towards implementing transparency in our renderer more work is required. This PR is being opened early for initial feedback.