Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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];
Exemple #3
0
 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);
 }
Exemple #4
0
 public abstract void uploadDrawCalls(IDeviceContext ic, Span <sDrawCall> drawCalls, iDepthValues depthValues, ref DrawMeshes meshes);