diff --git a/rpcs3/Emu/RSX/Common/BufferUtils.cpp b/rpcs3/Emu/RSX/Common/BufferUtils.cpp index 264ca1f47e..3cdabd12ea 100644 --- a/rpcs3/Emu/RSX/Common/BufferUtils.cpp +++ b/rpcs3/Emu/RSX/Common/BufferUtils.cpp @@ -831,7 +831,7 @@ namespace const __m128i value = _mm_shuffle_epi8(raw, s_bswap_u16_mask); max = _mm_max_epu16(max, value); min = _mm_min_epu16(min, value); - _mm_storeu_si128(dst_stream++, value); + _mm_store_si128(dst_stream++, value); } const u16 min_index = sse41_hmin_epu16(min); @@ -857,7 +857,7 @@ namespace const __m128i value = _mm_shuffle_epi8(raw, s_bswap_u32_mask); max = _mm_max_epu32(max, value); min = _mm_min_epu32(min, value); - _mm_storeu_si128(dst_stream++, value); + _mm_store_si128(dst_stream++, value); } __m128i tmp = _mm_srli_si128(min, 8); @@ -944,7 +944,7 @@ namespace const __m256i value_with_max_restart = _mm256_or_si256(mask, value); max = _mm256_max_epu16(max, value_with_min_restart); min = _mm256_min_epu16(min, value_with_max_restart); - _mm256_storeu_si256(dst_stream++, value_with_max_restart); + _mm256_store_si256(dst_stream++, value_with_max_restart); } __m128i tmp = _mm256_extracti128_si256(min, 1); @@ -981,7 +981,7 @@ namespace const __m128i value_with_max_restart = _mm_or_si128(mask, value); max = _mm_max_epu16(max, value_with_min_restart); min = _mm_min_epu16(min, value_with_max_restart); - _mm_storeu_si128(dst_stream++, value_with_max_restart); + _mm_store_si128(dst_stream++, value_with_max_restart); } const u16 min_index = sse41_hmin_epu16(min); @@ -1010,7 +1010,7 @@ namespace const __m128i value_with_max_restart = _mm_or_si128(mask, value); max = _mm_max_epu32(max, value_with_min_restart); min = _mm_min_epu32(min, value_with_max_restart); - _mm_storeu_si128(dst_stream++, value_with_max_restart); + _mm_store_si128(dst_stream++, value_with_max_restart); } __m128i tmp = _mm_srli_si128(min, 8); diff --git a/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp b/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp index d155ce1295..a06b97583e 100644 --- a/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp +++ b/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp @@ -144,15 +144,15 @@ namespace if (emulate_restart) upload_size *= 2; - VkDeviceSize offset_in_index_buffer = m_index_buffer_ring_info.alloc<4>(upload_size); + VkDeviceSize offset_in_index_buffer = m_index_buffer_ring_info.alloc<64>(upload_size); void* buf = m_index_buffer_ring_info.map(offset_in_index_buffer, upload_size); std::span dst; - std::vector tmp; + stx::single_ptr tmp; if (emulate_restart) { - tmp.resize(upload_size); - dst = tmp; + tmp = stx::make_single(upload_size); + dst = std::span(tmp.get(), upload_size); } else { @@ -182,11 +182,11 @@ namespace { if (index_type == rsx::index_array_type::u16) { - index_count = rsx::remove_restart_index(static_cast(buf), reinterpret_cast(tmp.data()), index_count, u16{umax}); + index_count = rsx::remove_restart_index(static_cast(buf), reinterpret_cast(tmp.get()), index_count, u16{umax}); } else { - index_count = rsx::remove_restart_index(static_cast(buf), reinterpret_cast(tmp.data()), index_count, u32{umax}); + index_count = rsx::remove_restart_index(static_cast(buf), reinterpret_cast(tmp.get()), index_count, u32{umax}); } } diff --git a/rpcs3/util/shared_ptr.hpp b/rpcs3/util/shared_ptr.hpp index 1f6bdf26f4..a2672c02bd 100644 --- a/rpcs3/util/shared_ptr.hpp +++ b/rpcs3/util/shared_ptr.hpp @@ -49,7 +49,7 @@ namespace stx // Control block with data and reference counter template - class alignas(T) shared_data final : align_filler + class shared_data final : align_filler { public: shared_counter m_ctr{}; @@ -64,7 +64,7 @@ namespace stx }; template - class alignas(T) shared_data final : align_filler + class shared_data final : align_filler { public: usz m_count{}; @@ -98,8 +98,6 @@ namespace stx friend class atomic_ptr; public: - using pointer = T*; - using element_type = std::remove_extent_t; constexpr single_ptr() noexcept = default; @@ -109,7 +107,7 @@ namespace stx // Default constructor or null_ptr should be used instead [[deprecated("Use null_ptr")]] single_ptr(std::nullptr_t) = delete; - explicit single_ptr(shared_data&, pointer ptr) noexcept + explicit single_ptr(shared_data&, element_type* ptr) noexcept : m_ptr(ptr) { } @@ -258,7 +256,7 @@ namespace stx return single_ptr(*ptr, &ptr->m_data); } - template + template )> static std::enable_if_t, single_ptr> make_single(usz count) noexcept { static_assert(sizeof(shared_data) - offsetof(shared_data, m_ctr) == sizeof(shared_counter)); @@ -269,9 +267,9 @@ namespace stx std::byte* bytes = nullptr; - if constexpr (alignof(etype) > (__STDCPP_DEFAULT_NEW_ALIGNMENT__)) + if constexpr (Align > (__STDCPP_DEFAULT_NEW_ALIGNMENT__)) { - bytes = static_cast(::operator new(size, std::align_val_t{alignof(etype)})); + bytes = static_cast(::operator new(size, std::align_val_t{Align})); } else { @@ -305,9 +303,9 @@ namespace stx ptr->~shared_data(); - if constexpr (alignof(etype) > (__STDCPP_DEFAULT_NEW_ALIGNMENT__)) + if constexpr (Align > (__STDCPP_DEFAULT_NEW_ALIGNMENT__)) { - ::operator delete[](bytes, std::align_val_t{alignof(etype)}); + ::operator delete[](bytes, std::align_val_t{Align}); } else { @@ -347,8 +345,6 @@ namespace stx friend class atomic_ptr; public: - using pointer = T*; - using element_type = std::remove_extent_t; constexpr shared_ptr() noexcept = default; @@ -594,8 +590,6 @@ namespace stx friend class atomic_ptr; public: - using pointer = T*; - using element_type = std::remove_extent_t; using shared_type = shared_ptr;