From c56d893e772617844d7553a79e3a89a6d0a73519 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 9 May 2019 18:30:39 -0400 Subject: [PATCH 1/7] video_core/textures/astc: Remove unused variables Silences a few compilation warnings. --- src/video_core/textures/astc.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp index eafb6b73a..a9b8f69af 100644 --- a/src/video_core/textures/astc.cpp +++ b/src/video_core/textures/astc.cpp @@ -25,8 +25,8 @@ class InputBitStream { public: - explicit InputBitStream(const unsigned char* ptr, int nBits = 0, int start_offset = 0) - : m_NumBits(nBits), m_CurByte(ptr), m_NextBit(start_offset % 8) {} + explicit InputBitStream(const unsigned char* ptr, int start_offset = 0) + : m_CurByte(ptr), m_NextBit(start_offset % 8) {} ~InputBitStream() = default; @@ -55,12 +55,9 @@ public: } private: - const int m_NumBits; const unsigned char* m_CurByte; int m_NextBit = 0; int m_BitsRead = 0; - - bool done = false; }; class OutputBitStream { @@ -114,7 +111,6 @@ private: const int m_NumBits; unsigned char* m_CurByte; int m_NextBit = 0; - int m_BitsRead = 0; bool done = false; }; From ba165b10926de0e5f4280c621dae87e30ce29c97 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 9 May 2019 18:39:18 -0400 Subject: [PATCH 2/7] video_core/gpu_thread: Remove unused local variable Instead of retrieving the data from the std::variant instance, we can just check if the variant contains that type of data. This is essentially the same behavior, only it returns a bool indicating whether or not the type in the variant is currently active, instead of actually retrieving the data. --- src/video_core/gpu_thread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index c9a2077de..03856013f 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp @@ -44,7 +44,7 @@ static void RunThread(VideoCore::RendererBase& renderer, Tegra::DmaPusher& dma_p renderer.Rasterizer().FlushRegion(data->addr, data->size); } else if (const auto data = std::get_if(&next.data)) { renderer.Rasterizer().InvalidateRegion(data->addr, data->size); - } else if (const auto data = std::get_if(&next.data)) { + } else if (std::holds_alternative(next.data)) { return; } else { UNREACHABLE(); From 6d28d288a31ad31324615c9f9bb1b0d151d37cd7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 9 May 2019 18:42:02 -0400 Subject: [PATCH 3/7] video_core/renderer_opengl/gl_rasterizer_cache: Remove unused variable in UploadGLMipmapTexture() This variable is unused entirely, so it can be removed. --- src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 5a25f5b37..bdb822c20 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -801,7 +801,6 @@ void CachedSurface::UploadGLMipmapTexture(u32 mip_map, GLuint read_fb_handle, tuple.type, &gl_buffer[mip_map][buffer_offset]); break; case SurfaceTarget::TextureCubemap: { - std::size_t start = buffer_offset; for (std::size_t face = 0; face < params.depth; ++face) { glTextureSubImage3D(texture.handle, mip_map, x0, y0, static_cast(face), static_cast(rect.GetWidth()), From 175fe8aaebfd04e17e13bd2520598645b35c3167 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 9 May 2019 18:45:24 -0400 Subject: [PATCH 4/7] video_core/renderer_opengl/gl_shader_decompiler: Remove unused Composite() function This isn't used at all, so it can be removed. --- .../renderer_opengl/gl_shader_decompiler.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index ef1a1995f..1a62795e1 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -871,17 +871,6 @@ private: return {}; } - std::string Composite(Operation operation) { - std::string value = "vec4("; - for (std::size_t i = 0; i < 4; ++i) { - value += Visit(operation[i]); - if (i < 3) - value += ", "; - } - value += ')'; - return value; - } - template std::string Add(Operation operation) { return GenerateBinaryInfix(operation, "+", type, type, type); From e3c45b43382cacd3469853a0791794513b9e6724 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 9 May 2019 18:47:48 -0400 Subject: [PATCH 5/7] renderer_vulkan/vk_shader_decompiler: Remove unused variable from DeclareInternalFlags() --- src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index 23d9b10db..a11000f6b 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp @@ -315,7 +315,6 @@ private: constexpr std::array names = {"zero", "sign", "carry", "overflow"}; for (std::size_t flag = 0; flag < INTERNAL_FLAGS_COUNT; ++flag) { - const auto flag_code = static_cast(flag); const Id id = OpVariable(t_prv_bool, spv::StorageClass::Private, v_false); internal_flags[flag] = AddGlobalVariable(Name(id, names[flag])); } From e43ba3acd4e7b1039c6e7904f5b17e2428baeaa6 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 9 May 2019 18:49:53 -0400 Subject: [PATCH 6/7] video_core/shader/decode/texture: Remove unused variable from GetTld4Code() --- src/video_core/shader/decode/texture.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp index 8b574d4e5..5b033126d 100644 --- a/src/video_core/shader/decode/texture.cpp +++ b/src/video_core/shader/decode/texture.cpp @@ -540,7 +540,6 @@ Node4 ShaderIR::GetTexsCode(Instruction instr, TextureType texture_type, Node4 ShaderIR::GetTld4Code(Instruction instr, TextureType texture_type, bool depth_compare, bool is_array, bool is_aoffi) { const std::size_t coord_count = GetCoordCount(texture_type); - const std::size_t total_coord_count = coord_count + (is_array ? 1 : 0); // If enabled arrays index is always stored in the gpr8 field const u64 array_register = instr.gpr8.Value(); From b6408e9671fd3e238534c2a0bac3355f68646576 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 9 May 2019 18:55:45 -0400 Subject: [PATCH 7/7] video_core/renderer_opengl/gl_shader_cache: Correct member initialization order Silences a -Wreorder warning. --- src/video_core/renderer_opengl/gl_shader_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index b1c8f7c35..f700dc89a 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp @@ -345,7 +345,7 @@ ShaderDiskCacheUsage CachedShader::GetUsage(GLenum primitive_mode, ShaderCacheOpenGL::ShaderCacheOpenGL(RasterizerOpenGL& rasterizer, Core::System& system, const Device& device) - : RasterizerCache{rasterizer}, disk_cache{system}, device{device} {} + : RasterizerCache{rasterizer}, device{device}, disk_cache{system} {} void ShaderCacheOpenGL::LoadDiskCache(const std::atomic_bool& stop_loading, const VideoCore::DiskResourceLoadCallback& callback) {