summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gpu/effect.cc6
-rw-r--r--src/gpu/gpu.cc4
-rw-r--r--src/gpu/gpu.h2
3 files changed, 9 insertions, 3 deletions
diff --git a/src/gpu/effect.cc b/src/gpu/effect.cc
index 054c0ef..86390a9 100644
--- a/src/gpu/effect.cc
+++ b/src/gpu/effect.cc
@@ -176,7 +176,9 @@ void MainSequence::render_frame(float global_time, float beat, float peak,
scene_attachment.loadOp = WGPULoadOp_Clear;
scene_attachment.storeOp = WGPUStoreOp_Store;
scene_attachment.clearValue = {0, 0, 0, 1};
+#if !defined(DEMO_CROSS_COMPILE_WIN32)
scene_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED;
+#endif
WGPURenderPassDescriptor scene_desc = {.colorAttachmentCount = 1,
.colorAttachments = &scene_attachment};
WGPURenderPassEncoder scene_pass =
@@ -201,7 +203,9 @@ void MainSequence::render_frame(float global_time, float beat, float peak,
final_attachment.resolveTarget = nullptr;
final_attachment.loadOp = WGPULoadOp_Load;
final_attachment.storeOp = WGPUStoreOp_Store;
+#if !defined(DEMO_CROSS_COMPILE_WIN32)
final_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED;
+#endif
WGPURenderPassDescriptor final_desc = {
.colorAttachmentCount = 1, .colorAttachments = &final_attachment};
WGPURenderPassEncoder final_pass =
@@ -233,7 +237,9 @@ void MainSequence::render_frame(float global_time, float beat, float peak,
pp_attachment.resolveTarget = nullptr;
pp_attachment.loadOp = WGPULoadOp_Load;
pp_attachment.storeOp = WGPUStoreOp_Store;
+#if !defined(DEMO_CROSS_COMPILE_WIN32)
pp_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED;
+#endif
WGPURenderPassDescriptor pp_desc = {.colorAttachmentCount = 1,
.colorAttachments = &pp_attachment};
WGPURenderPassEncoder pp_pass =
diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc
index ebf709e..8618280 100644
--- a/src/gpu/gpu.cc
+++ b/src/gpu/gpu.cc
@@ -266,9 +266,11 @@ static void handle_request_device(WGPURequestDeviceStatus status,
}
}
static void handle_device_error(const WGPUDevice *device, WGPUErrorType type,
- WGPUStringView message, void *userdata) {
+ WGPUStringView message, void *userdata,
+ void *userdata2) {
(void)device;
(void)userdata;
+ (void)userdata2;
printf("WebGPU Error: %.*s\n", (int)message.length, message.data);
}
#endif
diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h
index eb3dd8a..062b822 100644
--- a/src/gpu/gpu.h
+++ b/src/gpu/gpu.h
@@ -32,8 +32,6 @@ using WGPUShaderSourceWGSL = WGPUShaderModuleWGSLDescriptor;
#define WGPUCallbackMode_WaitAnyOnly 0
-#define WGPU_DEPTH_SLICE_UNDEFINED (0xffffffff)
-
#else
// Native (macOS/Linux) using newer wgpu-native