Skip to content

Commit

Permalink
add RawBuffer flag resolves #1638
Browse files Browse the repository at this point in the history
(cherry picked from commit da1bd1b)
  • Loading branch information
texone authored and tebjan committed Jul 19, 2024
1 parent 3797e5d commit 9655f10
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sources/engine/Stride.Graphics/Buffer.Vertex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static class Vertex
/// </returns>
public static Buffer New(GraphicsDevice device, int size, GraphicsResourceUsage usage = GraphicsResourceUsage.Default, BufferFlags bindFlags = BufferFlags.VertexBuffer)
{
return Buffer.New(device, size, bindFlags, usage);
return Buffer.New(device, size, bindFlags | BufferFlags.RawBuffer, usage);
}

/// <summary>
Expand All @@ -56,7 +56,7 @@ public static Buffer New(GraphicsDevice device, int size, GraphicsResourceUsage
/// <returns>A Vertex buffer</returns>
public static Buffer<T> New<T>(GraphicsDevice device, GraphicsResourceUsage usage = GraphicsResourceUsage.Default) where T : unmanaged
{
return Buffer.New<T>(device, 1, BufferFlags.VertexBuffer, usage);
return Buffer.New<T>(device, 1, BufferFlags.VertexBuffer | BufferFlags.RawBuffer, usage);
}

/// <summary>
Expand All @@ -69,7 +69,7 @@ public static Buffer<T> New<T>(GraphicsDevice device, GraphicsResourceUsage usag
/// <returns>A Vertex buffer</returns>
public static Buffer<T> New<T>(GraphicsDevice device, ref T value, GraphicsResourceUsage usage = GraphicsResourceUsage.Immutable) where T : unmanaged
{
return Buffer.New(device, ref value, BufferFlags.VertexBuffer, usage);
return Buffer.New(device, ref value, BufferFlags.VertexBuffer | BufferFlags.RawBuffer, usage);
}

/// <summary>
Expand All @@ -82,7 +82,7 @@ public static Buffer<T> New<T>(GraphicsDevice device, ref T value, GraphicsResou
/// <returns>A Vertex buffer</returns>
public static Buffer<T> New<T>(GraphicsDevice device, T[] value, GraphicsResourceUsage usage = GraphicsResourceUsage.Immutable) where T : unmanaged
{
return Buffer.New(device, value, BufferFlags.VertexBuffer, usage);
return Buffer.New(device, value, BufferFlags.VertexBuffer | BufferFlags.RawBuffer, usage);
}

/// <summary>
Expand All @@ -95,7 +95,7 @@ public static Buffer<T> New<T>(GraphicsDevice device, T[] value, GraphicsResourc
/// <returns>A Vertex buffer</returns>
public static Buffer<T> New<T>(GraphicsDevice device, int vertexBufferCount, GraphicsResourceUsage usage = GraphicsResourceUsage.Default) where T : unmanaged
{
return Buffer.New<T>(device, vertexBufferCount, BufferFlags.VertexBuffer, usage);
return Buffer.New<T>(device, vertexBufferCount, BufferFlags.VertexBuffer | BufferFlags.RawBuffer, usage);
}

/// <summary>
Expand All @@ -107,7 +107,7 @@ public static Buffer<T> New<T>(GraphicsDevice device, int vertexBufferCount, Gra
/// <returns>A Vertex buffer</returns>
public static Buffer New(GraphicsDevice device, DataPointer value, GraphicsResourceUsage usage = GraphicsResourceUsage.Immutable)
{
return Buffer.New(device, value, 0, BufferFlags.VertexBuffer, usage);
return Buffer.New(device, value, 0, BufferFlags.VertexBuffer | BufferFlags.RawBuffer, usage);
}
}
}
Expand Down

0 comments on commit 9655f10

Please sign in to comment.