From c6153bb32ef15c0e7245fdf5bbf3af51104dfa35 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Wed, 5 Oct 2022 10:43:07 -0600 Subject: [PATCH] CI: fix recent build issues (#6148) Co-authored-by: Vitor K --- .ci/linux-clang-format/script.sh | 2 +- .ci/linux-mingw/docker.sh | 3 ++- .github/workflows/ci.yml | 4 +++- CMakeLists.txt | 2 +- CMakeModules/MinGWCross.cmake | 4 ++-- src/citra_qt/camera/qt_multimedia_camera.cpp | 4 ++-- src/common/vector_math.h | 4 ++-- src/core/hle/service/gsp/gsp_gpu.cpp | 5 +++-- src/core/tracer/recorder.cpp | 9 ++++----- src/video_core/regs_pipeline.h | 6 +++--- .../renderer_opengl/gl_shader_decompiler.cpp | 6 +++--- src/video_core/shader/shader_interpreter.cpp | 12 ++++++------ src/video_core/vertex_loader.cpp | 8 ++++---- 13 files changed, 36 insertions(+), 33 deletions(-) diff --git a/.ci/linux-clang-format/script.sh b/.ci/linux-clang-format/script.sh index 0dc428bc0..156ffadd0 100755 --- a/.ci/linux-clang-format/script.sh +++ b/.ci/linux-clang-format/script.sh @@ -7,7 +7,7 @@ if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dis fi # Default clang-format points to default 3.5 version one -CLANG_FORMAT=clang-format-10 +CLANG_FORMAT=clang-format-12 $CLANG_FORMAT --version if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then diff --git a/.ci/linux-mingw/docker.sh b/.ci/linux-mingw/docker.sh index 06d0957e7..e08e57163 100755 --- a/.ci/linux-mingw/docker.sh +++ b/.ci/linux-mingw/docker.sh @@ -17,7 +17,7 @@ echo 'Prepare binaries...' cd .. mkdir package -QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt5/plugins/platforms/' +QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt/plugins/platforms/' find build/ -name "citra*.exe" -exec cp {} 'package' \; # copy Qt plugins @@ -25,6 +25,7 @@ mkdir package/platforms cp "${QT_PLATFORM_DLL_PATH}/qwindows.dll" package/platforms/ cp -rv "${QT_PLATFORM_DLL_PATH}/../mediaservice/" package/ cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/ +cp -rv "${QT_PLATFORM_DLL_PATH}/../styles/" package/ rm -f package/mediaservice/*d.dll python3 .ci/linux-mingw/scan_dll.py package/*.exe package/imageformats/*.dll "package/" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 643fa1c84..c581963cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,9 @@ jobs: strategy: matrix: image: ["linux-fresh", "linux-frozen", "linux-mingw"] - container: citraemu/build-environments:${{ matrix.image }} + container: + image: citraemu/build-environments:${{ matrix.image }} + options: -u 1001 steps: - uses: actions/checkout@v3 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f40ab278..7b75b1768 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -267,7 +267,7 @@ endif() # against all the src files. This should be used before making a pull request. # ======================================================================= -set(CLANG_FORMAT_POSTFIX "-10") +set(CLANG_FORMAT_POSTFIX "-12") find_program(CLANG_FORMAT NAMES clang-format${CLANG_FORMAT_POSTFIX} clang-format diff --git a/CMakeModules/MinGWCross.cmake b/CMakeModules/MinGWCross.cmake index 7bcc5a3da..a9bc0c85a 100644 --- a/CMakeModules/MinGWCross.cmake +++ b/CMakeModules/MinGWCross.cmake @@ -10,8 +10,8 @@ SET(SDL2_PATH ${MINGW_PREFIX}) SET(MINGW_TOOL_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-) # Specify the cross compiler -SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc-posix) -SET(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++-posix) +SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc) +SET(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++) SET(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}windres) # Mingw tools diff --git a/src/citra_qt/camera/qt_multimedia_camera.cpp b/src/citra_qt/camera/qt_multimedia_camera.cpp index 0c3484c36..5b7d497a2 100644 --- a/src/citra_qt/camera/qt_multimedia_camera.cpp +++ b/src/citra_qt/camera/qt_multimedia_camera.cpp @@ -16,8 +16,8 @@ namespace Camera { -QList QtCameraSurface::supportedPixelFormats([ - [maybe_unused]] QAbstractVideoBuffer::HandleType handleType) const { +QList QtCameraSurface::supportedPixelFormats( + [[maybe_unused]] QAbstractVideoBuffer::HandleType handleType) const { return QList() << QVideoFrame::Format_ARGB32 << QVideoFrame::Format_ARGB32_Premultiplied << QVideoFrame::Format_RGB32 << QVideoFrame::Format_RGB24 << QVideoFrame::Format_RGB565 diff --git a/src/common/vector_math.h b/src/common/vector_math.h index 627baeb6d..4ce3be8f5 100644 --- a/src/common/vector_math.h +++ b/src/common/vector_math.h @@ -690,8 +690,8 @@ template // linear interpolation via float: 0.0=begin, 1.0=end template -[[nodiscard]] constexpr decltype(X{} * float{} + X{} * float{}) Lerp(const X& begin, const X& end, - const float t) { +[[nodiscard]] constexpr decltype(X{} * float{} + X{} * float{}) + Lerp(const X& begin, const X& end, const float t) { return begin * (1.f - t) + end * t; } diff --git a/src/core/hle/service/gsp/gsp_gpu.cpp b/src/core/hle/service/gsp/gsp_gpu.cpp index acdbd712b..b705ee48d 100644 --- a/src/core/hle/service/gsp/gsp_gpu.cpp +++ b/src/core/hle/service/gsp/gsp_gpu.cpp @@ -436,8 +436,9 @@ void GSP_GPU::SignalInterruptForThread(InterruptId interrupt_id, u32 thread_id) // executing any GSP commands, only waiting on the event. // TODO(Subv): The real GSP module triggers PDC0 after updating both the top and bottom // screen, it is currently unknown what PDC1 does. - int screen_id = - (interrupt_id == InterruptId::PDC0) ? 0 : (interrupt_id == InterruptId::PDC1) ? 1 : -1; + int screen_id = (interrupt_id == InterruptId::PDC0) ? 0 + : (interrupt_id == InterruptId::PDC1) ? 1 + : -1; if (screen_id != -1) { FrameBufferUpdate* info = GetFrameBufferInfo(thread_id, screen_id); if (info->is_dirty) { diff --git a/src/core/tracer/recorder.cpp b/src/core/tracer/recorder.cpp index 73cacb47f..ca24ba149 100644 --- a/src/core/tracer/recorder.cpp +++ b/src/core/tracer/recorder.cpp @@ -190,11 +190,10 @@ void Recorder::MemoryAccessed(const u8* data, u32 size, u32 physical_address) { template void Recorder::RegisterWritten(u32 physical_address, T value) { StreamElement element = {{RegisterWrite}}; - element.data.register_write.size = - (sizeof(T) == 1) ? CTRegisterWrite::SIZE_8 - : (sizeof(T) == 2) ? CTRegisterWrite::SIZE_16 - : (sizeof(T) == 4) ? CTRegisterWrite::SIZE_32 - : CTRegisterWrite::SIZE_64; + element.data.register_write.size = (sizeof(T) == 1) ? CTRegisterWrite::SIZE_8 + : (sizeof(T) == 2) ? CTRegisterWrite::SIZE_16 + : (sizeof(T) == 4) ? CTRegisterWrite::SIZE_32 + : CTRegisterWrite::SIZE_64; element.data.register_write.physical_address = physical_address; element.data.register_write.value = value; diff --git a/src/video_core/regs_pipeline.h b/src/video_core/regs_pipeline.h index a693d7a05..8ffce9dee 100644 --- a/src/video_core/regs_pipeline.h +++ b/src/video_core/regs_pipeline.h @@ -77,9 +77,9 @@ struct PipelineRegs { } u32 GetElementSizeInBytes(std::size_t n) const { - return (GetFormat(n) == VertexAttributeFormat::FLOAT) - ? 4 - : (GetFormat(n) == VertexAttributeFormat::SHORT) ? 2 : 1; + return (GetFormat(n) == VertexAttributeFormat::FLOAT) ? 4 + : (GetFormat(n) == VertexAttributeFormat::SHORT) ? 2 + : 1; } u32 GetStride(std::size_t n) const { diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index b285f4d78..19634babe 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -630,9 +630,9 @@ private: std::string dest_reg = (instr.mad.dest.Value() < 0x10) ? outputreg_getter(static_cast(instr.mad.dest.Value().GetIndex())) - : (instr.mad.dest.Value() < 0x20) - ? "reg_tmp" + std::to_string(instr.mad.dest.Value().GetIndex()) - : ""; + : (instr.mad.dest.Value() < 0x20) + ? "reg_tmp" + std::to_string(instr.mad.dest.Value().GetIndex()) + : ""; if (sanitize_mul) { SetDest(swizzle, dest_reg, diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp index a4e0d41b5..c931275e6 100644 --- a/src/video_core/shader/shader_interpreter.cpp +++ b/src/video_core/shader/shader_interpreter.cpp @@ -174,9 +174,9 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData float24* dest = (instr.common.dest.Value() < 0x10) ? &state.registers.output[instr.common.dest.Value().GetIndex()][0] - : (instr.common.dest.Value() < 0x20) - ? &state.registers.temporary[instr.common.dest.Value().GetIndex()][0] - : dummy_vec4_float24; + : (instr.common.dest.Value() < 0x20) + ? &state.registers.temporary[instr.common.dest.Value().GetIndex()][0] + : dummy_vec4_float24; debug_data.max_opdesc_id = std::max(debug_data.max_opdesc_id, 1 + instr.common.operand_desc_id); @@ -517,9 +517,9 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData float24* dest = (instr.mad.dest.Value() < 0x10) ? &state.registers.output[instr.mad.dest.Value().GetIndex()][0] - : (instr.mad.dest.Value() < 0x20) - ? &state.registers.temporary[instr.mad.dest.Value().GetIndex()][0] - : dummy_vec4_float24; + : (instr.mad.dest.Value() < 0x20) + ? &state.registers.temporary[instr.mad.dest.Value().GetIndex()][0] + : dummy_vec4_float24; Record(debug_data, iteration, src1); Record(debug_data, iteration, src2); diff --git a/src/video_core/vertex_loader.cpp b/src/video_core/vertex_loader.cpp index 7c65defc5..64848ebaf 100644 --- a/src/video_core/vertex_loader.cpp +++ b/src/video_core/vertex_loader.cpp @@ -88,10 +88,10 @@ void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, vertex_attribute_elements[i] * ((vertex_attribute_formats[i] == PipelineRegs::VertexAttributeFormat::FLOAT) ? 4 - : (vertex_attribute_formats[i] == - PipelineRegs::VertexAttributeFormat::SHORT) - ? 2 - : 1)); + : (vertex_attribute_formats[i] == + PipelineRegs::VertexAttributeFormat::SHORT) + ? 2 + : 1)); } switch (vertex_attribute_formats[i]) {