比较提交

...
此合并请求有变更与目标分支冲突。
/com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs

1 次代码提交

作者 SHA1 备注 提交日期
Steven Borkman 934cdfb4 Bug fix for visualization memory leak 4 年前
共有 1 个文件被更改,包括 13 次插入4 次删除
  1. 17
      com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs

17
com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs


private GameObject segVisual = null;
private RawImage segImage = null;
private Texture2D m_CpuTexture = null;
/// <inheritdoc/>
protected override bool supportsVisualization => true;

m_TargetTextureOverride.Release();
m_TargetTextureOverride = null;
if (m_CpuTexture != null)
{
Object.Destroy(m_CpuTexture);
m_CpuTexture = null;
}
}
/// <inheritdoc/>

void VisualizeSegmentationTexture(NativeArray<Color32> data, RenderTexture texture)
{
var cpuTexture = new Texture2D(texture.width, texture.height, GraphicsFormat.R8G8B8A8_UNorm, TextureCreationFlags.None);
cpuTexture.LoadRawTextureData(data);
cpuTexture.Apply();
segImage.texture = cpuTexture;
if (m_CpuTexture == null)
m_CpuTexture = new Texture2D(texture.width, texture.height, GraphicsFormat.R8G8B8A8_UNorm, TextureCreationFlags.None);
m_CpuTexture.LoadRawTextureData(data);
m_CpuTexture.Apply();
segImage.texture = m_CpuTexture;
}
/// <inheritdoc/>

正在加载...
取消
保存