MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / convert_underlying_data_stride

Function convert_underlying_data_stride

framework/gltf_loader.cpp:271–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269};
270
271inline std::vector<uint8_t> convert_underlying_data_stride(const std::vector<uint8_t> &src_data, uint32_t src_stride, uint32_t dst_stride)
272{
273 auto elem_count = to_u32(src_data.size()) / src_stride;
274
275 std::vector<uint8_t> result(elem_count * dst_stride);
276
277 for (uint32_t idxSrc = 0, idxDst = 0;
278 idxSrc < src_data.size() && idxDst < result.size();
279 idxSrc += src_stride, idxDst += dst_stride)
280 {
281 std::copy(src_data.begin() + idxSrc, src_data.begin() + idxSrc + src_stride, result.begin() + idxDst);
282 }
283
284 return result;
285}
286
287inline void upload_image_to_gpu(vkb::core::CommandBufferC &command_buffer, vkb::core::BufferC &staging_buffer, sg::Image &image)
288{

Callers 2

load_sceneMethod · 0.85
load_modelMethod · 0.85

Calls 3

to_u32Function · 0.85
sizeMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected