@@ -600,12 +600,13 @@ namespace {
600600
601601 switch (upscaleMode) {
602602 case config::ScalingType::FSR:
603- case config::ScalingType::NIS: {
603+ case config::ScalingType::NIS:
604+ case config::ScalingType::CAS: {
604605 std::tie (inputWidth, inputHeight) = config::GetScaledDimensions (
605606 settingScaling, settingAnamophic, m_displayWidth, m_displayHeight, 2 );
606607 } break ;
607608
608- case config::ScalingType::CAS:
609+
609610 case config::ScalingType::None:
610611 break ;
611612
@@ -700,7 +701,10 @@ namespace {
700701 // Initialize the other resources.
701702
702703 m_upscaleMode = m_configManager->getEnumValue <config::ScalingType>(config::SettingScalingType);
703- if (m_upscaleMode == config::ScalingType::NIS || m_upscaleMode == config::ScalingType::FSR) {
704+ if (m_upscaleMode == config::ScalingType::NIS ||
705+ m_upscaleMode == config::ScalingType::FSR ||
706+ m_upscaleMode == config::ScalingType::CAS
707+ ) {
704708 m_settingScaling = m_configManager->peekValue (config::SettingScaling);
705709 m_settingAnamorphic = m_configManager->peekValue (config::SettingAnamorphic);
706710 }
@@ -717,7 +721,8 @@ namespace {
717721 break ;
718722
719723 case config::ScalingType::CAS:
720- m_upscaler = graphics::CreateCASSharpener (m_configManager, m_graphicsDevice);
724+ m_upscaler = graphics::CreateCASUpscaler (
725+ m_configManager, m_graphicsDevice, m_settingScaling, m_settingAnamorphic);
721726 break ;
722727
723728 case config::ScalingType::None:
@@ -731,7 +736,10 @@ namespace {
731736
732737 uint32_t renderWidth = m_displayWidth;
733738 uint32_t renderHeight = m_displayHeight;
734- if (m_upscaleMode == config::ScalingType::NIS || m_upscaleMode == config::ScalingType::FSR) {
739+ if (m_upscaleMode == config::ScalingType::NIS ||
740+ m_upscaleMode == config::ScalingType::FSR ||
741+ m_upscaleMode == config::ScalingType::CAS
742+ ) {
735743 std::tie (renderWidth, renderHeight) = config::GetScaledDimensions (
736744 m_settingScaling, m_settingAnamorphic, m_displayWidth, m_displayHeight, 2 );
737745
@@ -1068,7 +1076,10 @@ namespace {
10681076 if (useSwapchain && !isDepth) {
10691077 // Modify the swapchain to handle our processing chain (eg: change resolution and/or usage.
10701078
1071- if (m_upscaleMode == config::ScalingType::NIS || m_upscaleMode == config::ScalingType::FSR) {
1079+ if (m_upscaleMode == config::ScalingType::NIS ||
1080+ m_upscaleMode == config::ScalingType::FSR ||
1081+ m_upscaleMode == config::ScalingType::CAS
1082+ ) {
10721083 float horizontalScaleFactor;
10731084 float verticalScaleFactor;
10741085 std::tie (horizontalScaleFactor, verticalScaleFactor) =
@@ -2420,7 +2431,10 @@ namespace {
24202431 }
24212432
24222433 // Adjust mip map biasing.
2423- if ((m_upscaleMode == config::ScalingType::NIS || m_upscaleMode == config::ScalingType::FSR) &&
2434+ if ((m_upscaleMode == config::ScalingType::NIS ||
2435+ m_upscaleMode == config::ScalingType::FSR ||
2436+ m_upscaleMode == config::ScalingType::CAS
2437+ ) &&
24242438 m_configManager->hasChanged (config::SettingMipMapBias)) {
24252439 m_graphicsDevice->setMipMapBias (
24262440 m_configManager->getEnumValue <config::MipMapBias>(config::SettingMipMapBias),
@@ -2741,7 +2755,10 @@ namespace {
27412755 float verticalScaleFactor = 1 .f ;
27422756 uint32_t scaledOutputWidth = view.subImage .imageRect .extent .width ;
27432757 uint32_t scaledOutputHeight = view.subImage .imageRect .extent .height ;
2744- if (m_upscaleMode == config::ScalingType::NIS || m_upscaleMode == config::ScalingType::FSR) {
2758+ if (m_upscaleMode == config::ScalingType::NIS
2759+ || m_upscaleMode == config::ScalingType::FSR
2760+ || m_upscaleMode == config::ScalingType::CAS
2761+ ) {
27452762 std::tie (horizontalScaleFactor, verticalScaleFactor) =
27462763 config::GetScalingFactors (m_settingScaling, m_settingAnamorphic);
27472764
@@ -2779,7 +2796,9 @@ namespace {
27792796
27802797 // Patch the top-left corner offset.
27812798 if (m_upscaleMode == config::ScalingType::NIS ||
2782- m_upscaleMode == config::ScalingType::FSR) {
2799+ m_upscaleMode == config::ScalingType::FSR ||
2800+ m_upscaleMode == config::ScalingType::CAS
2801+ ) {
27832802 correctedProjectionViews[eye].subImage .imageRect .offset .x = (uint32_t )std::ceil (
27842803 correctedProjectionViews[eye].subImage .imageRect .offset .x * horizontalScaleFactor);
27852804 correctedProjectionViews[eye].subImage .imageRect .offset .y = (uint32_t )std::ceil (
0 commit comments