Skip to content

Instantly share code, notes, and snippets.

View jeslaspravin's full-sized avatar
🕵️‍♂️

Jeslas Pravin jeslaspravin

🕵️‍♂️
View GitHub Profile
@jeslaspravin
jeslaspravin / ChainedDivergeConvergeDispatch.cpp
Created May 4, 2024 07:24
Example of chaining diverge converge with dependencies using CoPaT
ICompilerInstance::InternalRetAsync<std::vector<std::vector<DxcCompiler::DxcCompiledResults>>> DxcCompiler::dxcCompileShards(
ArrayView<std::vector<ShardPermutation>> shardPermutations, ArrayView<std::vector<CComPtr<IDxcBlobEncoding>>> shaders
)
{
auto compileShardPermutation = [&](uint32 idx, uint32 shaderIdx)
{
const ShaderSrcEntry &entry = shaderEntries[shaderIdx];
CComPtr<IDxcBlobEncoding> code = shaders[shaderIdx][idx];
const ShardPermutation &permutation = shardPermutations[shaderIdx][idx];
std::vector<std::wstring> cDefs(permutation.cDefines.size());