Skip to content

Single pass stereo support? #5

Description

@Wully616

I have modified PostProcessPass.RenderFinalPass to add in the FSR calls to the XR Module block

I'm getting an error with the compute shaders
Compute shader (RobustContrastAdaptiveSharpen): Property (_RCASInputTexture) at kernel index (0) has mismatching texture dimension (expected 2, got 5)

Compute shader (EdgeAdaptiveSpatialUpsampling): Property (_EASUInputTexture) at kernel index (0) has mismatching texture dimension (expected 2, got 5)

I suspect its due to using Single pass stereo, is there any way to add support for that?

#if ENABLE_VR && ENABLE_XR_MODULE
            if (cameraData.xr.enabled)
            {
                RenderTargetIdentifier cameraTarget = cameraTargetHandle.Identifier();
               
                //Blit(cmd, m_Source.Identifier(), BuiltinRenderTextureType.CurrentActive, material);
                bool isRenderToBackBufferTarget = cameraTarget == cameraData.xr.renderTarget && !cameraData.xr.renderTargetIsRenderTexture;
                // We y-flip if
                // 1) we are bliting from render texture to back buffer and
                // 2) renderTexture starts UV at top
                bool yflip = isRenderToBackBufferTarget && SystemInfo.graphicsUVStartsAtTop;

                Vector4 scaleBias = yflip ? new Vector4(1, -1, 0, 1) : new Vector4(1, 1, 0, 0);

                var xrTarget = new RenderTargetIdentifier(cameraTarget, 0, CubemapFace.Unknown, -1);

                var oldCameraTarget = xrTarget;
                var enableFSR = cameraData.enableFSR;
                if ( enableFSR )
                {
                    oldCameraTarget = xrTarget;
                    cmd.GetTemporaryRT(ShaderConstants._EASUInputTexture, GetCompatibleDescriptor());
                    xrTarget = ShaderConstants._EASUInputTexture;
                }

                cmd.SetRenderTarget(xrTarget, colorLoadAction, RenderBufferStoreAction.Store, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.DontCare);


                if ( !enableFSR )
                    cmd.SetViewport(cameraData.pixelRect);
                cmd.SetGlobalVector(ShaderPropertyId.scaleBias, scaleBias);
                cmd.DrawProcedural(Matrix4x4.identity, material, 0, MeshTopology.Quads, 4, 1, null);
                if ( enableFSR )
                    DoFSR(cmd, ref cameraData, oldCameraTarget);
            }
            else
#endif

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions