UnityGame/Library/PackageCache/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Hardware/HardwareRayTracingBackend.cs

29 lines
1.0 KiB
C#
Raw Normal View History

2024-10-27 10:53:47 +03:00
namespace UnityEngine.Rendering.UnifiedRayTracing
{
internal class HardwareRayTracingBackend : IRayTracingBackend
{
public HardwareRayTracingBackend(RayTracingResources resources)
{
m_Resources = resources;
}
public IRayTracingShader CreateRayTracingShader(Object shader, string kernelName, GraphicsBuffer dispatchBuffer)
{
Debug.Assert(shader is RayTracingShader);
return new HardwareRayTracingShader((RayTracingShader)shader, kernelName, dispatchBuffer);
}
public IRayTracingAccelStruct CreateAccelerationStructure(AccelerationStructureOptions options, ReferenceCounter counter)
{
return new HardwareRayTracingAccelStruct(options, m_Resources.hardwareRayTracingMaterial, counter, options.enableCompaction);
}
public ulong GetRequiredTraceScratchBufferSizeInBytes(uint width, uint height, uint depth)
{
return 0;
}
readonly RayTracingResources m_Resources;
}
}