------------------------------------------------------------------------------
| 946 | |
| 947 | //------------------------------------------------------------------------------ |
| 948 | void vtkWebGPUConfiguration::WriteTexture(wgpu::Texture texture, uint32_t bytesPerRow, |
| 949 | uint32_t sizeBytes, const void* data, uint32_t srcOffset /*=0*/, |
| 950 | wgpu::Origin3D dstOffset /*={0, 0, 0}*/, uint32_t dstMipLevel /*= 0*/, |
| 951 | const char* description /*= nullptr*/) |
| 952 | { |
| 953 | auto& internals = (*this->Internals); |
| 954 | if (!internals.DeviceReady) |
| 955 | { |
| 956 | vtkWarningMacro(<< "Cannot write data into texture because device is not ready."); |
| 957 | return; |
| 958 | } |
| 959 | const auto copyTexture = |
| 960 | vtkWebGPUTextureInternals::GetTexelCopyTextureInfo(texture, dstOffset, dstMipLevel); |
| 961 | |
| 962 | const auto textureDataLayout = |
| 963 | vtkWebGPUTextureInternals::GetDataLayout(texture, bytesPerRow, srcOffset); |
| 964 | |
| 965 | wgpu::Extent3D textureExtents = { texture.GetWidth(), texture.GetHeight(), |
| 966 | texture.GetDepthOrArrayLayers() }; |
| 967 | vtkVLog(this->GetGPUMemoryLogVerbosity(), |
| 968 | "Write texture {description: \"" << (description ? description : "null") |
| 969 | << "\", size: " << sizeBytes << "}"); |
| 970 | internals.Device.GetQueue().WriteTexture( |
| 971 | ©Texture, data, sizeBytes, &textureDataLayout, &textureExtents); |
| 972 | } |
| 973 | |
| 974 | //------------------------------------------------------------------------------ |
| 975 | void vtkWebGPUConfiguration::SetGPUMemoryLogVerbosity(vtkLogger::Verbosity verbosity) |
no test coverage detected