ComputeLua
The handler for the Dispatcher, threads, and data keys
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ComputeLua = require(ReplicatedStorage.ComputeLua)
Types
BufferDataType
type
BufferDataType =
Vector2
|
Vector3
|
CFrame
|
Color3
|
UDim
|
UDim2
|
number
|
boolean
|
string
The only data types allowed in buffers
ComputeBufferDataType
Type for the data of a ComputeBuffer
Functions
CreateDispatcher
Parallel Unsafesince v1.0.0
</>
ComputeLua.
CreateDispatcher
(
numWorkers:
number
,
--
How many workers to use, balanced this with performance and speed
) →
Dispatcher
Create a Dispatcher to run a bunch of workers in parallel
CreateThread
Serial Unsafesince v1.3.0
</>
ComputeLua.
CreateThread
(
actor:
Actor
,
--
The Actor to bind the thread to, this should be the same actor as the parent of the worker.
threadName:
string
,
--
The unique name of the thread.
callback:
(
id:
number
,
bufferData:
SharedTable
)
→
{
any
}
--
The function that will be executed when the thread is called and what returns the data
) →
(
)
Create a thread for the Dispatcher to execute
GetBufferDataKey
since v1.3.0
</>
ComputeLua.
GetBufferDataKey
(
bufferName:
string
--
The name of the buffer
) →
number
Get a ComputeBuffer's data key through its name