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 bee2e82 commit 6941806
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ public void Flush()
if(num_instances == 0) { return; }
int num_submeshes = System.Math.Min(m_mesh.subMeshCount, m_materials.Length);

#if UNITY_5_5_OR_NEWER
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");
Expand All @@ -96,6 +102,13 @@ public void Flush()
#if UNITY_5_6_OR_NEWER
if (supportsInstancing && m_instancingMode == InstancingMode.Procedural)
{
if(!SystemInfo.supportsComputeShaders)
{
Debug.LogWarning("AlembicPointsRenderer: InstancingMode.Procedural is not supported on this system. fallback to InstancingMode.Instancing.");
m_instancingMode = InstancingMode.Instancing;
return;
}

// Graphics.DrawMeshInstancedIndirect() route

// update argument buffer
Expand Down

0 comments on commit 6941806

Please sign in to comment.