Skip to content

Commit

Permalink
Logging wgpuBufferMapAsync.
Browse files Browse the repository at this point in the history
  • Loading branch information
kugimasa committed Aug 21, 2023
1 parent ce4ab8d commit dc06d75
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/include/utils/save_texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ bool inline saveTexture(const std::filesystem::path &path, wgpu::Device device,
auto callbackHandle = pixelBuffer.mapAsync(MapMode::Read, 0, pixelBufferDesc.size, [&](BufferMapAsyncStatus status) {
if (status != BufferMapAsyncStatus::Success) {
success = false;
std::cout << "PixelBuffer MapAsync error: type " << status << std::endl;
} else {
const auto *pixelData = (const unsigned char *) pixelBuffer.getConstMappedRange(0, pixelBufferDesc.size);
int writeSuccess = stbi_write_png(path.string().c_str(), (int) width, (int) height, (int) channels, pixelData, (int) paddedBytesPerRow);
Expand Down

0 comments on commit dc06d75

Please sign in to comment.