コード例 #1
0
 public SourceChannel(Component_RenderingPipeline.RenderSceneData.MeshDataRenderOperation sourceOper, VertexElementSemantic semantic, VertexElementType type)
     : this()
 {
     if (sourceOper.VertexStructure.GetElementBySemantic(semantic, out sourceElement) && sourceElement.Type == type)
     {
         sourceBuffer = sourceOper.VertexBuffers[sourceElement.Source];
         SourceData   = sourceBuffer.ExtractChannel <TBuffer>(sourceElement.Offset);
         Exists       = true;
     }
 }
コード例 #2
0
 public void SetInstanceDataBuffer(GpuVertexBuffer buffer, int startVertex /*= 0*/, int count /*= -1*/)
 {
     if (buffer.Flags.HasFlag(GpuBufferFlags.Dynamic) || buffer.Flags.HasFlag(GpuBufferFlags.ComputeWrite))
     {
         Bgfx.SetInstanceDataBuffer((DynamicVertexBuffer)buffer.GetNativeObject(), startVertex, count);
     }
     else
     {
         Bgfx.SetInstanceDataBuffer((VertexBuffer)buffer.GetNativeObject(), startVertex, count);
     }
 }
コード例 #3
0
 public void SetVertexBuffer(int stream, GpuVertexBuffer buffer, int startVertex = 0, int count = -1)
 {
     if (buffer.Flags.HasFlag(GpuBufferFlags.Dynamic) || buffer.Flags.HasFlag(GpuBufferFlags.ComputeWrite))
     {
         Bgfx.SetVertexBuffer(stream, (DynamicVertexBuffer)buffer.GetNativeObject(), startVertex, count);
     }
     else
     {
         Bgfx.SetVertexBuffer(stream, (VertexBuffer)buffer.GetNativeObject(), startVertex, count);
     }
 }
コード例 #4
0
 public ChannelFloat4(
     Component_RenderingPipeline.RenderSceneData.MeshDataRenderOperation sourceOper,
     Component_RenderingPipeline.RenderSceneData.MeshDataRenderOperation destOper,
     VertexElementSemantic semantic
     ) : this()
 {
     if (sourceOper.VertexStructure.GetElementBySemantic(semantic, out VertexElement sourceElement) && sourceElement.Type == VertexElementType.Float4)
     {
         var sourceBuffer = sourceOper.VertexBuffers[sourceElement.Source];
         SourceData = sourceBuffer.ExtractChannel <Vector4F>(sourceElement.Offset);
         if (destOper.VertexStructure.GetElementBySemantic(semantic, out destElement) && destElement.Type == VertexElementType.Float4)
         {
             destBuffer = destOper.VertexBuffers[destElement.Source];
             DestData   = new Vector4F[destBuffer.VertexCount];
             Exists     = true;
         }
     }
 }