diff options
Diffstat (limited to 'src/gpu/gpu.h')
| -rw-r--r-- | src/gpu/gpu.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h index de6c5ba..9a3fd38 100644 --- a/src/gpu/gpu.h +++ b/src/gpu/gpu.h @@ -1,27 +1,23 @@ // This file is part of the 64k demo project. -// It defines the public interface for the GPU rendering system. -// Coordinates WebGPU lifecycle and draw calls. +// GPU rendering system interface. #pragma once #include "platform/platform.h" -struct PlatformState; // Forward declaration +struct PlatformState; -// GPU context bundling device, queue, and surface format struct GpuContext { WGPUDevice device; WGPUQueue queue; WGPUTextureFormat format; }; -// Basic wrapper for WebGPU buffers struct GpuBuffer { WGPUBuffer buffer; size_t size; }; -// Encapsulates a compute operation struct ComputePass { WGPUComputePipeline pipeline; WGPUBindGroup bind_group; @@ -30,7 +26,6 @@ struct ComputePass { uint32_t workgroup_size_z; }; -// Encapsulates a render operation struct RenderPass { WGPURenderPipeline pipeline; WGPUBindGroup bind_group; @@ -48,18 +43,11 @@ WGPUSurface gpu_get_surface(); const GpuContext* gpu_get_context(); -// Placeholder for GPU performance capture. -// This define can be controlled via CMake to conditionally enable profiling -// code. #define ENABLE_GPU_PERF_CAPTURE - -// Helper functions (exposed for internal/future use) struct ResourceBinding { GpuBuffer buffer; - WGPUBufferBindingType type; // e.g., WGPUBufferBindingType_Uniform, - // WGPUBufferBindingType_Storage + WGPUBufferBindingType type; }; -// Cross-platform helper for color attachment initialization inline void gpu_init_color_attachment(WGPURenderPassColorAttachment& attachment, WGPUTextureView view) { attachment.view = view; @@ -71,13 +59,11 @@ inline void gpu_init_color_attachment(WGPURenderPassColorAttachment& attachment, #endif } -// Texture creation helper struct TextureWithView { WGPUTexture texture; WGPUTextureView view; }; -// Platform-abstracted texture copy types #if defined(DEMO_CROSS_COMPILE_WIN32) using GpuTextureCopyInfo = WGPUImageCopyTexture; using GpuTextureDataLayout = WGPUTextureDataLayout; |
