MCPcopy Create free account
hub / github.com/carbonengine/trinity / SetResources

Method SetResources

trinityal/dx11/Tr2StreamlineALDx11.cpp:765–800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

763}
764
765void Tr2DlssPlugin::SetResources( DlssUtils::DlssOptions options, DlssUtils::DlssResources resources, Tr2RenderContextAL& renderContext )
766{
767 auto inputResource = StreamlineUtils::GenerateTextureResource( resources.input );
768 auto outputResource = StreamlineUtils::GenerateTextureResource( resources.output );
769 auto depthResource = StreamlineUtils::GenerateTextureResource( resources.depth );
770 auto velocityResource = StreamlineUtils::GenerateTextureResource( resources.velocity );
771 auto exposureResource = StreamlineUtils::GenerateTextureResource( resources.exposure );
772 auto opaqueOnlyResource = StreamlineUtils::GenerateTextureResource( resources.opaqueOnly );
773
774 sl::Extent renderExtent = {};
775 renderExtent.height = options.renderHeight;
776 renderExtent.width = options.renderWidth;
777
778 sl::Extent displayExtent = {};
779 displayExtent.height = resources.output->GetHeight();
780 displayExtent.width = resources.output->GetWidth();
781
782 sl::Extent exposureExtent = {};
783 exposureExtent.height = 1;
784 exposureExtent.width = 1;
785
786 sl::ResourceTag opaqueColorInTag = sl::ResourceTag{ &opaqueOnlyResource, sl::kBufferTypeOpaqueColor, sl::ResourceLifecycle::eValidUntilPresent, &renderExtent };
787 sl::ResourceTag colorInTag = sl::ResourceTag{ &inputResource, sl::kBufferTypeScalingInputColor, sl::ResourceLifecycle::eValidUntilPresent, &renderExtent };
788 sl::ResourceTag colorOutTag = sl::ResourceTag{ &outputResource, sl::kBufferTypeScalingOutputColor, sl::ResourceLifecycle::eValidUntilPresent, &displayExtent };
789 sl::ResourceTag depthTag = sl::ResourceTag{ &depthResource, sl::kBufferTypeDepth, sl::ResourceLifecycle::eValidUntilPresent, &renderExtent };
790 sl::ResourceTag mvecTag = sl::ResourceTag{ &velocityResource, sl::kBufferTypeMotionVectors, sl::ResourceLifecycle::eValidUntilPresent, &renderExtent };
791 sl::ResourceTag exposureTag = sl::ResourceTag{ &exposureResource, sl::kBufferTypeExposure, sl::ResourceLifecycle::eValidUntilPresent, &exposureExtent };
792
793 sl::ResourceTag inputs[] = { colorInTag, opaqueColorInTag, colorOutTag, depthTag, mvecTag, exposureTag };
794
795 DECLARE_STATIC_SL_FUNC( slSetTag );
796 if( SL_FAILED( res, s_slSetTag( m_view, inputs, _countof( inputs ), StreamlineUtils::GetCommandBuffer( renderContext ) ) ) )
797 {
798 CCP_LOGERR( "DLSS Failed to tag resources (%d)", res );
799 }
800}
801
802void Tr2DlssPlugin::SetHudLessResource( Tr2TextureAL* hudless, Tr2RenderContextAL& renderContext )
803{

Callers

nothing calls this directly

Calls 4

GenerateTextureResourceFunction · 0.70
GetCommandBufferFunction · 0.70
GetHeightMethod · 0.45
GetWidthMethod · 0.45

Tested by

no test coverage detected