If NativeMultiHashMapVisitUniqueKeyJobStruct<TJob, TKey, TValue> is expecting TValue, it has to be part of IXXXJob interface.
But also implementing a custom job requires the actual Execute method (the real one that will be used as an entry point) to be declared on the struct behind JobProducerType… You can have a look at how it is working for IJob by using ILSpy, but I’m not sure custom jobs are something publicly exposed today as “ready for end-user usage”
Thanks for the reply. I wasn’t sure why the single generic method didn’t work, or why the generic interfaces had to match but I should have emphasized that I was actually using the dual generic interface which appeared to work fine just threw that missing Execute method when loading burst inspector.
[JobProducerType(typeof(JobNativeMultiHashMapVisitUniqueKey.NativeMultiHashMapVisitUniqueKeyJobStruct<,,>))]
public interface IJobNativeMultiHashMapVisitUniqueKey<TKey, TValue>
where TKey : struct, IEquatable<TKey>
where TValue : struct
{
void Execute(TKey key);
}
I did just figure out my issue though. I thought the error was relating to Execute method on the interface but it’s actually the Execute method on the JobProducer
public static unsafe void Execute(
ref NativeMultiHashMapVisitUniqueKeyJobStruct<TJob, TKey, TValue> fullData,
IntPtr additionalPtr,
IntPtr bufferRangePatchData,
ref JobRanges ranges,
int jobIndex)
{
was private. While the BurstReflection class expected it to be public
var executeType = foundProducer.MakeGenericType(genericParams.ToArray());
var executeMethod = executeType.GetMethod("Execute"); // will not return private methods
if (executeMethod == null)
{
throw new InvalidOperationException($"Burst reflection error. The type `{executeType}` does not contain an `Execute` method");
}