| 367 | } |
| 368 | |
| 369 | bool TextureTool::Resize(TextureData& dst, const TextureData& src, int32 dstWidth, int32 dstHeight) |
| 370 | { |
| 371 | if (src.GetMipLevels() == 0) |
| 372 | { |
| 373 | LOG(Warning, "Missing source data."); |
| 374 | return true; |
| 375 | } |
| 376 | if (src.Width == dstWidth && src.Height == dstHeight) |
| 377 | { |
| 378 | LOG(Warning, "Source data and destination dimensions are the same. Cannot perform resizing."); |
| 379 | return true; |
| 380 | } |
| 381 | if (src.Depth != 1) |
| 382 | { |
| 383 | LOG(Warning, "Resizing volume texture data is not supported."); |
| 384 | return true; |
| 385 | } |
| 386 | PROFILE_CPU(); |
| 387 | PROFILE_MEM(GraphicsTextures); |
| 388 | #if COMPILE_WITH_DIRECTXTEX |
| 389 | return ResizeDirectXTex(dst, src, dstWidth, dstHeight); |
| 390 | #elif COMPILE_WITH_STB |
| 391 | return ResizeStb(dst, src, dstWidth, dstHeight); |
| 392 | #else |
| 393 | LOG(Warning, "Resizing textures is not supported on this platform."); |
| 394 | return true; |
| 395 | #endif |
| 396 | } |
| 397 | |
| 398 | bool TextureTool::UpdateTexture(GPUContext* context, GPUTexture* texture, int32 arrayIndex, int32 mipIndex, Span<byte> data, uint32 rowPitch, uint32 slicePitch, PixelFormat dataFormat) |
| 399 | { |
no test coverage detected