public override void uploadDrawCalls(IDeviceContext ic, Span <sDrawCall> drawCalls, iDepthValues depthValues, ref DrawMeshes meshes) { int count = drawCalls.Length; if (count > smallCount) { throw new ArgumentException("Too many draw calls for FewDrawCallsState class"); } var span = Unsafe.writeSpan <sDrawCallData>(ic.MapBuffer(constantBuffer, MapType.Write, MapFlags.Discard), count); try { produceDrawCalls(span, drawCalls, depthValues, ref meshes); } finally { ic.UnmapBuffer(constantBuffer, MapType.Write); } }
protected void produceDrawCalls(Span <sDrawCallData> result, Span <sDrawCall> drawCalls, iDepthValues depthValues, ref DrawMeshes meshes) { int count = drawCalls.Length; for (int i = 0; i < count; i++) { ref sDrawCall src = ref drawCalls[i]; ref sDrawCallData dest = ref result[i];
public override void uploadDrawCalls(IDeviceContext ic, Span <sDrawCall> drawCalls, iDepthValues depthValues, ref DrawMeshes meshes) { using (var mapped = drawCallsBuffer.map <sDrawCallData>(ic, drawCalls.Length)) produceDrawCalls(mapped.span, drawCalls, depthValues, ref meshes); }
public abstract void uploadDrawCalls(IDeviceContext ic, Span <sDrawCall> drawCalls, iDepthValues depthValues, ref DrawMeshes meshes);