Skip to content

Commit

Permalink
AlembicPointsRenderer: fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
i-saint committed Apr 6, 2017
1 parent 6941806 commit 64fc862
Showing 1 changed file with 12 additions and 13 deletions.
Expand Up @@ -87,28 +87,27 @@ public void Flush()
int num_submeshes = System.Math.Min(m_mesh.subMeshCount, m_materials.Length);

bool supportsInstancing = SystemInfo.supportsInstancing;
if (!supportsInstancing && m_instancingMode != InstancingMode.NoInstancing)
{
Debug.LogWarning("AlembicPointsRenderer: Instancing is not supported on this system. fallback to InstancingMode.NoInstancing.");
m_instancingMode = InstancingMode.Instancing;
}

#if UNITY_5_5_OR_NEWER
int pidPointSize = Shader.PropertyToID("_PointSize");
int pidAlembicPoints = Shader.PropertyToID("_AlembicPoints");
int pidAlembicIDs = Shader.PropertyToID("_AlembicIDs");
#endif

if (!supportsInstancing && m_instancingMode != InstancingMode.NoInstancing)
{
Debug.LogWarning("AlembicPointsRenderer: Instancing is not supported on this system. fallback to InstancingMode.NoInstancing.");
m_instancingMode = InstancingMode.NoInstancing;
}

#if UNITY_5_6_OR_NEWER
if (supportsInstancing && m_instancingMode == InstancingMode.Procedural)
if (m_instancingMode == InstancingMode.Procedural && !SystemInfo.supportsComputeShaders)
{
if(!SystemInfo.supportsComputeShaders)
{
Debug.LogWarning("AlembicPointsRenderer: InstancingMode.Procedural is not supported on this system. fallback to InstancingMode.Instancing.");
m_instancingMode = InstancingMode.Instancing;
return;
}
Debug.LogWarning("AlembicPointsRenderer: InstancingMode.Procedural is not supported on this system. fallback to InstancingMode.Instancing.");
m_instancingMode = InstancingMode.Instancing;
}

if (supportsInstancing && m_instancingMode == InstancingMode.Procedural)
{
// Graphics.DrawMeshInstancedIndirect() route

// update argument buffer
Expand Down

0 comments on commit 64fc862

Please sign in to comment.