diff --git a/Common/GPU/Vulkan/VulkanMemory.h b/Common/GPU/Vulkan/VulkanMemory.h index 079996b8a6..82ef924390 100644 --- a/Common/GPU/Vulkan/VulkanMemory.h +++ b/Common/GPU/Vulkan/VulkanMemory.h @@ -101,6 +101,10 @@ public: return offset_; } + const char *Name() const { + return name_; + } + // "Zero-copy" variant - you can write the data directly as you compute it. // Recommended. void *Push(size_t size, uint32_t *bindOffset, VkBuffer *vkbuf) { diff --git a/Common/Render/TextureAtlas.cpp b/Common/Render/TextureAtlas.cpp index c23cb33646..f41cbc1402 100644 --- a/Common/Render/TextureAtlas.cpp +++ b/Common/Render/TextureAtlas.cpp @@ -2,6 +2,7 @@ #include #include +#include "Common/Log.h" #include "Common/Render/TextureAtlas.h" class ByteReader { @@ -10,6 +11,7 @@ public: template T Read() { + _dbg_assert_(offset_ + sizeof(T) <= size_); T x; memcpy(&x, data_ + offset_, sizeof(T)); offset_ += sizeof(T); @@ -18,6 +20,7 @@ public: template void ReadInto(T *t) { + _dbg_assert_(offset_ + sizeof(T) <= size_); memcpy(t, data_ + offset_, sizeof(T)); offset_ += sizeof(T); } @@ -26,13 +29,16 @@ public: T *ReadMultipleAlloc(size_t count, bool compressed) { T *t = new T[count]; if (!compressed) { + _dbg_assert_(offset_ + sizeof(T) * count <= size_); memcpy(t, data_ + offset_, sizeof(T) * count); offset_ += sizeof(T) * count; } else { + _dbg_assert_(offset_ + sizeof(uint32_t) <= size_); uint32_t compressed_size = 0; memcpy(&compressed_size, data_ + offset_, sizeof(uint32_t)); offset_ += sizeof(uint32_t); + _dbg_assert_(offset_ + compressed_size <= size_); ZSTD_decompress(t, sizeof(T) * count, data_ + offset_, compressed_size); offset_ += compressed_size; } diff --git a/GPU/Common/TextureDecoder.cpp b/GPU/Common/TextureDecoder.cpp index c18c96e0fa..d7788077a6 100644 --- a/GPU/Common/TextureDecoder.cpp +++ b/GPU/Common/TextureDecoder.cpp @@ -217,7 +217,7 @@ u32 GetTextureBufw(int level, u32 texaddr, GETextureFormat format) { return bufw; } -// Is this compatible with QuickTexHashNEON/SSE? +// Matches QuickTexHashNEON/SSE, see #7029. static u32 QuickTexHashNonSSE(const void *checkp, u32 size) { u32 check = 0; @@ -269,20 +269,6 @@ static u32 QuickTexHashNonSSE(const void *checkp, u32 size) { return check; } -static u32 QuickTexHashBasic(const void *checkp, u32 size) { - u32 check = 0; - const u32 size_u32 = size / 4; - const u32 *p = (const u32 *)checkp; - for (u32 i = 0; i < size_u32; i += 4) { - check += p[i + 0]; - check ^= p[i + 1]; - check += p[i + 2]; - check ^= p[i + 3]; - } - - return check; -} - u32 StableQuickTexHash(const void *checkp, u32 size) { #if defined(_M_SSE) return QuickTexHashSSE2(checkp, size); diff --git a/GPU/Common/TextureScalerCommon.cpp b/GPU/Common/TextureScalerCommon.cpp index f7dbbeae71..3c6e946c2f 100644 --- a/GPU/Common/TextureScalerCommon.cpp +++ b/GPU/Common/TextureScalerCommon.cpp @@ -209,7 +209,7 @@ static void load_sample(ptrdiff_t w, ptrdiff_t h, ptrdiff_t s, const u8 *pixels, // Check if the sample is inside. NOTE: for b>=0 // the expression (UNSIGNED)a<(UNSIGNED)b is // equivalent to a>=0&&a= (size_t)w||(size_t)y >= (size_t)h) { switch(wrap_mode) { diff --git a/GPU/GLES/TextureCacheGLES.h b/GPU/GLES/TextureCacheGLES.h index 90108d2639..ac5313c3cb 100644 --- a/GPU/GLES/TextureCacheGLES.h +++ b/GPU/GLES/TextureCacheGLES.h @@ -79,7 +79,6 @@ private: GLRTexture *lastBoundTexture = nullptr; FramebufferManagerGLES *framebufferManagerGL_; - ShaderManagerGLES *shaderManagerGL_; DrawEngineGLES *drawEngine_; enum { INVALID_TEX = -1 }; diff --git a/GPU/Vulkan/VulkanUtil.h b/GPU/Vulkan/VulkanUtil.h index 4a82b9e851..2753fd79eb 100644 --- a/GPU/Vulkan/VulkanUtil.h +++ b/GPU/Vulkan/VulkanUtil.h @@ -72,7 +72,7 @@ private: struct FrameData { FrameData() : descPool("VulkanComputeShaderManager", true) { - descPool.Setup([this] { }); + descPool.Setup([] { }); } VulkanDescSetPool descPool; diff --git a/UI/ComboKeyMappingScreen.h b/UI/ComboKeyMappingScreen.h index cf82e703e8..6eb271211d 100644 --- a/UI/ComboKeyMappingScreen.h +++ b/UI/ComboKeyMappingScreen.h @@ -39,7 +39,6 @@ private: bool array[ARRAY_SIZE(CustomKey::comboKeyList)]; int id_; - UI::ChoiceStrip *comboselect; UI::ScrollView *rightScroll_; class ChoiceEventHandler{ public: