Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd BlendTargets to PSO #411
Conversation
Xaeroxe
added
project: rendering
status: working
type: feature
labels
Oct 13, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Add blender targets to the |
| @@ -79,6 +82,18 @@ impl<'d> PipelineInit for Init<'d> { | ||
| meta.out_colors.push(meta_color); | ||
| } | ||
| + for blend in self.out_blends.iter() { | ||
| + let mut meta_blend = <BlendTarget as DataLink<'d>>::new(); | ||
| + for info in info.outputs.iter() { |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| + 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; |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Oct 13, 2017
Member
This ends up being less efficient, as you then have to call link_output twice.
Xaeroxe
Oct 13, 2017
Member
This ends up being less efficient, as you then have to call link_output twice.
| @@ -96,6 +111,16 @@ impl<'d> PipelineInit for Init<'d> { | ||
| } | ||
| meta.out_colors.push(meta_color); | ||
| } | ||
| + | ||
| + for blend in self.out_blends.iter() { |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
requested a review
from
omni-viral
Oct 13, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Oct 13, 2017
Member
r? @omni-viral
I added the blend targets to the effects and addressed @torkleyy 's nits.
|
r? @omni-viral I added the blend targets to the effects and addressed @torkleyy 's nits. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Is this still WIP? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Oct 13, 2017
Member
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.
|
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. |
Xaeroxe
removed
the
status: working
label
Oct 13, 2017
Xaeroxe
changed the title from
[WIP] Add BlendTargets to PSO
to
Add BlendTargets to PSO
Oct 13, 2017
| + .expect("Failed to update buffer (TODO: replace expect)"); | ||
| + } | ||
| + None => { | ||
| + eprintln!("WARNING: Buffer update for effect failed! Buffer not found: {:?}", |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| + enc.update_constant_buffer::<T>(unsafe { mem::transmute(raw) }, &data) | ||
| + } | ||
| + None => { | ||
| + eprintln!("WARNING: Buffer update for effect failed! Buffer not found: {:?}", |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Oct 13, 2017
Member
Btw, the mut has already been removed by my PR, try rebasing onto develop.
|
Btw, the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Hmm, seems something went wrong :( |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Oct 13, 2017
Member
@torkleyy Sometimes I rebase onto the wrong thing and stuff looks funny. I think I fixed it now.
|
@torkleyy Sometimes I rebase onto the wrong thing and stuff looks funny. I think I fixed it now. |
Xaeroxe
added some commits
Oct 13, 2017
| @@ -275,6 +294,8 @@ impl<'a> EffectBuilder<'a> { | ||
| 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())); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
bors r+ |
Xaeroxe commentedOct 13, 2017
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.