MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Init

Method Init

Source/Engine/Renderer/Utils/BitonicSort.cpp:25–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25bool BitonicSort::Init()
26{
27 // Draw indirect and compute shaders support is required for this implementation
28 const auto& limits = GPUDevice::Instance->Limits;
29 if (!limits.HasDrawIndirect || !limits.HasCompute)
30 return false;
31
32 // Create indirect dispatch arguments buffer
33 _dispatchArgsBuffer = GPUDevice::Instance->CreateBuffer(TEXT("BitonicSortDispatchArgs"));
34 if (_dispatchArgsBuffer->Init(GPUBufferDescription::Raw(22 * 23 / 2 * sizeof(GPUDispatchIndirectArgs), GPUBufferFlags::Argument | GPUBufferFlags::UnorderedAccess)))
35 return true;
36
37 // Load asset
38 _shader = Content::LoadAsyncInternal<Shader>(TEXT("Shaders/BitonicSort"));
39 if (_shader == nullptr)
40 return true;
41#if COMPILE_WITH_DEV_ENV
42 _shader.Get()->OnReloading.Bind<BitonicSort, &BitonicSort::OnShaderReloading>(this);
43#endif
44
45 return false;
46}
47
48bool BitonicSort::setupResources()
49{

Callers

nothing calls this directly

Calls 3

RawFunction · 0.85
CreateBufferMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected