diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-17 09:08:25 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-17 09:08:25 +0100 |
| commit | cd5c2ee728fcfc5c0bf81ba51899fa7369d0d1e2 (patch) | |
| tree | 985785e7598dd767d635e21304797baf53573fae /src/gpu/gpu_stub.cc | |
| parent | 001939ca8e2c582650d3cd77d0cd0eabffc50ed2 (diff) | |
feat: Rename GPU stub and headless files and update references
Diffstat (limited to 'src/gpu/gpu_stub.cc')
| -rw-r--r-- | src/gpu/gpu_stub.cc | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/gpu/gpu_stub.cc b/src/gpu/gpu_stub.cc new file mode 100644 index 0000000..d889666 --- /dev/null +++ b/src/gpu/gpu_stub.cc @@ -0,0 +1,66 @@ +// Stub GPU implementation for size measurement builds. +// All functions are no-ops. Binary compiles but does NOT run. +// This file is only compiled when STRIP_EXTERNAL_LIBS is defined. + +#if defined(STRIP_EXTERNAL_LIBS) + +#include "gpu.h" +#include "platform/stub_types.h" + +GpuBuffer gpu_create_buffer(WGPUDevice device, size_t size, uint32_t usage, + const void* data) { + (void)device; + (void)size; + (void)usage; + (void)data; + return {nullptr, 0}; +} + +RenderPass gpu_create_render_pass(WGPUDevice device, WGPUTextureFormat format, + const char* shader_code, + ResourceBinding* bindings, int num_bindings) { + (void)device; + (void)format; + (void)shader_code; + (void)bindings; + (void)num_bindings; + return {nullptr, nullptr, 0, 0}; +} + +ComputePass gpu_create_compute_pass(WGPUDevice device, const char* shader_code, + ResourceBinding* bindings, + int num_bindings) { + (void)device; + (void)shader_code; + (void)bindings; + (void)num_bindings; + return {nullptr, nullptr, 0, 0, 0}; +} + +void gpu_init(PlatformState* platform_state) { + (void)platform_state; +} + +void gpu_draw(float audio_peak, float aspect_ratio, float time, float beat_time, + float beat_phase) { + (void)audio_peak; + (void)aspect_ratio; + (void)time; + (void)beat_time; + (void)beat_phase; +} + +void gpu_resize(int width, int height) { + (void)width; + (void)height; +} + +void gpu_shutdown() { +} + +const GpuContext* gpu_get_context() { + static GpuContext ctx = {nullptr, nullptr, WGPUTextureFormat_BGRA8Unorm}; + return &ctx; +} + +#endif // STRIP_EXTERNAL_LIBS |
