summaryrefslogtreecommitdiff
path: root/src/gpu/texture_readback.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/texture_readback.h')
-rw-r--r--src/gpu/texture_readback.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gpu/texture_readback.h b/src/gpu/texture_readback.h
new file mode 100644
index 0000000..1bf770f
--- /dev/null
+++ b/src/gpu/texture_readback.h
@@ -0,0 +1,23 @@
+// GPU texture readback utility for offline processing
+// Synchronous blocking operation (waits for GPU completion)
+
+#pragma once
+
+// Protected with STRIP_ALL: only needed for dev tools, not final release
+#if !defined(STRIP_ALL)
+
+#include "platform/platform.h"
+#include <vector>
+#include <cstdint>
+
+// Read texture pixels to CPU memory (synchronous, blocking)
+// Format: BGRA8Unorm (4 bytes per pixel)
+// Returns: width * height * 4 bytes
+std::vector<uint8_t> read_texture_pixels(
+ WGPUInstance instance,
+ WGPUDevice device,
+ WGPUTexture texture,
+ int width,
+ int height);
+
+#endif // !defined(STRIP_ALL)