From 25a0fe4a73435fc8501d540833b35ddff14aed83 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 13 Jun 2022 15:51:52 -0700 Subject: [PATCH] Final(?) GCC 9 fixes --- Runtime/Camera/CCameraShakeData.hpp | 1 - aurora/lib/gfx/common.cpp | 7 ++++++- aurora/lib/gfx/movie_player/shader.cpp | 2 +- aurora/lib/gpu.hpp | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Runtime/Camera/CCameraShakeData.hpp b/Runtime/Camera/CCameraShakeData.hpp index e5389d487..b1a4de181 100644 --- a/Runtime/Camera/CCameraShakeData.hpp +++ b/Runtime/Camera/CCameraShakeData.hpp @@ -60,7 +60,6 @@ class CCameraShakeData { public: static const CCameraShakeData skChargedShotCameraShakeData; - constexpr CCameraShakeData() = default; constexpr CCameraShakeData(float duration, float sfxDist, u32 flags, const zeus::CVector3f& sfxPos, const CCameraShakerComponent& shaker1, const CCameraShakerComponent& shaker2, const CCameraShakerComponent& shaker3) noexcept diff --git a/aurora/lib/gfx/common.cpp b/aurora/lib/gfx/common.cpp index 3c928d418..e28777973 100644 --- a/aurora/lib/gfx/common.cpp +++ b/aurora/lib/gfx/common.cpp @@ -71,6 +71,7 @@ struct Command { return left == rhs.left && top == rhs.top && width == rhs.width && height == rhs.height && znear == rhs.znear && zfar == rhs.zfar; } + bool operator!=(const SetViewportCommand& rhs) const { return !(*this == rhs); } } setViewport; struct SetScissorCommand { uint32_t x; @@ -81,6 +82,7 @@ struct Command { bool operator==(const SetScissorCommand& rhs) const { return x == rhs.x && y == rhs.y && w == rhs.w && h == rhs.h; } + bool operator!=(const SetScissorCommand& rhs) const { return !(*this == rhs); } } setScissor; ShaderDrawCommand draw; } data; @@ -229,9 +231,12 @@ void set_scissor(uint32_t x, uint32_t y, uint32_t w, uint32_t h) noexcept { } } -bool operator==(const wgpu::Extent3D& lhs, const wgpu::Extent3D& rhs) { +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); +} void resolve_color(const ClipRect& rect, uint32_t bind, GX::TextureFormat fmt, bool clear_depth) noexcept { if (g_resolvedTextures.size() < bind + 1) { diff --git a/aurora/lib/gfx/movie_player/shader.cpp b/aurora/lib/gfx/movie_player/shader.cpp index 5aa82413f..ec1690e2e 100644 --- a/aurora/lib/gfx/movie_player/shader.cpp +++ b/aurora/lib/gfx/movie_player/shader.cpp @@ -147,7 +147,7 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4 { } wgpu::RenderPipeline create_pipeline(const State& state, [[maybe_unused]] const PipelineConfig& config) { - constexpr auto attributes = + const auto attributes = make_vertex_attributes(std::array{wgpu::VertexFormat::Float32x3, wgpu::VertexFormat::Float32x2}); const std::array vertexBuffers{make_vertex_buffer_layout(sizeof(Vert), attributes)}; const auto depthStencil = wgpu::DepthStencilState{ diff --git a/aurora/lib/gpu.hpp b/aurora/lib/gpu.hpp index 37eeefc1b..c26853884 100644 --- a/aurora/lib/gpu.hpp +++ b/aurora/lib/gpu.hpp @@ -71,7 +71,7 @@ TextureWithSampler create_render_texture(bool multisampled); namespace aurora::gpu::utils { template -static constexpr std::array +static std::array make_vertex_attributes(std::array formats) { std::array attributes; uint64_t offset = 0;