Skip to content

Commit 51387d7

Browse files
committed
macOS build fixes
1 parent fd1f472 commit 51387d7

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/gpu_context.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <cassert>
88
#include <cstdint>
9+
#include <cstdio>
910
#include <format>
1011
#include <stdexcept>
1112

@@ -21,11 +22,10 @@ const char* WGPUDeviceLostReasonToStr(WGPUDeviceLostReason reason)
2122
return "Undefined";
2223
case WGPUDeviceLostReason_Destroyed:
2324
return "Destroyed";
25+
default:
26+
assert(!"Unknown WGPUDeviceLostReason");
27+
return nullptr;
2428
}
25-
26-
assert(!"Unknown WGPUDeviceLostReason");
27-
28-
return nullptr;
2929
}
3030

3131
const char* WGPUErrorTypeToStr(const WGPUErrorType type)
@@ -44,11 +44,10 @@ const char* WGPUErrorTypeToStr(const WGPUErrorType type)
4444
return "Unknown";
4545
case WGPUErrorType_DeviceLost:
4646
return "DeviceLost";
47+
default:
48+
assert(!"Unknown WGPUErrorType");
49+
return nullptr;
4750
}
48-
49-
assert(!"Unknown WGPUErrorType");
50-
51-
return nullptr;
5251
}
5352

5453
void onDeviceLost(WGPUDeviceLostReason reason, const char* const message, void* /*userdata*/)
@@ -81,11 +80,10 @@ const char* WGPUQueueWorkDoneStatusToStr(const WGPUQueueWorkDoneStatus status)
8180
return "Unknown";
8281
case WGPUQueueWorkDoneStatus_DeviceLost:
8382
return "DeviceLost";
83+
default:
84+
assert(!"Unknown WGPUQueueWorkDoneStatus");
85+
return nullptr;
8486
}
85-
86-
assert(!"Unknown WGPUQueueWorkDoneStatus");
87-
88-
return nullptr;
8987
}
9088

9189
void onQueueWorkDone(WGPUQueueWorkDoneStatus status, void* /*userdata*/)

src/renderer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <array>
99
#include <cstdint>
10+
#include <cstdio>
1011
#include <limits>
1112
#include <tuple>
1213

src/renderer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ struct Renderer
4040
.maxUniformBuffersPerShaderStage = 0,
4141
.maxUniformBufferBindingSize = 0,
4242
.maxStorageBufferBindingSize = 0,
43-
.minUniformBufferOffsetAlignment = 64,
44-
.minStorageBufferOffsetAlignment = 16,
43+
.minUniformBufferOffsetAlignment = 256,
44+
.minStorageBufferOffsetAlignment = 256,
4545
.maxVertexBuffers = 1,
4646
.maxBufferSize = 24 * sizeof(float),
4747
.maxVertexAttributes = 2,

0 commit comments

Comments
 (0)