Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeArray<float> , burst and Jobs #4

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

Neovariance
Copy link

Worth checking as it's the first time I delve into native plugins :

in NativeFastNoise2.cs :

in NativeFastNoise2Test.cs / FastNoiseJobParallelForBatch

-the threadsafety thing, but I think it's fine :

            //need to pass the actual subarray to fastnoise, not the whole array!
            //which actually guarantees thread safety, fastnoise has no access to the global array. 
            var subArray = NoiseOut.GetSubArray(startIndex, idxCount);

            MinMaxesOut[batchIndex] = GenUniformGrid2D(NodePtr, subArray, xStart, yStart, xCount, yCount, Frequency, Seed);

And btw, congrats and thanks for fastnoise2 and it's node tool, it's awesome !

@Auburn
Copy link
Owner

Auburn commented Jun 17, 2022

I've had a quick look through, I think you could set it up in a way that avoids having to duplicate FastNoise2.cs

You could add a GetNodeHandlePtr() member function to the normal FastNoise2.cs and use that to pass into the job?

It might be easier to chat through this on the FastNoise discord: https://discord.gg/SHVaVfV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants