Fixed a method name
このコミットが含まれているのは:
1 親
e292d5513f
コミット
5cb56aa8eb
3ファイル変更
+4
-4
検索条件に一致するファイルはありません
@@ -25,7 +25,7 @@ namespace ComputeSharp.Graphics.Buffers.Extensions
|
||||
/// <param name="data">The input <see cref="object"/> to copy to the allocated buffer</param>
|
||||
/// <returns>A constant <see cref="ConstantBuffer{T}"/> instance (as a <see cref="GraphicsResource"/>) with the input data</returns>
|
||||
[Pure]
|
||||
public static GraphicsResource AllocateReadOnlyBufferFromReflectedSingleValue(this GraphicsDevice device, object data)
|
||||
public static GraphicsResource AllocateConstantBufferFromReflectedSingleValue(this GraphicsDevice device, object data)
|
||||
{
|
||||
Type dataType = data.GetType();
|
||||
if (!TypeMapping.TryGetValue(dataType, out var info))
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace ComputeSharp.Shaders
|
||||
List<GraphicsResource> buffers = new List<GraphicsResource>();
|
||||
foreach (var variable in shaderLoader.CapturedConstantBufferValues)
|
||||
{
|
||||
GraphicsResource resource = device.AllocateReadOnlyBufferFromReflectedSingleValue(variable.Value);
|
||||
GraphicsResource resource = device.AllocateConstantBufferFromReflectedSingleValue(variable.Value);
|
||||
commandList.SetComputeRootDescriptorTable(variable.Index, resource);
|
||||
buffers.Add(resource);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace ComputeSharp.NetCore.Tests.Internals
|
||||
{
|
||||
object value = 77;
|
||||
|
||||
using ConstantBuffer<int> buffer = (ConstantBuffer<int>)Gpu.Default.AllocateReadOnlyBufferFromReflectedSingleValue(value);
|
||||
using ConstantBuffer<int> buffer = (ConstantBuffer<int>)Gpu.Default.AllocateConstantBufferFromReflectedSingleValue(value);
|
||||
int[] result = buffer.GetData();
|
||||
|
||||
Assert.IsTrue(result.Length == 1);
|
||||
@@ -26,7 +26,7 @@ namespace ComputeSharp.NetCore.Tests.Internals
|
||||
{
|
||||
object value = 3.14f;
|
||||
|
||||
using ConstantBuffer<float> buffer = (ConstantBuffer<float>)Gpu.Default.AllocateReadOnlyBufferFromReflectedSingleValue(value);
|
||||
using ConstantBuffer<float> buffer = (ConstantBuffer<float>)Gpu.Default.AllocateConstantBufferFromReflectedSingleValue(value);
|
||||
float[] result = buffer.GetData();
|
||||
|
||||
Assert.IsTrue(result.Length == 1);
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする