This commit is contained in:
2025-11-13 17:40:28 +08:00
parent 962ab49609
commit 10156da245
5503 changed files with 805282 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
#if !PICO_OPENXR_SDK
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Unity.XR.PXR.SecureMR
{
[DisallowMultipleComponent]
[DefaultExecutionOrder(-99)]
public class PXR_SecureMRPipeline : MonoBehaviour
{
public PXR_SecureMRPipelineTensor[] tensors;
public PXR_SecureMROperator[] operators;
internal Pipeline pipeline;
public void Initialize(PXR_SecureMRProvider provider)
{
pipeline = provider.provider.CreatePipeline();
foreach (var tensor in tensors)
{
tensor.Initialize(this);
}
foreach (var secureMrOperator in operators)
{
secureMrOperator.InitializeOperator(this);
}
}
private void Start()
{
foreach (var secureMrOperator in operators)
{
secureMrOperator.InitializeParameters();
}
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d13f48655abb74d4abede3bb2115905b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,39 @@
#if !PICO_OPENXR_SDK
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Unity.XR.PXR.SecureMR
{
public class PXR_SecureMRPipelineExecute : MonoBehaviour
{
public PXR_SecureMRPipeline Pipeline;
public double periodInSeconds;
public PXR_SecureMRTensorMapping[] TensorMappings;
private double lastExecuted = 0.0;
public virtual void Execute()
{
var timeNow = Time.realtimeSinceStartupAsDouble;
if (timeNow < lastExecuted + periodInSeconds)
return;
if (TensorMappings !=null && TensorMappings.Length>0)
{
TensorMapping mappings = new TensorMapping();
foreach (var tensorPair in TensorMappings)
{
mappings.Set(tensorPair.localTensorReference.tensor,tensorPair.globalTensor.tensor);
}
Pipeline.pipeline.Execute(mappings);
}
else
{
Pipeline.pipeline.Execute();
}
lastExecuted = timeNow;
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 22202a0b7b3a22e42b35ffa268644a5d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,31 @@
#if !PICO_OPENXR_SDK
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Unity.XR.PXR.SecureMR
{
public class PXR_SecureMrPipelineExecuteAfter : PXR_SecureMRPipelineExecute
{
public PXR_SecureMRPipelineExecute afterPipeline;
public override void Execute()
{
if (TensorMappings != null && TensorMappings.Length > 0)
{
TensorMapping mappings = new TensorMapping();
foreach (var tensorPair in TensorMappings)
{
mappings.Set(tensorPair.localTensorReference.tensor, tensorPair.globalTensor.tensor);
}
Pipeline.pipeline.ExecuteAfter(afterPipeline.Pipeline.pipeline.pipelineHandle, mappings);
}
else
{
Pipeline.pipeline.ExecuteAfter(afterPipeline.Pipeline.pipeline.pipelineHandle);
}
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 400be15763095a94ca67d3f44402560a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,31 @@
#if !PICO_OPENXR_SDK
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Unity.XR.PXR.SecureMR
{
public class PXR_SecureMrPipelineExecuteConditional : PXR_SecureMRPipelineExecute
{
public PXR_SecureMRGlobalTensor globalTensor;
public override void Execute()
{
if (TensorMappings != null && TensorMappings.Length > 0)
{
TensorMapping mappings = new TensorMapping();
foreach (var tensorPair in TensorMappings)
{
mappings.Set(tensorPair.localTensorReference.tensor, tensorPair.globalTensor.tensor);
}
Pipeline.pipeline.ExecuteConditional(globalTensor.tensor.TensorHandle, mappings);
}
else
{
Pipeline.pipeline.ExecuteConditional(globalTensor.tensor.TensorHandle);
}
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bd11982a9f2d50142874c42ed9aace3d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,27 @@
#if !PICO_OPENXR_SDK
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Unity.XR.PXR.SecureMR
{
public class PXR_SecureMRPipelineRunner : MonoBehaviour
{
public PXR_SecureMRPipelineExecute[] runners;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
foreach (var exec in runners)
{
exec.Execute();
}
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c1ff61b0292c0af4eb8dff4148714fca
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: