/// <inheritdoc /> public override void Copy(GraphicsTexture destination, GraphicsBuffer source) => Copy((VulkanGraphicsTexture)destination, (VulkanGraphicsBuffer)source);
/// <summary>Copies the contents of a graphics buffer to a two-dimensional graphics texture.</summary> /// <param name="destination">The destination two-dimensional graphics texture.</param> /// <param name="source">The source graphics buffer.</param> /// <exception cref="ArgumentNullException"><paramref name="destination" /> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException"><paramref name="source" /> is <c>null</c>.</exception> /// <exception cref="ObjectDisposedException">The context has been disposed.</exception> public abstract void Copy(GraphicsTexture destination, GraphicsBuffer source);
/// <summary>Initializes a new instance of the <see cref="GraphicsPrimitive" /> class.</summary> /// <param name="graphicsDevice">The graphics device for which the primitive was created.</param> /// <param name="graphicsPipeline">The graphics pipeline used for rendering the primitive.</param> /// <param name="vertexBuffer">The graphics buffer which holds the vertices for the primitive.</param> /// <param name="indexBuffer">The graphics buffer which holds the indices for the primitive or <c>null</c> if none exists.</param> /// <param name="inputResources">The graphics resources which hold the input data for the primitive or an empty span if none exist.</param> /// <exception cref="ArgumentNullException"><paramref name="graphicsDevice" /> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException"><paramref name="graphicsPipeline" /> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException"><paramref name="vertexBuffer" /> is <c>null</c>.</exception> /// <exception cref="ArgumentOutOfRangeException"><paramref name="graphicsPipeline" /> was not created for <paramref name="graphicsDevice" />.</exception> /// <exception cref="ArgumentOutOfRangeException"><paramref name="vertexBuffer" /> was not created for <paramref name="graphicsDevice" />.</exception> /// <exception cref="ArgumentOutOfRangeException"><paramref name="indexBuffer" /> was not created for <paramref name="graphicsDevice" />.</exception> protected GraphicsPrimitive(GraphicsDevice graphicsDevice, GraphicsPipeline graphicsPipeline, GraphicsBuffer vertexBuffer, GraphicsBuffer?indexBuffer, ReadOnlySpan <GraphicsResource> inputResources) { ThrowIfNull(graphicsPipeline, nameof(graphicsPipeline)); ThrowIfNull(vertexBuffer, nameof(vertexBuffer)); if (graphicsPipeline.GraphicsDevice != graphicsDevice) { ThrowArgumentOutOfRangeException(nameof(graphicsPipeline), graphicsPipeline); } if (vertexBuffer.GraphicsHeap.GraphicsDevice != graphicsDevice) { ThrowArgumentOutOfRangeException(nameof(vertexBuffer), vertexBuffer); } if ((indexBuffer != null) && (indexBuffer.GraphicsHeap.GraphicsDevice != graphicsDevice)) { ThrowArgumentOutOfRangeException(nameof(indexBuffer), indexBuffer); } _graphicsDevice = graphicsDevice; _graphicsPipeline = graphicsPipeline; _vertexBuffer = vertexBuffer; _indexBuffer = indexBuffer; _inputResources = inputResources.ToArray(); }
/// <inheritdoc /> public override void Copy(GraphicsBuffer destination, GraphicsBuffer source) => Copy((D3D12GraphicsBuffer)destination, (D3D12GraphicsBuffer)source);