| 36 | |
| 37 | namespace { |
| 38 | void addTextureToModel( |
| 39 | Model& model, |
| 40 | int32_t wrapS, |
| 41 | int32_t wrapT, |
| 42 | int32_t width, |
| 43 | int32_t height, |
| 44 | int32_t channels, |
| 45 | const std::vector<uint8_t>& data) { |
| 46 | Image& image = model.images.emplace_back(); |
| 47 | image.pAsset.emplace(); |
| 48 | image.pAsset->width = width; |
| 49 | image.pAsset->height = height; |
| 50 | image.pAsset->channels = channels; |
| 51 | image.pAsset->bytesPerChannel = 1; |
| 52 | |
| 53 | std::vector<std::byte>& imageData = image.pAsset->pixelData; |
| 54 | imageData.resize(data.size()); |
| 55 | std::memcpy(imageData.data(), data.data(), data.size()); |
| 56 | |
| 57 | Sampler& sampler = model.samplers.emplace_back(); |
| 58 | sampler.wrapS = wrapS; |
| 59 | sampler.wrapT = wrapT; |
| 60 | |
| 61 | Texture& texture = model.textures.emplace_back(); |
| 62 | texture.sampler = static_cast<int32_t>(model.samplers.size() - 1); |
| 63 | texture.source = static_cast<int32_t>(model.images.size() - 1); |
| 64 | } |
| 65 | |
| 66 | template <typename T, bool Normalized> |
| 67 | void verifyTextureTransformConstruction( |
no test coverage detected