1
0
Fork 0
forked from aly/qstbak

muffin v7.5.5

This commit is contained in:
alydev 2026-08-17 20:25:32 +10:00
parent a8f2c1df37
commit 6266f9e6b7
110 changed files with 14907 additions and 6073 deletions

View file

@ -0,0 +1,29 @@
using System;
using TerraFX.Interop.DirectX;
namespace Auspex.Rendering.Direct3D;
internal abstract class HlslShaderData<TElement> : IDisposable where TElement : unmanaged
{
private protected readonly GpuBuffer<TElement> _buffer;
protected HlslShaderData(string name, FrameRenderContext ctx, int maxCount, bool dynamic)
{
_buffer = new GpuBuffer<TElement>(name, ctx, maxCount, 1u, dynamic);
}
public void Dispose()
{
_buffer.Dispose();
GC.SuppressFinalize(this);
}
private protected unsafe void DrawVertices(FrameRenderContext ctx, int first, int count)
{
ID3D11Buffer* buffer = _buffer.Buffer;
uint elementSize = (uint)_buffer.ElementSize;
uint num = 0u;
ctx.Context->IASetVertexBuffers(0u, 1u, &buffer, &elementSize, &num);
ctx.Context->Draw((uint)count, (uint)first);
}
}