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

Method SetResources

trinityal/dx12/Tr2StreamlineALDx12.cpp:796–831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

794}
795
796void Tr2DlssPlugin::SetResources( DlssUtils::DlssOptions options, DlssUtils::DlssResources resources, Tr2RenderContextAL& renderContext )
797{
798 auto inputResource = StreamlineUtils::GenerateTextureResource( resources.input );
799 auto outputResource = StreamlineUtils::GenerateTextureResource( resources.output );
800 auto depthResource = StreamlineUtils::GenerateTextureResource( resources.depth );
801 auto velocityResource = StreamlineUtils::GenerateTextureResource( resources.velocity );
802 auto exposureResource = StreamlineUtils::GenerateTextureResource( resources.exposure );
803 auto opaqueOnlyResource = StreamlineUtils::GenerateTextureResource( resources.opaqueOnly );
804
805 sl::Extent renderExtent = {};
806 renderExtent.height = options.renderHeight;
807 renderExtent.width = options.renderWidth;
808
809 sl::Extent displayExtent = {};
810 displayExtent.height = resources.output->GetHeight();
811 displayExtent.width = resources.output->GetWidth();
812
813 sl::Extent exposureExtent = {};
814 exposureExtent.height = 1;
815 exposureExtent.width = 1;
816
817 sl::ResourceTag opaqueColorInTag = sl::ResourceTag{ &opaqueOnlyResource, sl::kBufferTypeOpaqueColor, sl::ResourceLifecycle::eValidUntilPresent, &renderExtent };
818 sl::ResourceTag colorInTag = sl::ResourceTag{ &inputResource, sl::kBufferTypeScalingInputColor, sl::ResourceLifecycle::eValidUntilPresent, &renderExtent };
819 sl::ResourceTag colorOutTag = sl::ResourceTag{ &outputResource, sl::kBufferTypeScalingOutputColor, sl::ResourceLifecycle::eValidUntilPresent, &displayExtent };
820 sl::ResourceTag depthTag = sl::ResourceTag{ &depthResource, sl::kBufferTypeDepth, sl::ResourceLifecycle::eValidUntilPresent, &renderExtent };
821 sl::ResourceTag mvecTag = sl::ResourceTag{ &velocityResource, sl::kBufferTypeMotionVectors, sl::ResourceLifecycle::eValidUntilPresent, &renderExtent };
822 sl::ResourceTag exposureTag = sl::ResourceTag{ &exposureResource, sl::kBufferTypeExposure, sl::ResourceLifecycle::eValidUntilPresent, &exposureExtent };
823
824 sl::ResourceTag inputs[] = { colorInTag, opaqueColorInTag, colorOutTag, depthTag, mvecTag, exposureTag };
825
826 DECLARE_STATIC_SL_FUNC( slSetTag );
827 if( SL_FAILED( res, s_slSetTag( m_view, inputs, _countof( inputs ), StreamlineUtils::GetCommandBuffer( renderContext ) ) ) )
828 {
829 CCP_LOGERR( "DLSS Failed to tag resources (%d)", res );
830 }
831}
832
833void Tr2DlssPlugin::SetHudLessResource( Tr2TextureAL* hudless, Tr2RenderContextAL& renderContext )
834{

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