Init
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d6ecac749eff4e4a8359a8f1b4b3cd6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRArithmeticComposeOperatorConfig : PXR_SecureMROperatorConfig
|
||||
{
|
||||
public string configText;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 068f21b303dd98e4686a7197f926f431
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRColorConvertOperatorConfig : PXR_SecureMROperatorConfig
|
||||
{
|
||||
public int covert;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a41812be983efc14d9783193107e1416
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRComparisonOperatorConfig : PXR_SecureMROperatorConfig
|
||||
{
|
||||
public SecureMRComparison comparison = SecureMRComparison.LargerThan;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e9b5734c8174814aaf835e120663b24
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Unity.XR.PXR.SecureMR;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRModelOperatorConfiguration : PXR_SecureMROperatorConfig
|
||||
{
|
||||
[Header("Model Settings")]
|
||||
[Tooltip("The ML model asset to use")]
|
||||
public TextAsset modelAsset;
|
||||
|
||||
[Tooltip("The type of model to use")]
|
||||
public SecureMRModelType modelType = SecureMRModelType.QnnContextBinary;
|
||||
|
||||
[Tooltip("Name of the model")]
|
||||
public string modelName;
|
||||
|
||||
[System.Serializable]
|
||||
public class ModelIOConfig
|
||||
{
|
||||
[Tooltip("Node name in the model")]
|
||||
public string nodeName;
|
||||
|
||||
[Tooltip("Operator IO name")]
|
||||
public string operatorIOName;
|
||||
|
||||
[Tooltip("Encoding type for the tensor")]
|
||||
public SecureMRModelEncoding encodingType = SecureMRModelEncoding.Float32;
|
||||
}
|
||||
|
||||
[Header("Input Configuration")]
|
||||
[Tooltip("Input tensor configurations")]
|
||||
public List<ModelIOConfig> inputs = new List<ModelIOConfig>();
|
||||
|
||||
[Header("Output Configuration")]
|
||||
[Tooltip("Output tensor configurations")]
|
||||
public List<ModelIOConfig> outputs = new List<ModelIOConfig>();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a ModelOperatorConfiguration from this ScriptableObject
|
||||
/// </summary>
|
||||
/// <returns>A ModelOperatorConfiguration instance ready to use with CreateOperator</returns>
|
||||
public ModelOperatorConfiguration CreateModelOperatorConfiguration()
|
||||
{
|
||||
if (modelAsset == null)
|
||||
{
|
||||
Debug.LogError("Model asset is not assigned in the configuration");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Create the base configuration
|
||||
ModelOperatorConfiguration modelConfig = new ModelOperatorConfiguration(
|
||||
modelAsset.bytes,
|
||||
modelType,
|
||||
string.IsNullOrEmpty(modelName) ? modelAsset.name : modelName
|
||||
);
|
||||
|
||||
// Add input mappings
|
||||
foreach (var input in inputs)
|
||||
{
|
||||
modelConfig.AddInputMapping(input.nodeName, input.operatorIOName, input.encodingType);
|
||||
}
|
||||
|
||||
// Add output mappings
|
||||
foreach (var output in outputs)
|
||||
{
|
||||
modelConfig.AddOutputMapping(output.nodeName, output.operatorIOName, output.encodingType);
|
||||
}
|
||||
|
||||
return modelConfig;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8865e5a9fec79410ba00023a3cb36899
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRNmsOperatorConfig : PXR_SecureMROperatorConfig
|
||||
{
|
||||
public float threshold;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ee3f97fd4a1701409723e715b04d79b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRNormalizeOperatorConfig : PXR_SecureMROperatorConfig
|
||||
{
|
||||
public SecureMRNormalizeType normalizeType = SecureMRNormalizeType.L1;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f6ca2f35ba1d7e41b852180d7519f04
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMROperand : MonoBehaviour
|
||||
{
|
||||
public string name;
|
||||
public PXR_SecureMRPipelineTensor tensor;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3138222ece47c3e45a679c32f02f2d7d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,248 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMROperator : MonoBehaviour
|
||||
{
|
||||
public SecureMROperatorType operatorType;
|
||||
|
||||
public PXR_SecureMROperatorConfig operatorConfig;
|
||||
|
||||
public PXR_SecureMROperand[] operands;
|
||||
|
||||
public PXR_SecureMRResult[] results;
|
||||
|
||||
internal Operator Operator;
|
||||
|
||||
public void InitializeOperator(PXR_SecureMRPipeline pipeline)
|
||||
{
|
||||
switch (operatorType)
|
||||
{
|
||||
case SecureMROperatorType.Unknown:
|
||||
break;
|
||||
case SecureMROperatorType.ArithmeticCompose:
|
||||
{
|
||||
if (operatorConfig != null && operatorConfig is PXR_SecureMRArithmeticComposeOperatorConfig opConfig)
|
||||
{
|
||||
ArithmeticComposeOperatorConfiguration arithmeticComposeOperatorConfig = new ArithmeticComposeOperatorConfiguration(opConfig.configText);
|
||||
Operator = pipeline.pipeline.CreateOperator<ArithmeticComposeOperator>(arithmeticComposeOperatorConfig);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.Nms:
|
||||
{
|
||||
if (operatorConfig != null && operatorConfig is PXR_SecureMRNmsOperatorConfig opConfig)
|
||||
{
|
||||
NmsOperatorConfiguration nmsOperatorConfig = new NmsOperatorConfiguration(opConfig.threshold);
|
||||
Operator = pipeline.pipeline.CreateOperator<NmsOperator>(nmsOperatorConfig);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.ElementwiseMin:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<ElementwiseMinOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.ElementwiseMax:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<ElementwiseMaxOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.ElementwiseMultiply:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<ElementwiseMultiplyOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.CustomizedCompare:
|
||||
{
|
||||
if (operatorConfig != null && operatorConfig is PXR_SecureMRComparisonOperatorConfig opConfig)
|
||||
{
|
||||
ComparisonOperatorConfiguration comparisonOperatorConfig = new ComparisonOperatorConfiguration(opConfig.comparison);
|
||||
Operator = pipeline.pipeline.CreateOperator<CustomizedCompareOperator>(comparisonOperatorConfig);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.ElementwiseOr:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<ElementwiseOrOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.ElementwiseAnd:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<ElementwiseAndOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.All:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<AllOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.Any:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<AnyOperator>();
|
||||
}
|
||||
break;
|
||||
|
||||
case SecureMROperatorType.SolvePnP:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<SolvePnPOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.GetAffine:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<GetAffineOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.ApplyAffine:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<ApplyAffineOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.ApplyAffinePoint:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<ApplyAffinePointOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.UvTo3DInCameraSpace:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<UvTo3DInCameraSpaceOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.Assignment:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<AssignmentOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.RunModelInference:
|
||||
{
|
||||
if (operatorConfig != null && operatorConfig is PXR_SecureMRModelOperatorConfiguration opConfig)
|
||||
{
|
||||
var modelOperatorConfiguration = opConfig.CreateModelOperatorConfiguration();
|
||||
Operator = pipeline.pipeline.CreateOperator<RunModelInferenceOperator>(modelOperatorConfiguration);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.Normalize:
|
||||
{
|
||||
if (operatorConfig != null && operatorConfig is PXR_SecureMRNormalizeOperatorConfig opConfig)
|
||||
{
|
||||
NormalizeOperatorConfiguration normalizeOperatorConfig = new NormalizeOperatorConfiguration(opConfig.normalizeType);
|
||||
Operator = pipeline.pipeline.CreateOperator<NormalizeOperator>(normalizeOperatorConfig);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.CameraSpaceToWorld:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<CameraSpaceToWorldOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.RectifiedVstAccess:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<RectifiedVstAccessOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.Argmax:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<ArgmaxOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.ConvertColor:
|
||||
{
|
||||
if (operatorConfig != null && operatorConfig is PXR_SecureMRColorConvertOperatorConfig opConfig)
|
||||
{
|
||||
ColorConvertOperatorConfiguration colorConvertOperatorConfig = new ColorConvertOperatorConfiguration(opConfig.covert);
|
||||
Operator = pipeline.pipeline.CreateOperator<ConvertColorOperator>(colorConvertOperatorConfig);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.SortVector:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<SortVectorOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.Inversion:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<InversionOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.GetTransformMatrix:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<GetTransformMatrixOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.SortMatrix:
|
||||
{
|
||||
if (operatorConfig != null && operatorConfig is PXR_SecureMRSortMatrixOperatorConfig opConfig)
|
||||
{
|
||||
SortMatrixOperatorConfiguration colorConvertOperatorConfig = new SortMatrixOperatorConfiguration(opConfig.sortType);
|
||||
Operator = pipeline.pipeline.CreateOperator<SortMatrixOperator>(colorConvertOperatorConfig);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.SwitchGltfRenderStatus:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<SwitchGltfRenderStatusOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.UpdateGltf:
|
||||
{
|
||||
if (operatorConfig != null && operatorConfig is PXR_SecureMRUpdateGltfOperatorConfig opConfig)
|
||||
{
|
||||
UpdateGltfOperatorConfiguration colorConvertOperatorConfig = new UpdateGltfOperatorConfiguration(opConfig.attribute);
|
||||
Operator = pipeline.pipeline.CreateOperator<UpdateGltfOperator>(colorConvertOperatorConfig);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.RenderText:
|
||||
{
|
||||
if (operatorConfig != null && operatorConfig is PXR_SecureMRRenderTextOperatorConfig opConfig)
|
||||
{
|
||||
RenderTextOperatorConfiguration colorConvertOperatorConfig = new RenderTextOperatorConfiguration(opConfig.typeface, opConfig.languageAndLocale, opConfig.width, opConfig.height);
|
||||
Operator = pipeline.pipeline.CreateOperator<UpdateGltfOperator>(colorConvertOperatorConfig);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.LoadTexture:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<LoadTextureOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.Svd:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<SvdOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.Norm:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<NormOperator>();
|
||||
}
|
||||
break;
|
||||
case SecureMROperatorType.SwapHwcChw:
|
||||
{
|
||||
Operator = pipeline.pipeline.CreateOperator<SwapHwcChwOperator>();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeParameters()
|
||||
{
|
||||
for (int i = 0; i < operands.Length; i++)
|
||||
{
|
||||
Operator.SetOperand(operands[i].name, operands[i].tensor.tensor);
|
||||
}
|
||||
|
||||
for (int i = 0; i < results.Length; i++)
|
||||
{
|
||||
Operator.SetResult(results[i].name, results[i].tensor.tensor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f2db4e7e685eab149a3d1a433ef45b3f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public abstract class PXR_SecureMROperatorConfig : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c94d34ae12959d743907b3922ff4283f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRRenderTextOperatorConfig : PXR_SecureMROperatorConfig
|
||||
{
|
||||
public SecureMRFontTypeface typeface = SecureMRFontTypeface.Default;
|
||||
public string languageAndLocale;
|
||||
public int width;
|
||||
public int height;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9811c138518011e40a025f9581943617
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRResult : MonoBehaviour
|
||||
{
|
||||
public string name;
|
||||
public PXR_SecureMRPipelineTensor tensor;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e0db5307210d97408562430bda7624c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRSortMatrixOperatorConfig : PXR_SecureMROperatorConfig
|
||||
{
|
||||
public SecureMRMatrixSortType sortType = SecureMRMatrixSortType.Column;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96f7b3902fd98364dbd8fb70b40a3fc6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRUpdateGltfOperatorConfig : PXR_SecureMROperatorConfig
|
||||
{
|
||||
public SecureMRGltfOperatorAttribute attribute = SecureMRGltfOperatorAttribute.Texture;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49077d8b5daa704459d6497d74f7fc7f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,35 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
[DefaultExecutionOrder(-100)]
|
||||
public class PXR_SecureMRProvider : MonoBehaviour
|
||||
{
|
||||
internal Provider provider;
|
||||
public int vstImageWidth = 1024;
|
||||
public int vstImageHeight = 1024;
|
||||
|
||||
public PXR_SecureMRGlobalTensor[] globalTensors;
|
||||
public PXR_SecureMRPipeline[] pipelines;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
provider = new Provider(vstImageWidth, vstImageHeight);
|
||||
|
||||
foreach (var globalTensor in globalTensors)
|
||||
{
|
||||
globalTensor.Initialize(this.provider);
|
||||
}
|
||||
|
||||
foreach (var pxrSecureMrPipeline in pipelines)
|
||||
{
|
||||
pxrSecureMrPipeline.Initialize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 620f232b10db8774db3670586443bfa7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66171051dd24bed429f837f46afa2078
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d13f48655abb74d4abede3bb2115905b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 22202a0b7b3a22e42b35ffa268644a5d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 400be15763095a94ca67d3f44402560a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd11982a9f2d50142874c42ed9aace3d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c1ff61b0292c0af4eb8dff4148714fca
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fbf915c13079ff64b98f96f935d4ac4b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e14dfe45f55a2c4ebfeaa996053da8a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRByteTensorData : PXR_SecureMRTensorData
|
||||
{
|
||||
public byte[] data;
|
||||
|
||||
public override byte[] ToByteArray()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b4efb5baf0eb4852ba302b21419172a2
|
||||
timeCreated: 1742250481
|
||||
@@ -0,0 +1,25 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRFileTensorData : PXR_SecureMRTensorData
|
||||
{
|
||||
public TextAsset fileAsset;
|
||||
|
||||
public override byte[] ToByteArray()
|
||||
{
|
||||
if (fileAsset != null)
|
||||
{
|
||||
return fileAsset.bytes;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57d3aabc698e3d14193ef3b3b3514a0d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRFloatTensorData : PXR_SecureMRTensorData
|
||||
{
|
||||
public float[] data;
|
||||
|
||||
public override float[] ToFloatArray()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 833a9c77186f6d44f910747e2046c202
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRIntTensorData : PXR_SecureMRTensorData
|
||||
{
|
||||
public int[] data;
|
||||
|
||||
public override int[] ToIntArray()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63fcdcd56ea9c1342879c35bcdcc5125
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public abstract class PXR_SecureMRTensorData : MonoBehaviour
|
||||
{
|
||||
public virtual byte[] ToByteArray()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual float[] ToFloatArray()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual int[] ToIntArray()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual ushort[] ToUShortArray()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44bf4283f84ec944499e0dab7994ddf9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,75 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.PXR.SecureMR;
|
||||
using UnityEngine;
|
||||
public class PXR_SecureMRTextureTensorData : PXR_SecureMRTensorData
|
||||
{
|
||||
//The texture that will be converted to color and float array
|
||||
//Note: you have to mark the texture as Read/Write in the Inspector
|
||||
[SerializeField]
|
||||
private Texture2D texture;
|
||||
|
||||
private Color32[] _colorData;
|
||||
private float[] _rgbaFloatData;
|
||||
private int[] _rgbaIntData;
|
||||
private byte[] _rgbaByteData;
|
||||
|
||||
public Texture2D Texture
|
||||
{
|
||||
get { return texture; }
|
||||
set
|
||||
{
|
||||
texture = value;
|
||||
UpdateArrayData();
|
||||
}
|
||||
}
|
||||
public override float[] ToFloatArray()
|
||||
{
|
||||
return _rgbaFloatData;
|
||||
}
|
||||
|
||||
public override byte[] ToByteArray()
|
||||
{
|
||||
return _rgbaByteData;
|
||||
}
|
||||
|
||||
public override int[] ToIntArray()
|
||||
{
|
||||
return _rgbaIntData;
|
||||
}
|
||||
|
||||
private void UpdateArrayData()
|
||||
{
|
||||
if (texture == null)
|
||||
{
|
||||
_colorData = null;
|
||||
_rgbaFloatData = null;
|
||||
_rgbaByteData = null;
|
||||
_rgbaIntData = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// Get raw color data from texture
|
||||
_colorData = texture.GetPixels32();
|
||||
_rgbaIntData = texture.GetPixelData<int>(0).ToArray();
|
||||
|
||||
// Convert to RGBA float array
|
||||
_rgbaFloatData = new float[_colorData.Length * 4];
|
||||
_rgbaByteData = new byte[_colorData.Length * 4];
|
||||
for (int i = 0; i < _colorData.Length; i++)
|
||||
{
|
||||
_rgbaFloatData[i * 4] = _colorData[i].r / 255f; // R
|
||||
_rgbaFloatData[i * 4 + 1] = _colorData[i].g / 255f; // G
|
||||
_rgbaFloatData[i * 4 + 2] = _colorData[i].b / 255f; // B
|
||||
_rgbaFloatData[i * 4 + 3] = _colorData[i].a / 255f; // A
|
||||
_rgbaByteData[i * 4] = _colorData[i].r; // R
|
||||
_rgbaByteData[i * 4 + 1] = _colorData[i].g; // G
|
||||
_rgbaByteData[i * 4 + 2] = _colorData[i].b; // B
|
||||
_rgbaByteData[i * 4 + 3] = _colorData[i].a; // A
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36f03292700cd294c9f91534a11624a8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRUShortTensorData : PXR_SecureMRTensorData
|
||||
{
|
||||
public ushort[] data;
|
||||
|
||||
public override ushort[] ToUShortArray()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a0d99d67fc7b4174854334e5094f0824
|
||||
timeCreated: 1742251258
|
||||
@@ -0,0 +1,130 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRGlobalTensor : PXR_SecureMRTensor
|
||||
{
|
||||
public PXR_SecureMRTensorData tensorData;
|
||||
|
||||
public void Initialize(Provider secureMrProvider)
|
||||
{
|
||||
if (metadata !=null && metadata is PXR_SecureMRGltfMetadata && tensorData != null && tensorData.ToByteArray() != null)
|
||||
{
|
||||
tensor = secureMrProvider.CreateTensor<Gltf>(tensorData.ToByteArray());
|
||||
}
|
||||
else if (metadata != null && metadata is PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
switch(tensorMetadata.usage)
|
||||
{
|
||||
case SecureMRTensorUsage.Matrix:
|
||||
CreateMatrixTensor(secureMrProvider, tensorMetadata);
|
||||
break;
|
||||
case SecureMRTensorUsage.Point:
|
||||
CreatePointTensor(secureMrProvider, tensorMetadata);
|
||||
break;
|
||||
case SecureMRTensorUsage.Color:
|
||||
CreateColorTensor(secureMrProvider, tensorMetadata);
|
||||
break;
|
||||
case SecureMRTensorUsage.TimeStamp:
|
||||
CreateTimestampTensor(secureMrProvider, tensorMetadata);
|
||||
break;
|
||||
case SecureMRTensorUsage.Slice:
|
||||
if(tensorMetadata.dataType == SecureMRTensorDataType.Int)
|
||||
{
|
||||
tensor = secureMrProvider.CreateTensor<int,Slice>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToIntArray());
|
||||
}
|
||||
break;
|
||||
case SecureMRTensorUsage.Scalar:
|
||||
CreateScalarTensor(secureMrProvider, tensorMetadata);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateScalarTensor(Provider secureMrProvider, PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
switch(tensorMetadata.dataType)
|
||||
{
|
||||
case SecureMRTensorDataType.Float:
|
||||
tensor = secureMrProvider.CreateTensor<float,Scalar>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToFloatArray());
|
||||
break;
|
||||
case SecureMRTensorDataType.Int:
|
||||
tensor = secureMrProvider.CreateTensor<int,Scalar>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToIntArray());
|
||||
break;
|
||||
case SecureMRTensorDataType.Short:
|
||||
case SecureMRTensorDataType.Ushort:
|
||||
tensor = secureMrProvider.CreateTensor<ushort,Scalar>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToUShortArray());
|
||||
break; case SecureMRTensorDataType.Byte:
|
||||
case SecureMRTensorDataType.Sbyte:
|
||||
tensor = secureMrProvider.CreateTensor<byte,Scalar>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToByteArray());
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateTimestampTensor(Provider secureMrProvider, PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
if(tensorMetadata.dataType == SecureMRTensorDataType.Int)
|
||||
{
|
||||
tensor = secureMrProvider.CreateTensor<int,TimeStamp>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToIntArray());
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateColorTensor(Provider secureMrProvider, PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
switch(tensorMetadata.dataType)
|
||||
{
|
||||
case SecureMRTensorDataType.Float:
|
||||
tensor = secureMrProvider.CreateTensor<float,Color>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToFloatArray());
|
||||
break;
|
||||
case SecureMRTensorDataType.Int:
|
||||
tensor = secureMrProvider.CreateTensor<int,Color>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToIntArray());
|
||||
break;
|
||||
case SecureMRTensorDataType.Short:
|
||||
case SecureMRTensorDataType.Ushort:
|
||||
tensor = secureMrProvider.CreateTensor<ushort,Color>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToUShortArray());
|
||||
break;
|
||||
case SecureMRTensorDataType.Byte:
|
||||
tensor = secureMrProvider.CreateTensor<byte, Color>(tensorMetadata.channel,
|
||||
new TensorShape(tensorMetadata.shape), tensorData.ToByteArray());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void CreatePointTensor(Provider secureMrProvider, PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
if(tensorMetadata.dataType == SecureMRTensorDataType.Float)
|
||||
{
|
||||
tensor = secureMrProvider.CreateTensor<float,Point>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToFloatArray());
|
||||
}
|
||||
}
|
||||
|
||||
void CreateMatrixTensor(Provider secureMrProvider, PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
switch(tensorMetadata.dataType)
|
||||
{
|
||||
case SecureMRTensorDataType.Float:
|
||||
tensor = secureMrProvider.CreateTensor<float,Matrix>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToFloatArray());
|
||||
break;
|
||||
case SecureMRTensorDataType.Int:
|
||||
tensor = secureMrProvider.CreateTensor<int,Matrix>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToIntArray());
|
||||
break;
|
||||
case SecureMRTensorDataType.Short:
|
||||
case SecureMRTensorDataType.Ushort:
|
||||
tensor = secureMrProvider.CreateTensor<ushort,Matrix>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToUShortArray());
|
||||
break;
|
||||
case SecureMRTensorDataType.Byte:
|
||||
case SecureMRTensorDataType.Sbyte:
|
||||
tensor = secureMrProvider.CreateTensor<byte,Matrix>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape), tensorData.ToByteArray());
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83d6795c88ea2634c85e930b17943585
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRGltfMetadata : PXR_SecureMRMetadata
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8aa832d17484724ca18756039d17a17
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,49 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRLocalTensor : PXR_SecureMRPipelineTensor
|
||||
{
|
||||
public PXR_SecureMRTensorData tensorData;
|
||||
|
||||
protected override void Initialize(Pipeline smrPipeline)
|
||||
{
|
||||
base.Initialize(smrPipeline);
|
||||
|
||||
if (tensor == null || tensorData == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (metadata !=null && metadata is PXR_SecureMRGltfMetadata )
|
||||
{
|
||||
tensor.Reset(tensorData.ToByteArray());
|
||||
}
|
||||
else if (metadata != null && metadata is PXR_SecureMRTensorMetadata tensorMetadata )
|
||||
{
|
||||
switch(tensorMetadata.dataType)
|
||||
{
|
||||
case SecureMRTensorDataType.Float:
|
||||
tensor.Reset(tensorData.ToFloatArray());
|
||||
break;
|
||||
case SecureMRTensorDataType.Int:
|
||||
tensor.Reset(tensorData.ToIntArray());
|
||||
break;
|
||||
case SecureMRTensorDataType.Short:
|
||||
case SecureMRTensorDataType.Ushort:
|
||||
tensor.Reset(tensorData.ToUShortArray());
|
||||
break;
|
||||
case SecureMRTensorDataType.Byte:
|
||||
case SecureMRTensorDataType.Sbyte:
|
||||
tensor.Reset(tensorData.ToByteArray());
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be24d60da1183fd488b2ac4f0a765421
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRLocalTensorReference : PXR_SecureMRPipelineTensor
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: faaee5e41e3799a409b5d25cfcf0e682
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public abstract class PXR_SecureMRMetadata : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91707c9ca62e23c4eb223a4cf55cd42c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,128 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using UnityEditor;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public abstract class PXR_SecureMRPipelineTensor : PXR_SecureMRTensor
|
||||
{
|
||||
public void Initialize(PXR_SecureMRPipeline pxrSecureMrPipeline)
|
||||
{
|
||||
Pipeline smrPipeline = pxrSecureMrPipeline.pipeline;
|
||||
Initialize(smrPipeline);
|
||||
|
||||
}
|
||||
|
||||
protected virtual void Initialize(Pipeline smrPipeline)
|
||||
{
|
||||
if (metadata !=null && metadata is PXR_SecureMRGltfMetadata)
|
||||
{
|
||||
tensor = smrPipeline.CreateTensor<Gltf>(null);
|
||||
}
|
||||
else if (metadata != null && metadata is PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
switch(tensorMetadata.usage)
|
||||
{
|
||||
case SecureMRTensorUsage.Matrix:
|
||||
CreateMatrixTensor(smrPipeline,tensorMetadata);
|
||||
break;
|
||||
case SecureMRTensorUsage.Point:
|
||||
CreatePointTensor(smrPipeline,tensorMetadata);
|
||||
break;
|
||||
case SecureMRTensorUsage.Color:
|
||||
CreateColorTensor(smrPipeline, tensorMetadata);
|
||||
break;
|
||||
case SecureMRTensorUsage.TimeStamp:
|
||||
CreateTimestampTensor(smrPipeline, tensorMetadata);
|
||||
break;
|
||||
case SecureMRTensorUsage.Slice:
|
||||
if(tensorMetadata.dataType == SecureMRTensorDataType.Int)
|
||||
{
|
||||
tensor = smrPipeline.CreateTensor<int,Slice>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape));
|
||||
}
|
||||
break;
|
||||
case SecureMRTensorUsage.Scalar:
|
||||
CreateScalarTensor(smrPipeline, tensorMetadata);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateScalarTensor(Pipeline smrPipeline, PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
switch(tensorMetadata.dataType)
|
||||
{
|
||||
case SecureMRTensorDataType.Float:
|
||||
tensor = smrPipeline.CreateTensor<float,Scalar>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape));
|
||||
break;
|
||||
case SecureMRTensorDataType.Int:
|
||||
case SecureMRTensorDataType.Short:
|
||||
case SecureMRTensorDataType.Ushort:
|
||||
tensor = smrPipeline.CreateTensor<int,Scalar>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape));
|
||||
break;
|
||||
case SecureMRTensorDataType.Byte:
|
||||
case SecureMRTensorDataType.Sbyte:
|
||||
tensor = smrPipeline.CreateTensor<byte,Scalar>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape));
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateTimestampTensor(Pipeline smrPipeline, PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
if(tensorMetadata.dataType == SecureMRTensorDataType.Int)
|
||||
{
|
||||
tensor = smrPipeline.CreateTensor<int,TimeStamp>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape));
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateColorTensor(Pipeline smrPipeline, PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
switch(tensorMetadata.dataType)
|
||||
{
|
||||
case SecureMRTensorDataType.Float:
|
||||
tensor = smrPipeline.CreateTensor<float,Color>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape));
|
||||
break;
|
||||
case SecureMRTensorDataType.Short:
|
||||
case SecureMRTensorDataType.Ushort:
|
||||
case SecureMRTensorDataType.Int:
|
||||
tensor = smrPipeline.CreateTensor<int,Color>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape));
|
||||
break;
|
||||
case SecureMRTensorDataType.Byte:
|
||||
tensor = smrPipeline.CreateTensor<byte, Color>(tensorMetadata.channel,
|
||||
new TensorShape(tensorMetadata.shape));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void CreatePointTensor(Pipeline smrPipeline, PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
if(tensorMetadata.dataType == SecureMRTensorDataType.Float)
|
||||
{
|
||||
tensor = smrPipeline.CreateTensor<float,Point>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape));
|
||||
}
|
||||
}
|
||||
|
||||
void CreateMatrixTensor(Pipeline smrPipeline, PXR_SecureMRTensorMetadata tensorMetadata)
|
||||
{
|
||||
switch(tensorMetadata.dataType)
|
||||
{
|
||||
case SecureMRTensorDataType.Float:
|
||||
tensor = smrPipeline.CreateTensor<float,Matrix>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape));
|
||||
break;
|
||||
case SecureMRTensorDataType.Int:
|
||||
case SecureMRTensorDataType.Short:
|
||||
case SecureMRTensorDataType.Ushort:
|
||||
tensor = smrPipeline.CreateTensor<int,Matrix>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape));
|
||||
break;
|
||||
case SecureMRTensorDataType.Byte:
|
||||
case SecureMRTensorDataType.Sbyte:
|
||||
tensor = smrPipeline.CreateTensor<byte,Matrix>(tensorMetadata.channel, new TensorShape(tensorMetadata.shape));
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f19678aa08d847ac924c1a54c75725e5
|
||||
timeCreated: 1741222282
|
||||
@@ -0,0 +1,14 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public abstract class PXR_SecureMRTensor : MonoBehaviour
|
||||
{
|
||||
internal Tensor tensor;
|
||||
public PXR_SecureMRMetadata metadata;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 72628110969172a4fbf8a56411d53dd0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRTensorMapping : MonoBehaviour
|
||||
{
|
||||
public PXR_SecureMRLocalTensorReference localTensorReference;
|
||||
public PXR_SecureMRGlobalTensor globalTensor;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 960aef176675a2b4ea75b571a5bd5071
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
#if !PICO_OPENXR_SDK
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PXR.SecureMR
|
||||
{
|
||||
public class PXR_SecureMRTensorMetadata : PXR_SecureMRMetadata
|
||||
{
|
||||
public int[] shape;
|
||||
public int channel;
|
||||
public SecureMRTensorDataType dataType = SecureMRTensorDataType.Float;
|
||||
public SecureMRTensorUsage usage = SecureMRTensorUsage.Matrix;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 61736555113e6a2499f829bcf9fae1ff
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user