| 36 | static const char kShaderFilename[] = "Utils/Algorithm/BitonicSort.cs.slang"; |
| 37 | |
| 38 | BitonicSort::BitonicSort(ref<Device> pDevice) : mpDevice(pDevice) |
| 39 | { |
| 40 | #if !FALCOR_NVAPI_AVAILABLE |
| 41 | FALCOR_THROW("BitonicSort requires NVAPI. See installation instructions in README."); |
| 42 | #endif |
| 43 | mSort.pState = ComputeState::create(mpDevice); |
| 44 | |
| 45 | // Create shaders |
| 46 | DefineList defines; |
| 47 | defines.add("CHUNK_SIZE", "256"); // Dummy values just so we can get reflection data. We'll set the actual values in execute(). |
| 48 | defines.add("GROUP_SIZE", "256"); |
| 49 | mSort.pProgram = Program::createCompute(mpDevice, kShaderFilename, "main", defines); |
| 50 | mSort.pState->setProgram(mSort.pProgram); |
| 51 | mSort.pVars = ProgramVars::create(mpDevice, mSort.pProgram.get()); |
| 52 | } |
| 53 | |
| 54 | bool BitonicSort::execute(RenderContext* pRenderContext, ref<Buffer> pData, uint32_t totalSize, uint32_t chunkSize, uint32_t groupSize) |
| 55 | { |
nothing calls this directly
no test coverage detected