From c5d36b4015818546d2e8034d899b0d93c21c711c Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Thu, 25 Sep 2025 11:44:14 -0300 Subject: [PATCH 1/9] [ci] license-header.sh: Make it POSIX-compliant! Signed-off-by: Caio Oliveira --- .ci/license-header.sh | 281 +++++++++++++++++++++++++----------------- 1 file changed, 171 insertions(+), 110 deletions(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 3d4929d1c1..9e70188971 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -1,145 +1,206 @@ #!/bin/sh -e -HEADER="$(cat "$PWD/.ci/license/header.txt")" -HEADER_HASH="$(cat "$PWD/.ci/license/header-hash.txt")" +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later -echo "Getting branch changes" +COPYRIGHT_YEAR="2025" +COPYRIGHT_OWNER="Eden Emulator Project" +COPYRIGHT_LICENSE="GPL-3.0-or-later" -# BRANCH=`git rev-parse --abbrev-ref HEAD` -# COMMITS=`git log ${BRANCH} --not master --pretty=format:"%h"` -# RANGE="${COMMITS[${#COMMITS[@]}-1]}^..${COMMITS[0]}" -# FILES=`git diff-tree --no-commit-id --name-only ${RANGE} -r` +if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then + echo + echo "license-header.sh: Eden License Headers Accreditation Script" + echo + echo "This script checks and optionally fixes license headers in source, CMake and shell script files." + echo + echo "Environment Variables:" + echo " FIX=true | Automatically add the correct license headers to offending files." + echo " UPDATE=true | Automatically update current license headers of offending files." + echo " COMMIT=true | If FIX=true, commit the changes automatically." + echo + echo "Usage Examples:" + echo " # Just check headers (will fail if headers are missing)" + echo " .ci/license-header.sh" + echo + echo " # Fix headers only" + echo " FIX=true .ci/license-header.sh" + echo + echo " # Update headers only" + echo " # if COPYRIGHT_OWNER is '$COPYRIGHT_OWNER'" + echo " # or else will have 'FIX=true' behavior)" + echo " UPDATE=true .ci/license-header.sh" + echo + echo " # Fix headers and commit changes" + echo " FIX=true COMMIT=true .ci/license-header.sh" + echo + echo " # Update headers and commit changes" + echo " # if COPYRIGHT_OWNER is '$COPYRIGHT_OWNER'" + echo " # or else will have 'FIX=true' behavior)" + echo " UPDATE=true COMMIT=true .ci/license-header.sh" + exit 0 +fi -BASE=`git merge-base master HEAD` -FILES=`git diff --name-only $BASE` +SRC_FILES="" +OTHER_FILES="" -#FILES=$(git diff --name-only master) +BASE=$(git merge-base master HEAD) +if git diff --quiet "$BASE"..HEAD; then + echo + echo "license-header.sh: No commits on this branch different from master." + exit 0 +fi +FILES=$(git diff --name-only "$BASE") -echo "Done" - -check_header() { - CONTENT="`head -n3 < $1`" - case "$CONTENT" in - "$HEADER"*) ;; - *) BAD_FILES="$BAD_FILES $1" ;; - esac +echo_header() { + COMMENT_TYPE="$1" + echo "$COMMENT_TYPE SPDX-FileCopyrightText: Copyright $COPYRIGHT_YEAR $COPYRIGHT_OWNER" + echo "$COMMENT_TYPE SPDX-License-Identifier: $COPYRIGHT_LICENSE" } -check_cmake_header() { - CONTENT="`head -n3 < $1`" - - case "$CONTENT" in - "$HEADER_HASH"*) ;; - *) - BAD_CMAKE="$BAD_CMAKE $1" ;; - esac -} for file in $FILES; do [ -f "$file" ] || continue - if [ `basename -- "$file"` = "CMakeLists.txt" ]; then - check_cmake_header "$file" + case "$(basename "$file")" in + CMakeLists.txt) + COMMENT_TYPE="#" ;; + *) + EXT="${file##*.}" + case "$EXT" in + kts|kt|cpp|h) COMMENT_TYPE="//" ;; + cmake|sh|ps1) COMMENT_TYPE="#" ;; + *) continue ;; + esac ;; + esac + + HEADER=$(echo_header "$COMMENT_TYPE") + HEAD_LINES=$(head -n5 "$file") + + CORRECT_COPYRIGHT=$(echo "$HEAD_LINES" | awk \ + -v line1="$(echo "$HEADER" | sed -n '1p')" \ + -v line2="$(echo "$HEADER" | sed -n '2p')" \ + '($0==line1){getline; if($0==line2){f=1}else{f=0}} END{print (f?f:0)}') + + if [ "$CORRECT_COPYRIGHT" != "1" ]; then + case "$COMMENT_TYPE" in + "//") SRC_FILES="$SRC_FILES $file" ;; + "#") OTHER_FILES="$OTHER_FILES $file" ;; + esac + fi +done + +if [ -z "$SRC_FILES" ] && [ -z "$OTHER_FILES" ]; then + echo + echo "license-header.sh: All good!" + exit 0 +fi + +for TYPE in "SRC" "OTHER"; do + if [ "$TYPE" = "SRC" ] && [ -n "$SRC_FILES" ]; then + FILES_LIST="$SRC_FILES" + COMMENT_TYPE="//" + DESC="Source" + elif [ "$TYPE" = "OTHER" ] && [ -n "$OTHER_FILES" ]; then + FILES_LIST="$OTHER_FILES" + COMMENT_TYPE="#" + DESC="CMake and shell script" + else continue fi - EXTENSION="${file##*.}" - case "$EXTENSION" in - kts|kt|cpp|h) - check_header "$file" - ;; - cmake) - check_cmake_header "$file" - ;; - esac + echo + echo "------------------------------------------------------------" + echo "$DESC files" + echo "------------------------------------------------------------" + echo + echo " The following files contain incorrect license headers:" + for file in $FILES_LIST; do + echo " - $file" + done + + echo + echo " The correct license header to be added to all affected" + echo " '$DESC' files is:" + echo + echo "=== BEGIN ===" + echo_header "$COMMENT_TYPE" + echo "=== END ===" done -if [ "$BAD_FILES" = "" ] && [ "$BAD_CMAKE" = "" ]; then - echo - echo "All good." - - exit -fi - -if [ "$BAD_FILES" != "" ]; then - echo "The following source files have incorrect license headers:" - echo - - for file in $BAD_FILES; do echo $file; done - - cat << EOF - -The following license header should be added to the start of all offending SOURCE files: - -=== BEGIN === -$HEADER -=== END === - -EOF - -fi - -if [ "$BAD_CMAKE" != "" ]; then - echo "The following CMake files have incorrect license headers:" - echo - - for file in $BAD_CMAKE; do echo $file; done - - cat << EOF - -The following license header should be added to the start of all offending CMake files: - -=== BEGIN === -$HEADER_HASH -=== END === - -EOF - -fi - cat << EOF -If some of the code in this PR is not being contributed by the original author, -the files which have been exclusively changed by that code can be ignored. -If this happens, this PR requirement can be bypassed once all other files are addressed. + +------------------------------------------------------------ + + If some of the code in this pull request was not contributed by the original + author, the files that have been modified exclusively by that code can be + safely ignored. In such cases, this PR requirement may be bypassed once all + other files have been reviewed and addressed. EOF -if [ "$FIX" = "true" ]; then - echo - echo "FIX set to true. Fixing headers." +TMP_DIR=$(mktemp -d /tmp/license-header.XXXXXX) || exit 1 +if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then echo + echo "license-header.sh: FIX set to true, fixing headers..." - for file in $BAD_FILES; do - cat $file > $file.bak + for file in $SRC_FILES $OTHER_FILES; do + BASENAME=$(basename "$file") - cat .ci/license/header.txt > $file - echo >> $file - cat $file.bak >> $file + case "$BASENAME" in + CMakeLists.txt) COMMENT_TYPE="#" ;; + *) + EXT="${file##*.}" + case "$EXT" in + kts|kt|cpp|h) COMMENT_TYPE="//" ;; + cmake|sh|ps1) COMMENT_TYPE="#" ;; + *) continue ;; + esac + ;; + esac - rm $file.bak + TMP="$TMP_DIR/$BASENAME.tmp" + UPDATED=0 + cp -p "$file" "$TMP" + > "$TMP" - git add $file + # this logic is bit hacky but sed don't work well with $VARIABLES + # it's this or complete remove this logic and keep only the old way + if [ "$UPDATE" = "true" ]; then + while IFS= read -r line || [ -n "$line" ]; do + if [ "$UPDATED" -eq 0 ] && echo "$line" | grep "$COPYRIGHT_OWNER" >/dev/null 2>&1; then + echo_header "$COMMENT_TYPE" >> "$TMP" + IFS= read -r _ || true + UPDATED=1 + else + echo "$line" >> "$TMP" + fi + done < "$file" + fi + + if [ "$UPDATED" -eq 0 ]; then + { + echo_header "$COMMENT_TYPE" + echo + cat "$TMP" + } > "$file" + else + mv "$TMP" "$file" + fi + + git add "$file" done - for file in $BAD_CMAKE; do - cat $file > $file.bak + rm -rf "$TMP_DIR" - cat .ci/license/header-hash.txt > $file - echo >> $file - cat $file.bak >> $file - - rm $file.bak - - git add $file - done - echo "License headers fixed." + echo + echo "license-header.sh: License headers fixed!" if [ "$COMMIT" = "true" ]; then echo - echo "COMMIT set to true. Committing changes." + echo "license-header.sh: COMMIT set to true, committing changes..." + + git commit -m "[license] Fix license headers [script]" + echo - - git commit -m "Fix license headers" - - echo "Changes committed. You may now push." + echo "license-header.sh: Changes committed. You may now push." fi else exit 1 From b7e23ff51e8056ce13f2fcd968702f51affe882b Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 26 Sep 2025 19:38:00 -0400 Subject: [PATCH 2/9] [ci] license-header.sh: add file exclusion capability Signed-off-by: crueter --- .ci/license-header.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 9e70188971..870555d533 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -3,6 +3,10 @@ # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later +# specify full path if dupes may exist +EXCLUDE_FILES="CPM.cmake CPMUtil.cmake GetSCMRev.cmake" +EXCLUDE_FILES=$(echo "$EXCLUDE_FILES" | sed 's/ /|/g') + COPYRIGHT_YEAR="2025" COPYRIGHT_OWNER="Eden Emulator Project" COPYRIGHT_LICENSE="GPL-3.0-or-later" @@ -49,7 +53,7 @@ if git diff --quiet "$BASE"..HEAD; then echo "license-header.sh: No commits on this branch different from master." exit 0 fi -FILES=$(git diff --name-only "$BASE") +FILES=$(git diff --name-only "$BASE" | grep -E -v "$EXCLUDE_FILES") echo_header() { COMMENT_TYPE="$1" From 17899b18c158ce030ec795929839ba9e11641434 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Sun, 28 Sep 2025 19:52:28 -0300 Subject: [PATCH 3/9] [ci] license-header.sh: Fix some shellcheck warnings Signed-off-by: Caio Oliveira --- .ci/license-header.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 870555d533..ee775db01e 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -140,10 +140,10 @@ cat << EOF other files have been reviewed and addressed. EOF -TMP_DIR=$(mktemp -d /tmp/license-header.XXXXXX) || exit 1 +TMP_DIR=$(mktemp -d "/tmp/license-header.XXXXXX") || exit 1 if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then echo - echo "license-header.sh: FIX set to true, fixing headers..." + echo "license-header.sh: FIX or UPDATE set to true, fixing headers..." for file in $SRC_FILES $OTHER_FILES; do BASENAME=$(basename "$file") @@ -163,7 +163,7 @@ if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then TMP="$TMP_DIR/$BASENAME.tmp" UPDATED=0 cp -p "$file" "$TMP" - > "$TMP" + : > "$TMP" # this logic is bit hacky but sed don't work well with $VARIABLES # it's this or complete remove this logic and keep only the old way From 3c6ef765af9b946240cedf053e593c0fc86a3f01 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 9 Oct 2025 21:37:27 +0200 Subject: [PATCH 4/9] revert [vk] Fast UBO: fix tracking, resize heuristics, add debug guard (#2695) (#2706) revert [vk] Fast UBO: fix tracking, resize heuristics, add debug guard (#2695) Well, stuff showed up after testing phase, that showed us this change break SMO and some mods after being merged directly into master, we will keep stuying why happens this and add a better handling later. Co-authored-by: Ribbit Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2695 Reviewed-by: CamilleLaVey Co-authored-by: Ribbit Co-committed-by: Ribbit Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2706 Co-authored-by: CamilleLaVey Co-committed-by: CamilleLaVey --- src/core/device_memory_manager.h | 6 --- src/core/device_memory_manager.inc | 26 ------------ src/video_core/buffer_cache/buffer_cache.h | 42 +++++++++---------- .../buffer_cache/buffer_cache_base.h | 5 +-- .../vk_staging_buffer_pool.cpp | 26 +++++------- .../renderer_vulkan/vk_staging_buffer_pool.h | 4 -- 6 files changed, 33 insertions(+), 76 deletions(-) diff --git a/src/core/device_memory_manager.h b/src/core/device_memory_manager.h index 192c6e5c01..6dcf7bb228 100644 --- a/src/core/device_memory_manager.h +++ b/src/core/device_memory_manager.h @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -112,9 +109,6 @@ public: void ReadBlock(DAddr address, void* dest_pointer, size_t size); void ReadBlockUnsafe(DAddr address, void* dest_pointer, size_t size); -#ifdef YUZU_DEBUG - bool ReadBlockFastChecked(DAddr address, void* dest_pointer, size_t size); -#endif void WriteBlock(DAddr address, const void* src_pointer, size_t size); void WriteBlockUnsafe(DAddr address, const void* src_pointer, size_t size); diff --git a/src/core/device_memory_manager.inc b/src/core/device_memory_manager.inc index 3629579c09..52dff5df9a 100644 --- a/src/core/device_memory_manager.inc +++ b/src/core/device_memory_manager.inc @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -470,29 +467,6 @@ void DeviceMemoryManager::ReadBlockUnsafe(DAddr address, void* dest_poin }); } -#ifdef YUZU_DEBUG -template -bool DeviceMemoryManager::ReadBlockFastChecked(DAddr address, void* dest_pointer, - size_t size) { - bool success = true; - WalkBlock( - address, size, - [&](size_t copy_amount, DAddr current_vaddr) { - LOG_CRITICAL(Render, "DeviceMemory OOB/unmapped: addr=0x{:x} size={}", current_vaddr, - size); - std::memset(dest_pointer, 0, copy_amount); - success = false; - }, - [&](size_t copy_amount, const u8* const src_ptr) { - std::memcpy(dest_pointer, src_ptr, copy_amount); - }, - [&](const std::size_t copy_amount) { - dest_pointer = static_cast(dest_pointer) + copy_amount; - }); - return success; -} -#endif - template void DeviceMemoryManager::WriteBlockUnsafe(DAddr address, const void* src_pointer, size_t size) { diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 388c8034c5..5223afe937 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -386,10 +386,11 @@ void BufferCache

::BindHostComputeBuffers() { template void BufferCache

::SetUniformBuffersState(const std::array& mask, const UniformBufferSizes* sizes) { - const bool mask_changed = channel_state->enabled_uniform_buffer_masks != mask; - if (mask_changed) { - channel_state->fast_bound_uniform_buffers.fill(0); - if constexpr (HAS_PERSISTENT_UNIFORM_BUFFER_BINDINGS) { + if constexpr (HAS_PERSISTENT_UNIFORM_BUFFER_BINDINGS) { + if (channel_state->enabled_uniform_buffer_masks != mask) { + if constexpr (IS_OPENGL) { + channel_state->fast_bound_uniform_buffers.fill(0); + } channel_state->dirty_uniform_buffers.fill(~u32{0}); channel_state->uniform_buffer_binding_sizes.fill({}); } @@ -805,7 +806,7 @@ void BufferCache

::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32 channel_state->uniform_buffer_binding_sizes[stage][binding_index] != size; if (should_fast_bind) { // We only have to bind when the currently bound buffer is not the fast version - channel_state->fast_bound_uniform_buffers[stage] |= 1u << binding_index; + channel_state->fast_bound_uniform_buffers[stage] |= 1U << binding_index; channel_state->uniform_buffer_binding_sizes[stage][binding_index] = size; runtime.BindFastUniformBuffer(stage, binding_index, size); } @@ -814,22 +815,13 @@ void BufferCache

::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32 return; } } - channel_state->fast_bound_uniform_buffers[stage] |= 1u << binding_index; - channel_state->uniform_buffer_binding_sizes[stage][binding_index] = size; + if constexpr (IS_OPENGL) { + channel_state->fast_bound_uniform_buffers[stage] |= 1U << binding_index; + channel_state->uniform_buffer_binding_sizes[stage][binding_index] = size; + } // Stream buffer path to avoid stalling on non-Nvidia drivers or Vulkan const std::span span = runtime.BindMappedUniformBuffer(stage, binding_index, size); -#ifdef YUZU_DEBUG - ASSERT(binding_index < NUM_GRAPHICS_UNIFORM_BUFFERS); - ASSERT(span.size() >= size && "UBO stream span too small"); - if (!device_memory.ReadBlockFastChecked(device_addr, span.data(), size)) { - LOG_CRITICAL(Render, "DeviceMemory OOB/unmapped: addr=0x{:x} size={}", device_addr, size); - channel_state->fast_bound_uniform_buffers[stage] &= ~(1u << binding_index); - ASSERT(false); - return; - } -#else device_memory.ReadBlockUnsafe(device_addr, span.data(), size); -#endif return; } // Classic cached path @@ -838,8 +830,7 @@ void BufferCache

::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32 } // Skip binding if it's not needed and if the bound buffer is not the fast version // This exists to avoid instances where the fast buffer is bound and a GPU write happens - const bool was_fast_bound = HasFastUniformBufferBound(stage, binding_index); - needs_bind |= was_fast_bound; + needs_bind |= HasFastUniformBufferBound(stage, binding_index); if constexpr (HAS_PERSISTENT_UNIFORM_BUFFER_BINDINGS) { needs_bind |= channel_state->uniform_buffer_binding_sizes[stage][binding_index] != size; } @@ -848,6 +839,9 @@ void BufferCache

::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32 } const u32 offset = buffer.Offset(device_addr); if constexpr (IS_OPENGL) { + // Fast buffer will be unbound + channel_state->fast_bound_uniform_buffers[stage] &= ~(1U << binding_index); + // Mark the index as dirty if offset doesn't match const bool is_copy_bind = offset != 0 && !runtime.SupportsNonZeroUniformOffset(); channel_state->dirty_uniform_buffers[stage] |= (is_copy_bind ? 1U : 0U) << index; @@ -861,7 +855,6 @@ void BufferCache

::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32 } else { runtime.BindUniformBuffer(buffer, offset, size); } - channel_state->fast_bound_uniform_buffers[stage] &= ~(1u << binding_index); } template @@ -1796,7 +1789,12 @@ std::span BufferCache

::ImmediateBuffer(size_t wanted_capacity) { template bool BufferCache

::HasFastUniformBufferBound(size_t stage, u32 binding_index) const noexcept { - return ((channel_state->fast_bound_uniform_buffers[stage] >> binding_index) & 1u) != 0; + if constexpr (IS_OPENGL) { + return ((channel_state->fast_bound_uniform_buffers[stage] >> binding_index) & 1) != 0; + } else { + // Only OpenGL has fast uniform buffers + return false; + } } template diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index 09631ffd83..486d19fb79 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -53,7 +53,6 @@ constexpr u32 NUM_COMPUTE_UNIFORM_BUFFERS = 8; constexpr u32 NUM_STORAGE_BUFFERS = 16; constexpr u32 NUM_TEXTURE_BUFFERS = 32; constexpr u32 NUM_STAGES = 5; -static_assert(NUM_GRAPHICS_UNIFORM_BUFFERS <= 32, "fast bitmask must fit u32"); using UniformBufferSizes = std::array, NUM_STAGES>; using ComputeUniformBufferSizes = std::array; @@ -138,8 +137,8 @@ public: u32 written_compute_texture_buffers = 0; u32 image_compute_texture_buffers = 0; - std::array uniform_cache_hits{}; - std::array uniform_cache_shots{}; + std::array uniform_cache_hits{}; + std::array uniform_cache_shots{}; u32 uniform_buffer_skip_cache_size = DEFAULT_SKIP_CACHE_SIZE; diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp index 0fbe707b04..ecc4f77dc7 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -25,12 +25,12 @@ namespace { using namespace Common::Literals; -// Minimum alignment we want to enforce for the streaming ring -constexpr VkDeviceSize MIN_STREAM_ALIGNMENT = 256; +// Maximum potential alignment of a Vulkan buffer +constexpr VkDeviceSize MAX_ALIGNMENT = 256; // Stream buffer size in bytes constexpr VkDeviceSize MAX_STREAM_BUFFER_SIZE = 128_MiB; -size_t GetStreamBufferSize(const Device& device, VkDeviceSize alignment) { +size_t GetStreamBufferSize(const Device& device) { VkDeviceSize size{0}; if (device.HasDebuggingToolAttached()) { bool found_heap = false; @@ -53,9 +53,8 @@ size_t GetStreamBufferSize(const Device& device, VkDeviceSize alignment) { // Clamp to the configured maximum, align up for safety, and ensure a sane minimum so // region_size (stream_buffer_size / NUM_SYNCS) never becomes zero. - const VkDeviceSize aligned = - (std::min)(Common::AlignUp(size, alignment), MAX_STREAM_BUFFER_SIZE); - const VkDeviceSize min_size = alignment * StagingBufferPool::NUM_SYNCS; + const VkDeviceSize aligned = (std::min)(Common::AlignUp(size, MAX_ALIGNMENT), MAX_STREAM_BUFFER_SIZE); + const VkDeviceSize min_size = MAX_ALIGNMENT * StagingBufferPool::NUM_SYNCS; return static_cast((std::max)(aligned, min_size)); } } // Anonymous namespace @@ -63,10 +62,8 @@ size_t GetStreamBufferSize(const Device& device, VkDeviceSize alignment) { StagingBufferPool::StagingBufferPool(const Device& device_, MemoryAllocator& memory_allocator_, Scheduler& scheduler_) : device{device_}, memory_allocator{memory_allocator_}, scheduler{scheduler_}, - stream_alignment{std::max(device_.GetUniformBufferAlignment(), - MIN_STREAM_ALIGNMENT)}, - stream_buffer_size{GetStreamBufferSize(device_, stream_alignment)}, - region_size{stream_buffer_size / StagingBufferPool::NUM_SYNCS} { + stream_buffer_size{GetStreamBufferSize(device)}, region_size{stream_buffer_size / + StagingBufferPool::NUM_SYNCS} { VkBufferCreateInfo stream_ci = { .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, .pNext = nullptr, @@ -119,11 +116,10 @@ void StagingBufferPool::TickFrame() { } StagingBufferRef StagingBufferPool::GetStreamBuffer(size_t size) { - const size_t alignment = static_cast(stream_alignment); - const size_t aligned_size = Common::AlignUp(size, alignment); + const size_t aligned_size = Common::AlignUp(size, MAX_ALIGNMENT); const bool wraps = iterator + size >= stream_buffer_size; const size_t new_iterator = - wraps ? aligned_size : Common::AlignUp(iterator + size, alignment); + wraps ? aligned_size : Common::AlignUp(iterator + size, MAX_ALIGNMENT); const size_t begin_region = wraps ? 0 : Region(iterator); const size_t last_byte = new_iterator == 0 ? 0 : new_iterator - 1; const size_t end_region = (std::min)(Region(last_byte) + 1, NUM_SYNCS); @@ -149,7 +145,7 @@ StagingBufferRef StagingBufferPool::GetStreamBuffer(size_t size) { current_tick); used_iterator = 0; iterator = 0; - free_iterator = aligned_size; + free_iterator = size; const size_t head_last_byte = aligned_size == 0 ? 0 : aligned_size - 1; const size_t head_end_region = (std::min)(Region(head_last_byte) + 1, NUM_SYNCS); if (AreRegionsActive(0, head_end_region)) { @@ -164,7 +160,7 @@ StagingBufferRef StagingBufferPool::GetStreamBuffer(size_t size) { iterator = new_iterator; if (!wraps) { - free_iterator = (std::max)(free_iterator, offset + aligned_size); + free_iterator = (std::max)(free_iterator, offset + size); } return StagingBufferRef{ diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h index 5c40ca069f..f63a203272 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -105,7 +102,6 @@ private: MemoryAllocator& memory_allocator; Scheduler& scheduler; - VkDeviceSize stream_alignment; vk::Buffer stream_buffer; std::span stream_pointer; VkDeviceSize stream_buffer_size; From bfffafe68bea923ddc56bb1b7da73d549865dc11 Mon Sep 17 00:00:00 2001 From: MaranBr Date: Fri, 10 Oct 2025 01:36:55 +0200 Subject: [PATCH 5/9] [common] Change web offline applet default setting to HLE (#2705) This prevents some games from ignoring the disable web applet setting. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2705 Co-authored-by: MaranBr Co-committed-by: MaranBr --- src/common/settings.h | 2 +- src/yuzu/configuration/configure_debug.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/settings.h b/src/common/settings.h index c6b52f7ba3..dd9b03f28e 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -161,7 +161,7 @@ struct Values { Category::LibraryApplet}; Setting photo_viewer_applet_mode{ linkage, AppletMode::LLE, "photo_viewer_applet_mode", Category::LibraryApplet}; - Setting offline_web_applet_mode{linkage, AppletMode::LLE, "offline_web_applet_mode", + Setting offline_web_applet_mode{linkage, AppletMode::HLE, "offline_web_applet_mode", Category::LibraryApplet}; Setting login_share_applet_mode{linkage, AppletMode::HLE, "login_share_applet_mode", Category::LibraryApplet}; diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index 18f629f639..b825348760 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp @@ -83,8 +83,7 @@ void ConfigureDebug::SetConfiguration() { #ifdef YUZU_USE_QT_WEB_ENGINE ui->disable_web_applet->setChecked(UISettings::values.disable_web_applet.GetValue()); #else - ui->disable_web_applet->setEnabled(false); - ui->disable_web_applet->setText(tr("Web applet not compiled")); + ui->disable_web_applet->setVisible(false); #endif } From b6241e4148d4a7bccedd3081707106edc58ff365 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 10 Oct 2025 01:55:43 +0200 Subject: [PATCH 6/9] revert [vk] StreamBuffer Changes (#2684) (#2707) revert [vk] StreamBuffer Changes (#2684) Streambuffer changes did broke stuff in other games that got out of our scope of testing, we're going to study this changes in the future for better graphic stability. Co-authored-by: Ribbit Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2684 Reviewed-by: MaranBr Reviewed-by: Lizzie Reviewed-by: CamilleLaVey Co-authored-by: Ribbit Co-committed-by: Ribbit Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2707 Reviewed-by: MaranBr Co-authored-by: CamilleLaVey Co-committed-by: CamilleLaVey --- .../vk_staging_buffer_pool.cpp | 60 +++++-------------- 1 file changed, 14 insertions(+), 46 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp index ecc4f77dc7..08513d1534 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -33,29 +33,19 @@ constexpr VkDeviceSize MAX_STREAM_BUFFER_SIZE = 128_MiB; size_t GetStreamBufferSize(const Device& device) { VkDeviceSize size{0}; if (device.HasDebuggingToolAttached()) { - bool found_heap = false; - ForEachDeviceLocalHostVisibleHeap(device, [&size, &found_heap](size_t /*index*/, VkMemoryHeap& heap) { + ForEachDeviceLocalHostVisibleHeap(device, [&size](size_t index, VkMemoryHeap& heap) { size = (std::max)(size, heap.size); - found_heap = true; }); - // If no suitable heap was found fall back to the default cap to avoid creating a zero-sized stream buffer. - if (!found_heap) { - size = MAX_STREAM_BUFFER_SIZE; - } else if (size <= 256_MiB) { - // If rebar is not supported, cut the max heap size to 40%. This will allow 2 captures to be - // loaded at the same time in RenderDoc. If rebar is supported, this shouldn't be an issue - // as the heap will be much larger. + // If rebar is not supported, cut the max heap size to 40%. This will allow 2 captures to be + // loaded at the same time in RenderDoc. If rebar is supported, this shouldn't be an issue + // as the heap will be much larger. + if (size <= 256_MiB) { size = size * 40 / 100; } } else { size = MAX_STREAM_BUFFER_SIZE; } - - // Clamp to the configured maximum, align up for safety, and ensure a sane minimum so - // region_size (stream_buffer_size / NUM_SYNCS) never becomes zero. - const VkDeviceSize aligned = (std::min)(Common::AlignUp(size, MAX_ALIGNMENT), MAX_STREAM_BUFFER_SIZE); - const VkDeviceSize min_size = MAX_ALIGNMENT * StagingBufferPool::NUM_SYNCS; - return static_cast((std::max)(aligned, min_size)); + return (std::min)(Common::AlignUp(size, MAX_ALIGNMENT), MAX_STREAM_BUFFER_SIZE); } } // Anonymous namespace @@ -116,53 +106,31 @@ void StagingBufferPool::TickFrame() { } StagingBufferRef StagingBufferPool::GetStreamBuffer(size_t size) { - const size_t aligned_size = Common::AlignUp(size, MAX_ALIGNMENT); - const bool wraps = iterator + size >= stream_buffer_size; - const size_t new_iterator = - wraps ? aligned_size : Common::AlignUp(iterator + size, MAX_ALIGNMENT); - const size_t begin_region = wraps ? 0 : Region(iterator); - const size_t last_byte = new_iterator == 0 ? 0 : new_iterator - 1; - const size_t end_region = (std::min)(Region(last_byte) + 1, NUM_SYNCS); - const size_t guard_begin = (std::min)(Region(free_iterator) + 1, NUM_SYNCS); - - if (!wraps) { - if (guard_begin < end_region && AreRegionsActive(guard_begin, end_region)) { - // Avoid waiting for the previous usages to be free - return GetStagingBuffer(size, MemoryUsage::Upload); - } - } else if (guard_begin < NUM_SYNCS && AreRegionsActive(guard_begin, NUM_SYNCS)) { + if (AreRegionsActive(Region(free_iterator) + 1, + (std::min)(Region(iterator + size) + 1, NUM_SYNCS))) { // Avoid waiting for the previous usages to be free return GetStagingBuffer(size, MemoryUsage::Upload); } - const u64 current_tick = scheduler.CurrentTick(); std::fill(sync_ticks.begin() + Region(used_iterator), sync_ticks.begin() + Region(iterator), current_tick); used_iterator = iterator; + free_iterator = (std::max)(free_iterator, iterator + size); - if (wraps) { + if (iterator + size >= stream_buffer_size) { std::fill(sync_ticks.begin() + Region(used_iterator), sync_ticks.begin() + NUM_SYNCS, current_tick); used_iterator = 0; iterator = 0; free_iterator = size; - const size_t head_last_byte = aligned_size == 0 ? 0 : aligned_size - 1; - const size_t head_end_region = (std::min)(Region(head_last_byte) + 1, NUM_SYNCS); - if (AreRegionsActive(0, head_end_region)) { + + if (AreRegionsActive(0, Region(size) + 1)) { // Avoid waiting for the previous usages to be free return GetStagingBuffer(size, MemoryUsage::Upload); } } - - std::fill(sync_ticks.begin() + begin_region, sync_ticks.begin() + end_region, current_tick); - - const size_t offset = wraps ? 0 : iterator; - iterator = new_iterator; - - if (!wraps) { - free_iterator = (std::max)(free_iterator, offset + size); - } - + const size_t offset = iterator; + iterator = Common::AlignUp(iterator + size, MAX_ALIGNMENT); return StagingBufferRef{ .buffer = *stream_buffer, .offset = static_cast(offset), From 15dd0a7140ef3a20278c5a4b98112754b299d37a Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Thu, 25 Sep 2025 11:44:14 -0300 Subject: [PATCH 7/9] [ci] license-header.sh: Make it POSIX-compliant! Signed-off-by: Caio Oliveira --- .ci/license-header.sh | 281 +++++++++++++++++++++++++----------------- 1 file changed, 171 insertions(+), 110 deletions(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 3d4929d1c1..9e70188971 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -1,145 +1,206 @@ #!/bin/sh -e -HEADER="$(cat "$PWD/.ci/license/header.txt")" -HEADER_HASH="$(cat "$PWD/.ci/license/header-hash.txt")" +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later -echo "Getting branch changes" +COPYRIGHT_YEAR="2025" +COPYRIGHT_OWNER="Eden Emulator Project" +COPYRIGHT_LICENSE="GPL-3.0-or-later" -# BRANCH=`git rev-parse --abbrev-ref HEAD` -# COMMITS=`git log ${BRANCH} --not master --pretty=format:"%h"` -# RANGE="${COMMITS[${#COMMITS[@]}-1]}^..${COMMITS[0]}" -# FILES=`git diff-tree --no-commit-id --name-only ${RANGE} -r` +if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then + echo + echo "license-header.sh: Eden License Headers Accreditation Script" + echo + echo "This script checks and optionally fixes license headers in source, CMake and shell script files." + echo + echo "Environment Variables:" + echo " FIX=true | Automatically add the correct license headers to offending files." + echo " UPDATE=true | Automatically update current license headers of offending files." + echo " COMMIT=true | If FIX=true, commit the changes automatically." + echo + echo "Usage Examples:" + echo " # Just check headers (will fail if headers are missing)" + echo " .ci/license-header.sh" + echo + echo " # Fix headers only" + echo " FIX=true .ci/license-header.sh" + echo + echo " # Update headers only" + echo " # if COPYRIGHT_OWNER is '$COPYRIGHT_OWNER'" + echo " # or else will have 'FIX=true' behavior)" + echo " UPDATE=true .ci/license-header.sh" + echo + echo " # Fix headers and commit changes" + echo " FIX=true COMMIT=true .ci/license-header.sh" + echo + echo " # Update headers and commit changes" + echo " # if COPYRIGHT_OWNER is '$COPYRIGHT_OWNER'" + echo " # or else will have 'FIX=true' behavior)" + echo " UPDATE=true COMMIT=true .ci/license-header.sh" + exit 0 +fi -BASE=`git merge-base master HEAD` -FILES=`git diff --name-only $BASE` +SRC_FILES="" +OTHER_FILES="" -#FILES=$(git diff --name-only master) +BASE=$(git merge-base master HEAD) +if git diff --quiet "$BASE"..HEAD; then + echo + echo "license-header.sh: No commits on this branch different from master." + exit 0 +fi +FILES=$(git diff --name-only "$BASE") -echo "Done" - -check_header() { - CONTENT="`head -n3 < $1`" - case "$CONTENT" in - "$HEADER"*) ;; - *) BAD_FILES="$BAD_FILES $1" ;; - esac +echo_header() { + COMMENT_TYPE="$1" + echo "$COMMENT_TYPE SPDX-FileCopyrightText: Copyright $COPYRIGHT_YEAR $COPYRIGHT_OWNER" + echo "$COMMENT_TYPE SPDX-License-Identifier: $COPYRIGHT_LICENSE" } -check_cmake_header() { - CONTENT="`head -n3 < $1`" - - case "$CONTENT" in - "$HEADER_HASH"*) ;; - *) - BAD_CMAKE="$BAD_CMAKE $1" ;; - esac -} for file in $FILES; do [ -f "$file" ] || continue - if [ `basename -- "$file"` = "CMakeLists.txt" ]; then - check_cmake_header "$file" + case "$(basename "$file")" in + CMakeLists.txt) + COMMENT_TYPE="#" ;; + *) + EXT="${file##*.}" + case "$EXT" in + kts|kt|cpp|h) COMMENT_TYPE="//" ;; + cmake|sh|ps1) COMMENT_TYPE="#" ;; + *) continue ;; + esac ;; + esac + + HEADER=$(echo_header "$COMMENT_TYPE") + HEAD_LINES=$(head -n5 "$file") + + CORRECT_COPYRIGHT=$(echo "$HEAD_LINES" | awk \ + -v line1="$(echo "$HEADER" | sed -n '1p')" \ + -v line2="$(echo "$HEADER" | sed -n '2p')" \ + '($0==line1){getline; if($0==line2){f=1}else{f=0}} END{print (f?f:0)}') + + if [ "$CORRECT_COPYRIGHT" != "1" ]; then + case "$COMMENT_TYPE" in + "//") SRC_FILES="$SRC_FILES $file" ;; + "#") OTHER_FILES="$OTHER_FILES $file" ;; + esac + fi +done + +if [ -z "$SRC_FILES" ] && [ -z "$OTHER_FILES" ]; then + echo + echo "license-header.sh: All good!" + exit 0 +fi + +for TYPE in "SRC" "OTHER"; do + if [ "$TYPE" = "SRC" ] && [ -n "$SRC_FILES" ]; then + FILES_LIST="$SRC_FILES" + COMMENT_TYPE="//" + DESC="Source" + elif [ "$TYPE" = "OTHER" ] && [ -n "$OTHER_FILES" ]; then + FILES_LIST="$OTHER_FILES" + COMMENT_TYPE="#" + DESC="CMake and shell script" + else continue fi - EXTENSION="${file##*.}" - case "$EXTENSION" in - kts|kt|cpp|h) - check_header "$file" - ;; - cmake) - check_cmake_header "$file" - ;; - esac + echo + echo "------------------------------------------------------------" + echo "$DESC files" + echo "------------------------------------------------------------" + echo + echo " The following files contain incorrect license headers:" + for file in $FILES_LIST; do + echo " - $file" + done + + echo + echo " The correct license header to be added to all affected" + echo " '$DESC' files is:" + echo + echo "=== BEGIN ===" + echo_header "$COMMENT_TYPE" + echo "=== END ===" done -if [ "$BAD_FILES" = "" ] && [ "$BAD_CMAKE" = "" ]; then - echo - echo "All good." - - exit -fi - -if [ "$BAD_FILES" != "" ]; then - echo "The following source files have incorrect license headers:" - echo - - for file in $BAD_FILES; do echo $file; done - - cat << EOF - -The following license header should be added to the start of all offending SOURCE files: - -=== BEGIN === -$HEADER -=== END === - -EOF - -fi - -if [ "$BAD_CMAKE" != "" ]; then - echo "The following CMake files have incorrect license headers:" - echo - - for file in $BAD_CMAKE; do echo $file; done - - cat << EOF - -The following license header should be added to the start of all offending CMake files: - -=== BEGIN === -$HEADER_HASH -=== END === - -EOF - -fi - cat << EOF -If some of the code in this PR is not being contributed by the original author, -the files which have been exclusively changed by that code can be ignored. -If this happens, this PR requirement can be bypassed once all other files are addressed. + +------------------------------------------------------------ + + If some of the code in this pull request was not contributed by the original + author, the files that have been modified exclusively by that code can be + safely ignored. In such cases, this PR requirement may be bypassed once all + other files have been reviewed and addressed. EOF -if [ "$FIX" = "true" ]; then - echo - echo "FIX set to true. Fixing headers." +TMP_DIR=$(mktemp -d /tmp/license-header.XXXXXX) || exit 1 +if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then echo + echo "license-header.sh: FIX set to true, fixing headers..." - for file in $BAD_FILES; do - cat $file > $file.bak + for file in $SRC_FILES $OTHER_FILES; do + BASENAME=$(basename "$file") - cat .ci/license/header.txt > $file - echo >> $file - cat $file.bak >> $file + case "$BASENAME" in + CMakeLists.txt) COMMENT_TYPE="#" ;; + *) + EXT="${file##*.}" + case "$EXT" in + kts|kt|cpp|h) COMMENT_TYPE="//" ;; + cmake|sh|ps1) COMMENT_TYPE="#" ;; + *) continue ;; + esac + ;; + esac - rm $file.bak + TMP="$TMP_DIR/$BASENAME.tmp" + UPDATED=0 + cp -p "$file" "$TMP" + > "$TMP" - git add $file + # this logic is bit hacky but sed don't work well with $VARIABLES + # it's this or complete remove this logic and keep only the old way + if [ "$UPDATE" = "true" ]; then + while IFS= read -r line || [ -n "$line" ]; do + if [ "$UPDATED" -eq 0 ] && echo "$line" | grep "$COPYRIGHT_OWNER" >/dev/null 2>&1; then + echo_header "$COMMENT_TYPE" >> "$TMP" + IFS= read -r _ || true + UPDATED=1 + else + echo "$line" >> "$TMP" + fi + done < "$file" + fi + + if [ "$UPDATED" -eq 0 ]; then + { + echo_header "$COMMENT_TYPE" + echo + cat "$TMP" + } > "$file" + else + mv "$TMP" "$file" + fi + + git add "$file" done - for file in $BAD_CMAKE; do - cat $file > $file.bak + rm -rf "$TMP_DIR" - cat .ci/license/header-hash.txt > $file - echo >> $file - cat $file.bak >> $file - - rm $file.bak - - git add $file - done - echo "License headers fixed." + echo + echo "license-header.sh: License headers fixed!" if [ "$COMMIT" = "true" ]; then echo - echo "COMMIT set to true. Committing changes." + echo "license-header.sh: COMMIT set to true, committing changes..." + + git commit -m "[license] Fix license headers [script]" + echo - - git commit -m "Fix license headers" - - echo "Changes committed. You may now push." + echo "license-header.sh: Changes committed. You may now push." fi else exit 1 From 8b6dc448742f40f7957a8491dfe72185496c3dd6 Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 26 Sep 2025 19:38:00 -0400 Subject: [PATCH 8/9] [ci] license-header.sh: add file exclusion capability Signed-off-by: crueter --- .ci/license-header.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 9e70188971..870555d533 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -3,6 +3,10 @@ # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later +# specify full path if dupes may exist +EXCLUDE_FILES="CPM.cmake CPMUtil.cmake GetSCMRev.cmake" +EXCLUDE_FILES=$(echo "$EXCLUDE_FILES" | sed 's/ /|/g') + COPYRIGHT_YEAR="2025" COPYRIGHT_OWNER="Eden Emulator Project" COPYRIGHT_LICENSE="GPL-3.0-or-later" @@ -49,7 +53,7 @@ if git diff --quiet "$BASE"..HEAD; then echo "license-header.sh: No commits on this branch different from master." exit 0 fi -FILES=$(git diff --name-only "$BASE") +FILES=$(git diff --name-only "$BASE" | grep -E -v "$EXCLUDE_FILES") echo_header() { COMMENT_TYPE="$1" From a7f932438b5264e5eae14f1c90067ab1fbc72de2 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Sun, 28 Sep 2025 19:52:28 -0300 Subject: [PATCH 9/9] [ci] license-header.sh: Fix some shellcheck warnings Signed-off-by: Caio Oliveira --- .ci/license-header.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 870555d533..ee775db01e 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -140,10 +140,10 @@ cat << EOF other files have been reviewed and addressed. EOF -TMP_DIR=$(mktemp -d /tmp/license-header.XXXXXX) || exit 1 +TMP_DIR=$(mktemp -d "/tmp/license-header.XXXXXX") || exit 1 if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then echo - echo "license-header.sh: FIX set to true, fixing headers..." + echo "license-header.sh: FIX or UPDATE set to true, fixing headers..." for file in $SRC_FILES $OTHER_FILES; do BASENAME=$(basename "$file") @@ -163,7 +163,7 @@ if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then TMP="$TMP_DIR/$BASENAME.tmp" UPDATED=0 cp -p "$file" "$TMP" - > "$TMP" + : > "$TMP" # this logic is bit hacky but sed don't work well with $VARIABLES # it's this or complete remove this logic and keep only the old way