2021-01-20 03:33:27 +00:00
|
|
|
using System;
|
2021-11-15 05:08:02 +00:00
|
|
|
using System.Runtime.InteropServices;
|
2021-02-10 06:51:30 +00:00
|
|
|
using MoonWorks.Math;
|
2021-01-20 03:33:27 +00:00
|
|
|
using RefreshCS;
|
|
|
|
|
|
|
|
namespace MoonWorks.Graphics
|
|
|
|
{
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Command buffers are used to apply render state and issue draw calls.
|
|
|
|
/// NOTE: it is not recommended to hold references to command buffers long term.
|
|
|
|
/// </summary>
|
2022-01-10 20:11:24 +00:00
|
|
|
public struct CommandBuffer
|
2021-01-20 03:33:27 +00:00
|
|
|
{
|
|
|
|
public GraphicsDevice Device { get; }
|
|
|
|
public IntPtr Handle { get; internal set; }
|
|
|
|
|
|
|
|
// called from RefreshDevice
|
2022-01-10 20:11:24 +00:00
|
|
|
internal CommandBuffer(GraphicsDevice device, IntPtr handle)
|
2021-01-20 03:33:27 +00:00
|
|
|
{
|
|
|
|
Device = device;
|
2022-01-10 20:11:24 +00:00
|
|
|
Handle = handle;
|
2021-01-20 03:33:27 +00:00
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Begins a render pass.
|
|
|
|
/// All render state, resource binding, and draw commands must be made within a render pass.
|
|
|
|
/// It is an error to call this after calling BeginRenderPass but before calling EndRenderPass.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="renderPass">The render pass object to begin.</param>
|
|
|
|
/// <param name="framebuffer">The framebuffer used by the render pass.</param>
|
|
|
|
/// <param name="renderArea">The screen area of the render pass.</param>
|
|
|
|
/// <param name="depthStencilClearValue">Clear values for the depth/stencil buffer. This is ignored if the render pass does not clear.</param>
|
2021-02-10 06:51:30 +00:00
|
|
|
public unsafe void BeginRenderPass(
|
|
|
|
RenderPass renderPass,
|
|
|
|
Framebuffer framebuffer,
|
|
|
|
in Rect renderArea,
|
|
|
|
in DepthStencilValue depthStencilClearValue
|
|
|
|
) {
|
|
|
|
Refresh.Refresh_BeginRenderPass(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
renderPass.Handle,
|
|
|
|
framebuffer.Handle,
|
|
|
|
renderArea.ToRefresh(),
|
|
|
|
IntPtr.Zero,
|
|
|
|
0,
|
|
|
|
depthStencilClearValue.ToRefresh()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Begins a render pass.
|
|
|
|
/// All render state, resource binding, and draw commands must be made within a render pass.
|
|
|
|
/// It is an error to call this after calling BeginRenderPass but before calling EndRenderPass.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="renderPass">The render pass object to begin.</param>
|
|
|
|
/// <param name="framebuffer">The framebuffer used by the render pass.</param>
|
|
|
|
/// <param name="renderArea">The screen area of the render pass.</param>
|
|
|
|
/// <param name="depthStencilClearValue">Clear values for the depth/stencil buffer. This is ignored if the render pass does not clear.</param>
|
|
|
|
/// <param name="clearColors">Color clear values for each render target in the framebuffer.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public unsafe void BeginRenderPass(
|
|
|
|
RenderPass renderPass,
|
|
|
|
Framebuffer framebuffer,
|
2021-01-22 01:27:25 +00:00
|
|
|
in Rect renderArea,
|
|
|
|
in DepthStencilValue depthStencilClearValue,
|
2021-02-10 06:51:30 +00:00
|
|
|
params Vector4[] clearColors
|
2021-01-20 03:33:27 +00:00
|
|
|
) {
|
2021-02-10 06:51:30 +00:00
|
|
|
Refresh.Vec4* colors = stackalloc Refresh.Vec4[clearColors.Length];
|
|
|
|
|
|
|
|
for (var i = 0; i < clearColors.Length; i++)
|
2021-01-20 03:33:27 +00:00
|
|
|
{
|
2021-02-10 06:51:30 +00:00
|
|
|
colors[i] = new Refresh.Vec4
|
|
|
|
{
|
|
|
|
x = clearColors[i].X,
|
|
|
|
y = clearColors[i].Y,
|
|
|
|
z = clearColors[i].Z,
|
|
|
|
w = clearColors[i].W
|
|
|
|
};
|
2021-01-20 03:33:27 +00:00
|
|
|
}
|
2021-02-10 06:51:30 +00:00
|
|
|
|
|
|
|
Refresh.Refresh_BeginRenderPass(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
renderPass.Handle,
|
|
|
|
framebuffer.Handle,
|
|
|
|
renderArea.ToRefresh(),
|
|
|
|
(IntPtr) colors,
|
|
|
|
(uint)clearColors.Length,
|
|
|
|
depthStencilClearValue.ToRefresh()
|
|
|
|
);
|
2021-01-20 03:33:27 +00:00
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Begins a render pass.
|
|
|
|
/// All render state, resource binding, and draw commands must be made within a render pass.
|
|
|
|
/// It is an error to call this after calling BeginRenderPass but before calling EndRenderPass.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="renderPass">The render pass object to begin.</param>
|
|
|
|
/// <param name="framebuffer">The framebuffer used by the render pass.</param>
|
|
|
|
/// <param name="renderArea">The screen area of the render pass.</param>
|
|
|
|
/// <param name="clearColors">Color clear values for each render target in the framebuffer.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public unsafe void BeginRenderPass(
|
|
|
|
RenderPass renderPass,
|
|
|
|
Framebuffer framebuffer,
|
2021-01-22 01:27:25 +00:00
|
|
|
in Rect renderArea,
|
2021-02-11 01:15:46 +00:00
|
|
|
params Vector4[] clearColors
|
2021-01-20 03:33:27 +00:00
|
|
|
) {
|
2021-02-11 01:15:46 +00:00
|
|
|
Refresh.Vec4* colors = stackalloc Refresh.Vec4[clearColors.Length];
|
|
|
|
|
|
|
|
for (var i = 0; i < clearColors.Length; i++)
|
2021-01-20 03:33:27 +00:00
|
|
|
{
|
2021-02-11 01:15:46 +00:00
|
|
|
colors[i] = new Refresh.Vec4
|
|
|
|
{
|
|
|
|
x = clearColors[i].X,
|
|
|
|
y = clearColors[i].Y,
|
|
|
|
z = clearColors[i].Z,
|
|
|
|
w = clearColors[i].W
|
|
|
|
};
|
2021-01-20 03:33:27 +00:00
|
|
|
}
|
2021-02-11 01:15:46 +00:00
|
|
|
|
|
|
|
Refresh.Refresh_BeginRenderPass(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
renderPass.Handle,
|
|
|
|
framebuffer.Handle,
|
|
|
|
renderArea.ToRefresh(),
|
|
|
|
(IntPtr) colors,
|
|
|
|
(uint) clearColors.Length,
|
|
|
|
IntPtr.Zero
|
|
|
|
);
|
2021-01-20 03:33:27 +00:00
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Begins a render pass.
|
|
|
|
/// All render state, resource binding, and draw commands must be made within a render pass.
|
|
|
|
/// It is an error to call this after calling BeginRenderPass but before calling EndRenderPass.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="renderPass">The render pass object to begin.</param>
|
|
|
|
/// <param name="framebuffer">The framebuffer used by the render pass.</param>
|
|
|
|
/// <param name="renderArea">The screen area of the render pass.</param>
|
|
|
|
public unsafe void BeginRenderPass(
|
|
|
|
RenderPass renderPass,
|
|
|
|
Framebuffer framebuffer,
|
|
|
|
in Rect renderArea
|
|
|
|
) {
|
|
|
|
Refresh.Refresh_BeginRenderPass(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
renderPass.Handle,
|
|
|
|
framebuffer.Handle,
|
|
|
|
renderArea.ToRefresh(),
|
|
|
|
IntPtr.Zero,
|
|
|
|
0,
|
|
|
|
IntPtr.Zero
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Binds a compute pipeline so that compute work may be dispatched.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="computePipeline">The compute pipeline to bind.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void BindComputePipeline(
|
|
|
|
ComputePipeline computePipeline
|
|
|
|
) {
|
|
|
|
Refresh.Refresh_BindComputePipeline(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
computePipeline.Handle
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Binds buffers to be used in the compute shader.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="buffers">A set of buffers to bind.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public unsafe void BindComputeBuffers(
|
|
|
|
params Buffer[] buffers
|
|
|
|
) {
|
|
|
|
var bufferPtrs = stackalloc IntPtr[buffers.Length];
|
|
|
|
|
|
|
|
for (var i = 0; i < buffers.Length; i += 1)
|
|
|
|
{
|
|
|
|
bufferPtrs[i] = buffers[i].Handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
Refresh.Refresh_BindComputeBuffers(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
(IntPtr) bufferPtrs
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Binds textures to be used in the compute shader.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="textures">A set of textures to bind.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public unsafe void BindComputeTextures(
|
|
|
|
params Texture[] textures
|
|
|
|
) {
|
|
|
|
var texturePtrs = stackalloc IntPtr[textures.Length];
|
|
|
|
|
|
|
|
for (var i = 0; i < textures.Length; i += 1)
|
|
|
|
{
|
|
|
|
texturePtrs[i] = textures[i].Handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
Refresh.Refresh_BindComputeTextures(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
(IntPtr) texturePtrs
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2022-01-18 04:39:03 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Dispatches compute work.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="groupCountX"></param>
|
|
|
|
/// <param name="groupCountY"></param>
|
|
|
|
/// <param name="groupCountZ"></param>
|
|
|
|
/// <param name="computeParamOffset"></param>
|
|
|
|
public void DispatchCompute(
|
|
|
|
uint groupCountX,
|
|
|
|
uint groupCountY,
|
|
|
|
uint groupCountZ,
|
|
|
|
uint computeParamOffset
|
|
|
|
) {
|
|
|
|
Refresh.Refresh_DispatchCompute(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
groupCountX,
|
|
|
|
groupCountY,
|
|
|
|
groupCountZ,
|
|
|
|
computeParamOffset
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Binds a graphics pipeline so that rendering work may be performed.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="graphicsPipeline">The graphics pipeline to bind.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void BindGraphicsPipeline(
|
|
|
|
GraphicsPipeline graphicsPipeline
|
|
|
|
) {
|
|
|
|
Refresh.Refresh_BindGraphicsPipeline(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
graphicsPipeline.Handle
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Binds vertex buffers to be used by subsequent draw calls.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="firstBinding">The index of the first buffer to bind.</param>
|
|
|
|
/// <param name="bufferBindings">Buffers to bind and their associated offsets.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public unsafe void BindVertexBuffers(
|
|
|
|
uint firstBinding,
|
|
|
|
params BufferBinding[] bufferBindings
|
|
|
|
) {
|
|
|
|
var bufferPtrs = stackalloc IntPtr[bufferBindings.Length];
|
|
|
|
var offsets = stackalloc ulong[bufferBindings.Length];
|
|
|
|
|
|
|
|
for (var i = 0; i < bufferBindings.Length; i += 1)
|
|
|
|
{
|
|
|
|
bufferPtrs[i] = bufferBindings[i].Buffer.Handle;
|
|
|
|
offsets[i] = bufferBindings[i].Offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
Refresh.Refresh_BindVertexBuffers(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
firstBinding,
|
|
|
|
(uint) bufferBindings.Length,
|
|
|
|
(IntPtr) bufferPtrs,
|
|
|
|
(IntPtr) offsets
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Binds vertex buffers to be used by subsequent draw calls.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="buffers">The buffers to bind.</param>
|
2021-01-22 21:54:49 +00:00
|
|
|
public unsafe void BindVertexBuffers(
|
|
|
|
params Buffer[] buffers
|
|
|
|
) {
|
|
|
|
var bufferPtrs = stackalloc IntPtr[buffers.Length];
|
|
|
|
var offsets = stackalloc ulong[buffers.Length];
|
|
|
|
|
|
|
|
for (var i = 0; i < buffers.Length; i += 1)
|
|
|
|
{
|
|
|
|
bufferPtrs[i] = buffers[i].Handle;
|
|
|
|
offsets[i] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
Refresh.Refresh_BindVertexBuffers(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
0,
|
|
|
|
(uint) buffers.Length,
|
|
|
|
(IntPtr) bufferPtrs,
|
|
|
|
(IntPtr) offsets
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Binds an index buffer to be used by subsequent draw calls.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="indexBuffer">The index buffer to bind.</param>
|
|
|
|
/// <param name="indexElementSize">The size in bytes of the index buffer elements.</param>
|
|
|
|
/// <param name="offset">The offset index for the buffer.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void BindIndexBuffer(
|
|
|
|
Buffer indexBuffer,
|
2021-01-22 21:56:24 +00:00
|
|
|
IndexElementSize indexElementSize,
|
|
|
|
uint offset = 0
|
2021-01-20 03:33:27 +00:00
|
|
|
) {
|
|
|
|
Refresh.Refresh_BindIndexBuffer(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
indexBuffer.Handle,
|
|
|
|
offset,
|
2021-01-22 03:55:09 +00:00
|
|
|
(Refresh.IndexElementSize) indexElementSize
|
2021-01-20 03:33:27 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Binds samplers to be used by the vertex shader.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="textureSamplerBindings">An array of texture-sampler pairs to bind.</param>
|
|
|
|
/// <param name="length">The number of texture-sampler pairs from the array to bind.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public unsafe void BindVertexSamplers(
|
2021-02-11 20:25:12 +00:00
|
|
|
TextureSamplerBinding[] textureSamplerBindings,
|
|
|
|
int length
|
2021-01-20 03:33:27 +00:00
|
|
|
) {
|
2021-01-22 21:57:49 +00:00
|
|
|
var texturePtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
|
|
|
var samplerPtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
2021-01-20 03:33:27 +00:00
|
|
|
|
2021-02-11 20:25:12 +00:00
|
|
|
for (var i = 0; i < length; i += 1)
|
2021-01-20 03:33:27 +00:00
|
|
|
{
|
2021-01-22 21:57:49 +00:00
|
|
|
texturePtrs[i] = textureSamplerBindings[i].Texture.Handle;
|
|
|
|
samplerPtrs[i] = textureSamplerBindings[i].Sampler.Handle;
|
2021-01-20 03:33:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Refresh.Refresh_BindVertexSamplers(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
(IntPtr) texturePtrs,
|
|
|
|
(IntPtr) samplerPtrs
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Binds samplers to be used by the vertex shader.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="textureSamplerBindings">The texture-sampler pairs to bind.</param>
|
2021-02-11 20:25:12 +00:00
|
|
|
public unsafe void BindVertexSamplers(
|
2021-01-20 03:33:27 +00:00
|
|
|
params TextureSamplerBinding[] textureSamplerBindings
|
2021-02-11 20:25:12 +00:00
|
|
|
) {
|
|
|
|
BindVertexSamplers(textureSamplerBindings, textureSamplerBindings.Length);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Binds samplers to be used by the fragment shader.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="textureSamplerBindings">An array of texture-sampler pairs to bind.</param>
|
|
|
|
/// <param name="length">The number of texture-sampler pairs from the given array to bind.</param>
|
2021-02-11 20:25:12 +00:00
|
|
|
public unsafe void BindFragmentSamplers(
|
|
|
|
TextureSamplerBinding[] textureSamplerBindings,
|
|
|
|
int length
|
2021-01-20 03:33:27 +00:00
|
|
|
) {
|
|
|
|
var texturePtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
|
|
|
var samplerPtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
|
|
|
|
2021-02-11 20:25:12 +00:00
|
|
|
for (var i = 0; i < length; i += 1)
|
2021-01-20 03:33:27 +00:00
|
|
|
{
|
|
|
|
texturePtrs[i] = textureSamplerBindings[i].Texture.Handle;
|
|
|
|
samplerPtrs[i] = textureSamplerBindings[i].Sampler.Handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
Refresh.Refresh_BindFragmentSamplers(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
(IntPtr) texturePtrs,
|
|
|
|
(IntPtr) samplerPtrs
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Binds samplers to be used by the fragment shader.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="textureSamplerBindings">An array of texture-sampler pairs to bind.</param>
|
2021-02-11 20:25:12 +00:00
|
|
|
public unsafe void BindFragmentSamplers(
|
|
|
|
params TextureSamplerBinding[] textureSamplerBindings
|
|
|
|
) {
|
|
|
|
BindFragmentSamplers(textureSamplerBindings, textureSamplerBindings.Length);
|
|
|
|
}
|
|
|
|
|
2022-01-12 21:01:32 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Pushes vertex shader uniforms to the device.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>A starting offset value to be used with draw calls.</returns>
|
|
|
|
public unsafe uint PushVertexShaderUniforms<T>(
|
|
|
|
params T[] uniforms
|
|
|
|
) where T : unmanaged
|
|
|
|
{
|
|
|
|
fixed (T* ptr = &uniforms[0])
|
|
|
|
{
|
|
|
|
return Refresh.Refresh_PushVertexShaderUniforms(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
(IntPtr) ptr,
|
|
|
|
(uint) (uniforms.Length * Marshal.SizeOf<T>())
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Pushes fragment shader uniforms to the device.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>A starting offset to be used with draw calls.</returns>
|
|
|
|
public unsafe uint PushFragmentShaderUniforms<T>(
|
|
|
|
params T[] uniforms
|
|
|
|
) where T : unmanaged
|
|
|
|
{
|
|
|
|
fixed (T* ptr = &uniforms[0])
|
|
|
|
{
|
|
|
|
return Refresh.Refresh_PushFragmentShaderUniforms(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
(IntPtr) ptr,
|
|
|
|
(uint) (uniforms.Length * Marshal.SizeOf<T>())
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Pushes compute shader uniforms to the device.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>A starting offset to be used with dispatch calls.</returns>
|
|
|
|
public unsafe uint PushComputeShaderUniforms<T>(
|
|
|
|
params T[] uniforms
|
|
|
|
) where T : unmanaged
|
|
|
|
{
|
|
|
|
fixed (T* ptr = &uniforms[0])
|
|
|
|
{
|
|
|
|
return Refresh.Refresh_PushComputeShaderUniforms(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
(IntPtr) ptr,
|
|
|
|
(uint) (uniforms.Length * Marshal.SizeOf<T>())
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Clears the render targets on the current framebuffer to a single color or depth/stencil value.
|
|
|
|
/// NOTE: It is recommended that you clear when beginning render passes unless you have a good reason to clear mid-pass.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="clearRect">The area of the framebuffer to clear.</param>
|
|
|
|
/// <param name="clearOptions">Whether to clear colors, depth, or stencil value, or multiple.</param>
|
|
|
|
/// <param name="depthStencilClearValue">The depth/stencil clear values. Will be ignored if color is not provided in ClearOptions.</param>
|
|
|
|
/// <param name="clearColors">The color clear values. Must provide one per render target. Can be omitted if depth/stencil is not cleared.</param>
|
2021-01-22 22:16:38 +00:00
|
|
|
public unsafe void Clear(
|
|
|
|
in Rect clearRect,
|
2021-02-09 03:22:27 +00:00
|
|
|
ClearOptionsFlags clearOptions,
|
2021-01-22 22:16:38 +00:00
|
|
|
in DepthStencilValue depthStencilClearValue,
|
2021-02-10 06:51:30 +00:00
|
|
|
params Vector4[] clearColors
|
2021-01-20 03:33:27 +00:00
|
|
|
) {
|
2021-02-10 06:51:30 +00:00
|
|
|
Refresh.Vec4* colors = stackalloc Refresh.Vec4[clearColors.Length];
|
|
|
|
for (var i = 0; i < clearColors.Length; i++)
|
|
|
|
{
|
|
|
|
colors[i] = new Refresh.Vec4
|
|
|
|
{
|
|
|
|
x = clearColors[i].X,
|
|
|
|
y = clearColors[i].Y,
|
|
|
|
z = clearColors[i].Z,
|
|
|
|
w = clearColors[i].W
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-01-20 03:33:27 +00:00
|
|
|
Refresh.Refresh_Clear(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
2021-01-22 22:16:38 +00:00
|
|
|
clearRect.ToRefresh(),
|
2021-02-09 03:22:27 +00:00
|
|
|
(Refresh.ClearOptionsFlags)clearOptions,
|
2021-01-22 22:16:38 +00:00
|
|
|
(IntPtr) colors,
|
|
|
|
(uint) clearColors.Length,
|
|
|
|
depthStencilClearValue.ToRefresh()
|
2021-01-20 03:33:27 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Draws using instanced rendering.
|
|
|
|
/// It is an error to call this method unless two vertex buffers have been bound.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="baseVertex">The starting index offset for the vertex buffer.</param>
|
|
|
|
/// <param name="startIndex">The starting index offset for the index buffer.</param>
|
|
|
|
/// <param name="primitiveCount">The number of primitives to draw.</param>
|
|
|
|
/// <param name="instanceCount">The number of instances to draw.</param>
|
|
|
|
/// <param name="vertexParamOffset">An offset value obtained from PushVertexShaderUniforms. If no uniforms are required then use 0.</param>
|
|
|
|
/// <param name="fragmentParamOffset">An offset value obtained from PushFragmentShaderUniforms. If no uniforms are required the use 0.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void DrawInstancedPrimitives(
|
|
|
|
uint baseVertex,
|
|
|
|
uint startIndex,
|
|
|
|
uint primitiveCount,
|
|
|
|
uint instanceCount,
|
|
|
|
uint vertexParamOffset,
|
|
|
|
uint fragmentParamOffset
|
|
|
|
) {
|
|
|
|
Refresh.Refresh_DrawInstancedPrimitives(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
baseVertex,
|
|
|
|
startIndex,
|
|
|
|
primitiveCount,
|
|
|
|
instanceCount,
|
|
|
|
vertexParamOffset,
|
|
|
|
fragmentParamOffset
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Draws using a vertex buffer and an index buffer.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="baseVertex">The starting index offset for the vertex buffer.</param>
|
|
|
|
/// <param name="startIndex">The starting index offset for the index buffer.</param>
|
|
|
|
/// <param name="primitiveCount">The number of primitives to draw.</param>
|
|
|
|
/// <param name="vertexParamOffset">An offset value obtained from PushVertexShaderUniforms. If no uniforms are required then use 0.</param>
|
|
|
|
/// <param name="fragmentParamOffset">An offset value obtained from PushFragmentShaderUniforms. If no uniforms are required the use 0.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void DrawIndexedPrimitives(
|
|
|
|
uint baseVertex,
|
|
|
|
uint startIndex,
|
|
|
|
uint primitiveCount,
|
|
|
|
uint vertexParamOffset,
|
|
|
|
uint fragmentParamOffset
|
|
|
|
) {
|
|
|
|
Refresh.Refresh_DrawIndexedPrimitives(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
baseVertex,
|
|
|
|
startIndex,
|
|
|
|
primitiveCount,
|
|
|
|
vertexParamOffset,
|
|
|
|
fragmentParamOffset
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Draws using a vertex buffer.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="vertexStart"></param>
|
|
|
|
/// <param name="primitiveCount"></param>
|
|
|
|
/// <param name="vertexParamOffset"></param>
|
|
|
|
/// <param name="fragmentParamOffset"></param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void DrawPrimitives(
|
|
|
|
uint vertexStart,
|
|
|
|
uint primitiveCount,
|
|
|
|
uint vertexParamOffset,
|
|
|
|
uint fragmentParamOffset
|
|
|
|
) {
|
|
|
|
Refresh.Refresh_DrawPrimitives(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
vertexStart,
|
|
|
|
primitiveCount,
|
|
|
|
vertexParamOffset,
|
|
|
|
fragmentParamOffset
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Ends the current render pass.
|
|
|
|
/// This must be called before beginning another render pass or submitting the command buffer.
|
|
|
|
/// </summary>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void EndRenderPass()
|
|
|
|
{
|
|
|
|
Refresh.Refresh_EndRenderPass(
|
|
|
|
Device.Handle,
|
|
|
|
Handle
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Prepares a texture to be presented to the screen.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="texture">The texture to present.</param>
|
|
|
|
/// <param name="destinationRectangle">The area of the screen to present to.</param>
|
|
|
|
/// <param name="filter">The filter to use when the texture size differs from the destination rectangle.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void QueuePresent(
|
2021-01-21 22:05:10 +00:00
|
|
|
in Texture texture,
|
|
|
|
in Rect destinationRectangle,
|
|
|
|
Filter filter
|
2021-02-24 07:41:14 +00:00
|
|
|
) {
|
2021-01-21 22:05:10 +00:00
|
|
|
var refreshRect = destinationRectangle.ToRefresh();
|
|
|
|
var refreshTextureSlice = new Refresh.TextureSlice
|
|
|
|
{
|
|
|
|
texture = texture.Handle,
|
|
|
|
rectangle = new Refresh.Rect
|
|
|
|
{
|
|
|
|
x = 0,
|
|
|
|
y = 0,
|
|
|
|
w = (int)texture.Width,
|
|
|
|
h = (int)texture.Height
|
|
|
|
},
|
|
|
|
layer = 0,
|
|
|
|
level = 0,
|
|
|
|
depth = 0
|
|
|
|
};
|
|
|
|
|
|
|
|
Refresh.Refresh_QueuePresent(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
2021-01-22 01:27:25 +00:00
|
|
|
refreshTextureSlice,
|
|
|
|
refreshRect,
|
2021-01-21 22:05:10 +00:00
|
|
|
(Refresh.Filter)filter
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Prepares a texture slice to be presented to the screen.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="textureSlice">The texture slice to present.</param>
|
|
|
|
/// <param name="destinationRectangle">The area of the screen to present to.</param>
|
|
|
|
/// <param name="filter">The filter to use when the texture size differs from the destination rectangle.</param>
|
2021-01-21 22:05:10 +00:00
|
|
|
public void QueuePresent(
|
|
|
|
in TextureSlice textureSlice,
|
|
|
|
in Rect destinationRectangle,
|
2021-01-20 21:32:48 +00:00
|
|
|
Filter filter
|
2021-01-20 03:33:27 +00:00
|
|
|
) {
|
|
|
|
var refreshTextureSlice = textureSlice.ToRefreshTextureSlice();
|
2021-01-20 21:32:48 +00:00
|
|
|
var refreshRect = destinationRectangle.ToRefresh();
|
2021-01-20 03:33:27 +00:00
|
|
|
|
|
|
|
Refresh.Refresh_QueuePresent(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
2021-01-22 01:27:25 +00:00
|
|
|
refreshTextureSlice,
|
|
|
|
refreshRect,
|
2021-01-20 21:32:48 +00:00
|
|
|
(Refresh.Filter) filter
|
2021-01-20 03:33:27 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Prepares a texture slice to be presented to the screen.
|
|
|
|
/// This particular variant of this method will present to the entire window area.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="textureSlice">The texture slice to present.</param>
|
|
|
|
/// <param name="filter">The filter to use when the texture size differs from the window size.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void QueuePresent(
|
2021-01-21 22:05:10 +00:00
|
|
|
in TextureSlice textureSlice,
|
2021-01-20 21:32:48 +00:00
|
|
|
Filter filter
|
2021-01-20 03:33:27 +00:00
|
|
|
) {
|
|
|
|
Refresh.Refresh_QueuePresent(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
2021-01-22 01:27:25 +00:00
|
|
|
textureSlice.ToRefreshTextureSlice(),
|
2021-01-20 03:33:27 +00:00
|
|
|
IntPtr.Zero,
|
2021-01-20 21:32:48 +00:00
|
|
|
(Refresh.Filter) filter
|
2021-01-20 03:33:27 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Prepares a texture to be presented to the screen.
|
|
|
|
/// This particular variant of this method will present to the entire window area.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="texture">The texture to present.</param>
|
|
|
|
/// <param name="filter">The filter to use when the texture size differs from the window size.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void QueuePresent(
|
|
|
|
Texture texture,
|
2021-01-20 21:32:48 +00:00
|
|
|
Filter filter
|
2021-01-20 03:33:27 +00:00
|
|
|
) {
|
|
|
|
var refreshTextureSlice = new Refresh.TextureSlice
|
|
|
|
{
|
|
|
|
texture = texture.Handle,
|
|
|
|
rectangle = new Refresh.Rect
|
|
|
|
{
|
|
|
|
x = 0,
|
|
|
|
y = 0,
|
|
|
|
w = (int) texture.Width,
|
|
|
|
h = (int) texture.Height
|
|
|
|
},
|
|
|
|
layer = 0,
|
|
|
|
level = 0,
|
|
|
|
depth = 0
|
|
|
|
};
|
|
|
|
|
|
|
|
Refresh.Refresh_QueuePresent(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
2021-01-22 01:27:25 +00:00
|
|
|
refreshTextureSlice,
|
2021-01-20 03:33:27 +00:00
|
|
|
IntPtr.Zero,
|
2021-01-20 21:32:48 +00:00
|
|
|
(Refresh.Filter) filter
|
2021-01-20 03:33:27 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2022-01-13 22:29:08 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Copies arbitrary data into a buffer.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="buffer">The buffer to copy into.</param>
|
|
|
|
/// <param name="dataPtr">Pointer to the data to copy into the buffer.</param>
|
|
|
|
/// <param name="bufferOffsetInBytes">Specifies where in the buffer to copy data.</param>
|
|
|
|
/// <param name="dataLengthInBytes">The length of data that should be copied.</param>
|
|
|
|
/// <param name="setDataOption">Specifies whether the buffer should be copied in immediate or deferred mode. When in doubt, use deferred.</param>
|
|
|
|
public void SetBufferData(
|
|
|
|
Buffer buffer,
|
|
|
|
IntPtr dataPtr,
|
|
|
|
uint bufferOffsetInBytes,
|
2022-01-13 22:48:32 +00:00
|
|
|
uint dataLengthInBytes
|
2022-01-13 22:29:08 +00:00
|
|
|
) {
|
|
|
|
Refresh.Refresh_SetBufferData(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
buffer.Handle,
|
|
|
|
bufferOffsetInBytes,
|
|
|
|
dataPtr,
|
2022-01-13 22:48:32 +00:00
|
|
|
dataLengthInBytes
|
2022-01-13 22:29:08 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Copies array data into a buffer.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="buffer">The buffer to copy to.</param>
|
|
|
|
/// <param name="data">The array to copy from.</param>
|
|
|
|
/// <param name="bufferOffsetInBytes">Specifies where in the buffer to start copying.</param>
|
|
|
|
/// <param name="startElement">The index of the first element to copy from the array.</param>
|
|
|
|
/// <param name="numElements">How many elements to copy.</param>
|
|
|
|
/// <param name="setDataOption">Specifies whether the buffer should be copied in immediate or deferred mode. When in doubt, use deferred.</param>
|
|
|
|
public unsafe void SetBufferData<T>(
|
|
|
|
Buffer buffer,
|
|
|
|
T[] data,
|
|
|
|
uint bufferOffsetInBytes,
|
|
|
|
uint startElement,
|
2022-01-13 22:48:32 +00:00
|
|
|
uint numElements
|
2022-01-13 22:29:08 +00:00
|
|
|
) where T : unmanaged
|
|
|
|
{
|
|
|
|
var elementSize = Marshal.SizeOf<T>();
|
|
|
|
|
|
|
|
fixed (T* ptr = &data[0])
|
|
|
|
{
|
|
|
|
var dataPtr = ptr + (startElement * elementSize);
|
|
|
|
|
|
|
|
Refresh.Refresh_SetBufferData(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
buffer.Handle,
|
|
|
|
bufferOffsetInBytes,
|
|
|
|
(IntPtr) dataPtr,
|
2022-01-13 22:48:32 +00:00
|
|
|
(uint) (numElements * elementSize)
|
2022-01-13 22:29:08 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Copies array data into a buffer.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="buffer">The buffer to copy to.</param>
|
|
|
|
/// <param name="data">The array to copy from.</param>
|
|
|
|
/// <param name="bufferOffsetInBytes">Specifies where in the buffer to start copying.</param>
|
|
|
|
/// <param name="setDataOption">Specifies whether the buffer should be copied in immediate or deferred mode. When in doubt, use deferred.</param>
|
|
|
|
public unsafe void SetBufferData<T>(
|
|
|
|
Buffer buffer,
|
|
|
|
T[] data,
|
2022-01-13 22:48:32 +00:00
|
|
|
uint bufferOffsetInBytes = 0
|
2022-01-13 22:29:08 +00:00
|
|
|
) where T : unmanaged
|
|
|
|
{
|
|
|
|
SetBufferData(
|
|
|
|
buffer,
|
|
|
|
data,
|
|
|
|
bufferOffsetInBytes,
|
|
|
|
0,
|
2022-01-13 22:48:32 +00:00
|
|
|
(uint) data.Length
|
2022-01-13 22:29:08 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-11-15 05:08:02 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Asynchronously copies data into a texture.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="textureSlice">The texture slice to copy into.</param>
|
|
|
|
/// <param name="dataPtr">A pointer to an array of data to copy from.</param>
|
|
|
|
/// <param name="dataLengthInBytes">The amount of data to copy from the array.</param>
|
|
|
|
public void SetTextureData(in TextureSlice textureSlice, IntPtr dataPtr, uint dataLengthInBytes)
|
|
|
|
{
|
|
|
|
Refresh.Refresh_SetTextureData(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
textureSlice.ToRefreshTextureSlice(),
|
|
|
|
dataPtr,
|
|
|
|
dataLengthInBytes
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Asynchronously copies data into a texture.
|
|
|
|
/// This variant copies into the entire texture.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="dataPtr">A pointer to an array of data to copy from.</param>
|
|
|
|
/// <param name="dataLengthInBytes">The amount of data to copy from the array.</param>
|
|
|
|
public void SetTextureData(Texture texture, IntPtr dataPtr, uint dataLengthInBytes)
|
|
|
|
{
|
|
|
|
SetTextureData(new TextureSlice(texture), dataPtr, dataLengthInBytes);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Asynchronously copies data into the texture.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="textureSlice">The texture slice to copy into.</param>
|
|
|
|
/// <param name="data">An array of data to copy into the texture.</param>
|
|
|
|
public unsafe void SetTextureData<T>(in TextureSlice textureSlice, T[] data) where T : unmanaged
|
|
|
|
{
|
|
|
|
var size = Marshal.SizeOf<T>();
|
|
|
|
|
|
|
|
fixed (T* ptr = &data[0])
|
|
|
|
{
|
|
|
|
Refresh.Refresh_SetTextureData(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
|
|
|
textureSlice.ToRefreshTextureSlice(),
|
|
|
|
(IntPtr) ptr,
|
|
|
|
(uint) (data.Length * size)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Asynchronously copies data into a texture.
|
|
|
|
/// This variant copies data into the entire texture.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="data">An array of data to copy into the texture.</param>
|
|
|
|
public unsafe void SetTextureData<T>(Texture texture, T[] data) where T : unmanaged
|
|
|
|
{
|
|
|
|
SetTextureData(new TextureSlice(texture), data);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Performs an asynchronous texture-to-texture copy on the GPU.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="sourceTextureSlice">The texture slice to copy from.</param>
|
|
|
|
/// <param name="destinationTextureSlice">The texture slice to copy to.</param>
|
|
|
|
/// <param name="filter">The filter to use if the sizes of the texture slices differ.</param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void CopyTextureToTexture(
|
2021-01-21 22:05:10 +00:00
|
|
|
in TextureSlice sourceTextureSlice,
|
|
|
|
in TextureSlice destinationTextureSlice,
|
2021-01-20 21:32:48 +00:00
|
|
|
Filter filter
|
2021-01-20 03:33:27 +00:00
|
|
|
) {
|
|
|
|
var sourceRefreshTextureSlice = sourceTextureSlice.ToRefreshTextureSlice();
|
|
|
|
var destRefreshTextureSlice = destinationTextureSlice.ToRefreshTextureSlice();
|
|
|
|
|
|
|
|
Refresh.Refresh_CopyTextureToTexture(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
2021-01-22 01:27:25 +00:00
|
|
|
sourceRefreshTextureSlice,
|
|
|
|
destRefreshTextureSlice,
|
2021-01-20 21:32:48 +00:00
|
|
|
(Refresh.Filter) filter
|
2021-01-20 03:33:27 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 07:41:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Performs an asynchronous texture-to-buffer copy.
|
|
|
|
/// Note that the buffer is not guaranteed to be filled until you call GraphicsDevice.Wait()
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="textureSlice"></param>
|
|
|
|
/// <param name="buffer"></param>
|
2021-01-20 03:33:27 +00:00
|
|
|
public void CopyTextureToBuffer(
|
2021-01-21 22:05:10 +00:00
|
|
|
in TextureSlice textureSlice,
|
2021-01-20 03:33:27 +00:00
|
|
|
Buffer buffer
|
|
|
|
) {
|
|
|
|
var refreshTextureSlice = textureSlice.ToRefreshTextureSlice();
|
|
|
|
|
|
|
|
Refresh.Refresh_CopyTextureToBuffer(
|
|
|
|
Device.Handle,
|
|
|
|
Handle,
|
2021-01-22 01:27:25 +00:00
|
|
|
refreshTextureSlice,
|
2021-01-20 03:33:27 +00:00
|
|
|
buffer.Handle
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|