Update README.md

このコミットが含まれているのは:
Sergio Pedri authored and GitHub committed 2019-09-20 13:32:52 +02:00
1 親 335bee52a9
コミット 499923c2db
1ファイル変更
+2 -2
+2 -2
ファイルの表示
@@ -49,7 +49,7 @@ If the shader in C# is capturing some local variable, those will be automaticall
✅ .NET vector types: `System.Numerics.Vector2`, `Vector3`, `Vector4`
✅ HLSL vector types: `Bool2`, `Bool3`, `Bool4`, `Float2`, `Float3`, `Float4`, `Int2`, `Int3`, `Int4`, `UInt2`, `Uint3`, etc.
✅ HLSL types: `Bool`, `Bool2`, `Bool3`, `Bool4`, `Float2`, `Float3`, `Float4`, `Int2`, `Int3`, `Int4`, `UInt2`, `Uint3`, etc.
✅ `static` fields of both scalar, vector or buffer types
@@ -65,7 +65,7 @@ If the shader in C# is capturing some local variable, those will be automaticall
There are a number of extension APIs for the `GraphicsDevice` class that can be used to allocate GPU buffers of three types: `ConstantBuffer<T>`, `ReadOnlyBuffer<T>` and `ReadWriteBuffer<T>`. The first is packed to 16 bytes and provides the fastest possible access for buffer elements, but it has a limited maximum size (around 64KB) and requires additional overhead when copying data to and from it if the size of each element is not a multiple of 16. The other buffer types are tightly packed and work great for all kinds of operations, and can be thought of the HLSL equivalent of `T[]` arrays in C#. If you're in doubt about which buffer type to use, just use either `ReadOnlyBuffer<T>` or `ReadWriteBuffer<T>`, depending on whether or not you also need write access to that buffer on the GPU side.
**NOTE:** although the APIs to allocate buffers are simply generic methods with a `T : unmanaged` constrain, they should only be used with C# types that are fully mapped to HLSL types. That means either `int`, `uint`, `float`, `double`, .NET vector types or HLSL vector types. The `bool` type is only supported in `ConstantBuffer<T>` instances.
**NOTE:** although the APIs to allocate buffers are simply generic methods with a `T : unmanaged` constrain, they should only be used with C# types that are fully mapped to HLSL types. That means either `int`, `uint`, `float`, `double`, .NET vector types or HLSL types. The `bool` type should not be used in buffers due to C#/HLSL differences: use the `Bool` type instead.
## Advanced usage