#ifndef GPU_DECOMPRESS_H
#define GPU_DECOMPRESS_H

#include "gpu_context.h"
#include "vkz_format.h"

// ── GPU Decompression Pipeline ─────────────────────────────────────
typedef struct {
  GpuContext *ctx;

  VkPipelineLayout pipeline_layout;
  VkPipeline pipeline;
  VkDescriptorSetLayout desc_layout;
  VkDescriptorPool desc_pool;
  VkDescriptorSet desc_set;

  VkBuffer input_buffer;
  VkDeviceMemory input_memory;
  VkBuffer output_buffer;
  VkDeviceMemory output_memory;
  VkBuffer meta_buffer;
  VkDeviceMemory meta_memory;
} GpuDecompressPipeline;

typedef struct {
  uint32_t block_count;
  uint32_t block_size;
  uint32_t _pad1;
  uint32_t _pad2;
} DecompressPushConstants;

// Reuse BlockMeta from gpu_compress.h

// ── Functions ──────────────────────────────────────────────────────

int gpu_decompress_init(GpuDecompressPipeline *pipe, GpuContext *ctx);

int gpu_decompress_data(GpuDecompressPipeline *pipe, const VkzArchive *archive,
                        const char *archive_path, uint8_t *output_data,
                        uint64_t output_size);

void gpu_decompress_cleanup(GpuDecompressPipeline *pipe);

#endif // GPU_DECOMPRESS_H
