本文整理汇总了C++中Pipeline::ApplyRenderTargets方法的典型用法代码示例。如果您正苦于以下问题:C++ Pipeline::ApplyRenderTargets方法的具体用法?C++ Pipeline::ApplyRenderTargets怎么用?C++ Pipeline::ApplyRenderTargets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pipeline
的用法示例。
在下文中一共展示了Pipeline::ApplyRenderTargets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: End
void Composite::End(Renderer *renderer) {
Pipeline *pipeline = renderer->immediate_pipeline();
// Unbind the input channels
for (InputEntry entry : inputs_) {
entry.second->Unbind(pipeline);
}
// Unbind the output channels
for (OutputEntry entry : outputs_) {
// We don't want to rebind an input_output since we've already done it in the input entry loop
if (entry.second->type() != OutputChannel::TYPE_INPUT_OUTPUT) {
entry.second->Unbind(pipeline);
}
}
// Apply this clear any output targets
pipeline->ApplyRenderTargets();
}
示例2: Begin
void Composite::Begin( Renderer *renderer ) {
Pipeline *pipeline = renderer->immediate_pipeline();
// TODO Need to look at this more carefully since we need to integrate deferred contexts. Will the deferred context remove all the binded stuff or will it not?
//std::cout << "Executing composite: " << *this << std::endl;
// For now, all composite are done on the immediate context.
// TODO Look into how this will work across different deferred context
// Grab inputs and bind them
for (InputEntry entry : inputs_) {
entry.second->Bind(pipeline);
}
// Are there any outputs?
if (outputs_.size()) {
// Grab output targets and bind them
for (OutputEntry entry : outputs_) {
// We don't want to rebind an input_output since we've already done it in the input entry loop
if (entry.second->type() != OutputChannel::TYPE_INPUT_OUTPUT) {
entry.second->Bind(pipeline);
}
}
} else {
// Set the default output targets
pipeline->output_merger_stage()->desired().set_render_target_view(0, renderer->render_target_view());
pipeline->output_merger_stage()->desired().set_depth_stencil_view(&renderer->depth_stencil_view());
}
// TODO figure out how to cleanly handle the render targets between composites!!
if (!pipeline->output_merger_stage()->desired().render_target_view(0)) {
pipeline->output_merger_stage()->desired().set_render_target_view(0, renderer->render_target_view());
}
// Apply the new pipeline states
pipeline->ApplyPipelineResources();
pipeline->ApplyRenderTargets();
}