Reimplement GXCopyTex; simplify assertions

This commit is contained in:
2022-08-09 02:05:33 -04:00
parent 893cabe55a
commit c060e1da6b
24 changed files with 241 additions and 394 deletions

View File

@@ -268,8 +268,7 @@ void create_copy_bind_group() {
}
static void error_callback(WGPUErrorType type, char const* message, void* userdata) {
Log.report(LOG_FATAL, FMT_STRING("WebGPU error {}: {}"), magic_enum::enum_name(static_cast<WGPUErrorType>(type)),
message);
FATAL("WebGPU error {}: {}", static_cast<int>(type), message);
}
#ifndef WEBGPU_DAWN
@@ -378,9 +377,7 @@ bool initialize(AuroraBackend auroraBackend) {
.label = "Surface",
};
g_surface = wgpu::Surface::Acquire(wgpuInstanceCreateSurface(g_instance.Get(), &surfaceDescriptor));
if (!g_surface) {
Log.report(LOG_FATAL, FMT_STRING("Failed to initialize surface"));
}
ASSERT(g_surface, "Failed to initialize surface");
const WGPURequestAdapterOptions options{
.compatibleSurface = g_surface.Get(),
.powerPreference = WGPUPowerPreference_HighPerformance,

View File

@@ -2,3 +2,8 @@
#ifdef EMSCRIPTEN
#include <emscripten.h>
#endif
static inline bool operator==(const wgpu::Extent3D& lhs, const wgpu::Extent3D& rhs) {
return lhs.width == rhs.width && lhs.height == rhs.height && lhs.depthOrArrayLayers == rhs.depthOrArrayLayers;
}
static inline bool operator!=(const wgpu::Extent3D& lhs, const wgpu::Extent3D& rhs) { return !(lhs == rhs); }