xenko
xenko copied to clipboard
Problem with GPU buffers with DX12
Hi there, I am experimenting with Xenko and custom shaders.
In my sample I need to pass custom information stored in structured buffer to the shader program.
To declare the buffer I do something like this:
Buffer PositionBuffer = Buffer.Structured.New(graphicsDevice, positions).DisposeBy(this);
This runs well with DX11 but with DX12 I get the following error:
Unhandled Exception: System.NotImplementedException: The method or operation is not implemented.
at SiliconStudio.Xenko.Graphics.Buffer.Recreate(IntPtr dataPointer)
at SiliconStudio.Xenko.Graphics.Buffer.InitializeFromImpl(BufferDescription description, BufferFlags viewFlags, PixelFormat viewFormat, IntPtr dataPointer)
at SiliconStudio.Xenko.Graphics.Buffer.New(GraphicsDevice device, Int32 bufferSize, Int32 elementSize, BufferFlags bufferFlags, PixelFormat viewFormat, GraphicsResourceUsage usage)
at SiliconStudio.Xenko.Graphics.Buffer.Structured.New(GraphicsDevice device, Int32 count, Int32 elementSize, Boolean isUnorderedAccess)
Well I inspected the source code and it seems structured buffers are not implemented for DX12... :(
public void Recreate(IntPtr dataPointer)
{
...
if ((bufferFlags & BufferFlags.StructuredBuffer) != 0)
{
throw new NotImplementedException();
if (bufferDescription.StructureByteStride == 0)
throw new ArgumentException("Element size cannot be set to 0 for structured buffer");
}
Hello,
Sorry to say that indeed Structured buffers are not implemented yet for DX12. We'll let you know when they will.
Any ETA ? I want this feature very badly...
Hello, we fixed this issue internally. Will be probably released in version 2.1.