psemek/libs/wgpu/source/chained_struct.cpp
lisyarus 45fbc7399c
All checks were successful
Run tests / Run tests (push) Successful in 7m47s
Update to wgpu-native v29.0.1.1
2026-07-10 17:40:56 +03:00

33 lines
527 B
C++

#include <psemek/wgpu/chained_struct.hpp>
#include <psemek/wgpu/external/webgpu.h>
namespace psemek::wgpu::detail
{
void * fill_chain(std::vector<chained_struct> const & chain)
{
WGPUChainedStruct * first = nullptr;
WGPUChainedStruct * current = nullptr;
for (auto const & s : chain)
{
auto p = (WGPUChainedStruct *)s.ptr();
if (!first)
{
first = p;
current = p;
}
else
{
current->next = p;
current = p;
}
}
if (current)
current->next = nullptr;
return first;
}
}