Relax job constraints, add ref type support, misc fixes
Relaxed generic constraints for job scheduling/execution to allow reference types (removed struct requirement). Updated IJob, IJobParallelFor, and IJobParallel extension methods to support both value and reference types, introducing RunRef for struct-specific overloads. Adjusted JobExecutor and JobScheduler to match new constraints. Bumped assembly version to 3.1.1. Added Value property to Wrapper<T> for ref access and inlined Get(). Changed GGXMipGenerationJob sample count to linear roughness. Removed unused usings in JobInfo.cs.
This commit is contained in:
@@ -272,6 +272,8 @@ public class Wrapper<T> : IDisposable
|
||||
|
||||
private bool _disposed;
|
||||
|
||||
public ref T Value => ref Get();
|
||||
|
||||
public Wrapper(T value)
|
||||
{
|
||||
_value = value;
|
||||
@@ -282,6 +284,7 @@ public class Wrapper<T> : IDisposable
|
||||
Dispose();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public ref T Get()
|
||||
{
|
||||
ObjectDisposedException.ThrowIf(_disposed, this);
|
||||
|
||||
Reference in New Issue
Block a user