mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	build: Clear out remaining compile warnings. (#6662)
This commit is contained in:
		
							parent
							
								
									2126c240cd
								
							
						
					
					
						commit
						13a8969824
					
				
					 26 changed files with 117 additions and 103 deletions
				
			
		|  | @ -40,7 +40,6 @@ if (MSVC) | |||
|         /Zo | ||||
|         /permissive- | ||||
|         /EHsc | ||||
|         /std:c++latest | ||||
|         /utf-8 | ||||
|         /volatile:iso | ||||
|         /Zc:externConstexpr | ||||
|  |  | |||
|  | @ -65,7 +65,7 @@ public: | |||
|      * @param length the number of bytes to read. The max is 65,535 (max of u16). | ||||
|      * @returns a vector of bytes from the specified pipe. On error, will be empty. | ||||
|      */ | ||||
|     virtual std::vector<u8> PipeRead(DspPipe pipe_number, u32 length) = 0; | ||||
|     virtual std::vector<u8> PipeRead(DspPipe pipe_number, std::size_t length) = 0; | ||||
| 
 | ||||
|     /**
 | ||||
|      * How much data is left in pipe | ||||
|  |  | |||
|  | @ -64,7 +64,7 @@ public: | |||
| 
 | ||||
|     u16 RecvData(u32 register_number); | ||||
|     bool RecvDataIsReady(u32 register_number) const; | ||||
|     std::vector<u8> PipeRead(DspPipe pipe_number, u32 length); | ||||
|     std::vector<u8> PipeRead(DspPipe pipe_number, std::size_t length); | ||||
|     std::size_t GetPipeReadableSize(DspPipe pipe_number) const; | ||||
|     void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer); | ||||
| 
 | ||||
|  | @ -202,7 +202,7 @@ bool DspHle::Impl::RecvDataIsReady(u32 register_number) const { | |||
|     return true; | ||||
| } | ||||
| 
 | ||||
| std::vector<u8> DspHle::Impl::PipeRead(DspPipe pipe_number, u32 length) { | ||||
| std::vector<u8> DspHle::Impl::PipeRead(DspPipe pipe_number, std::size_t length) { | ||||
|     const std::size_t pipe_index = static_cast<std::size_t>(pipe_number); | ||||
| 
 | ||||
|     if (pipe_index >= num_dsp_pipe) { | ||||
|  | @ -486,7 +486,7 @@ void DspHle::SetSemaphore(u16 semaphore_value) { | |||
|     // Do nothing in HLE
 | ||||
| } | ||||
| 
 | ||||
| std::vector<u8> DspHle::PipeRead(DspPipe pipe_number, u32 length) { | ||||
| std::vector<u8> DspHle::PipeRead(DspPipe pipe_number, std::size_t length) { | ||||
|     return impl->PipeRead(pipe_number, length); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -28,7 +28,7 @@ public: | |||
|     u16 RecvData(u32 register_number) override; | ||||
|     bool RecvDataIsReady(u32 register_number) const override; | ||||
|     void SetSemaphore(u16 semaphore_value) override; | ||||
|     std::vector<u8> PipeRead(DspPipe pipe_number, u32 length) override; | ||||
|     std::vector<u8> PipeRead(DspPipe pipe_number, std::size_t length) override; | ||||
|     std::size_t GetPipeReadableSize(DspPipe pipe_number) const override; | ||||
|     void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer) override; | ||||
| 
 | ||||
|  |  | |||
|  | @ -392,7 +392,7 @@ void DspLle::SetSemaphore(u16 semaphore_value) { | |||
|     impl->teakra.SetSemaphore(semaphore_value); | ||||
| } | ||||
| 
 | ||||
| std::vector<u8> DspLle::PipeRead(DspPipe pipe_number, u32 length) { | ||||
| std::vector<u8> DspLle::PipeRead(DspPipe pipe_number, std::size_t length) { | ||||
|     return impl->ReadPipe(static_cast<u8>(pipe_number), static_cast<u16>(length)); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ public: | |||
|     u16 RecvData(u32 register_number) override; | ||||
|     bool RecvDataIsReady(u32 register_number) const override; | ||||
|     void SetSemaphore(u16 semaphore_value) override; | ||||
|     std::vector<u8> PipeRead(DspPipe pipe_number, u32 length) override; | ||||
|     std::vector<u8> PipeRead(DspPipe pipe_number, std::size_t length) override; | ||||
|     std::size_t GetPipeReadableSize(DspPipe pipe_number) const override; | ||||
|     void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer) override; | ||||
| 
 | ||||
|  |  | |||
|  | @ -290,6 +290,11 @@ elseif(WIN32) | |||
|     endif() | ||||
| endif() | ||||
| 
 | ||||
| if(ENABLE_SDL2) | ||||
|     target_link_libraries(citra-qt PRIVATE SDL2::SDL2) | ||||
|     target_compile_definitions(citra-qt PRIVATE HAVE_SDL2) | ||||
| endif() | ||||
| 
 | ||||
| create_target_directory_groups(citra-qt) | ||||
| 
 | ||||
| target_link_libraries(citra-qt PRIVATE audio_core citra_common citra_core input_common network video_core) | ||||
|  |  | |||
|  | @ -26,7 +26,7 @@ void HotkeyRegistry::SaveHotkeys() { | |||
| void HotkeyRegistry::LoadHotkeys() { | ||||
|     // Make sure NOT to use a reference here because it would become invalid once we call
 | ||||
|     // beginGroup()
 | ||||
|     for (const auto shortcut : UISettings::values.shortcuts) { | ||||
|     for (auto shortcut : UISettings::values.shortcuts) { | ||||
|         Hotkey& hk = hotkey_groups[shortcut.group][shortcut.name]; | ||||
|         if (!shortcut.shortcut.keyseq.isEmpty()) { | ||||
|             hk.keyseq = | ||||
|  |  | |||
|  | @ -115,6 +115,10 @@ __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; | |||
| } | ||||
| #endif | ||||
| 
 | ||||
| #ifdef HAVE_SDL2 | ||||
| #include <SDL.h> | ||||
| #endif | ||||
| 
 | ||||
| constexpr int default_mouse_timeout = 2500; | ||||
| 
 | ||||
| /**
 | ||||
|  | @ -967,7 +971,7 @@ void GMainWindow::ShowUpdaterWidgets() { | |||
| } | ||||
| #endif | ||||
| 
 | ||||
| #if defined(__unix__) && !defined(__APPLE__) | ||||
| #if defined(HAVE_SDL2) && defined(__unix__) && !defined(__APPLE__) | ||||
| static std::optional<QDBusObjectPath> HoldWakeLockLinux(u32 window_id = 0) { | ||||
|     if (!QDBusConnection::sessionBus().isConnected()) { | ||||
|         return {}; | ||||
|  | @ -1013,12 +1017,12 @@ void GMainWindow::PreventOSSleep() { | |||
|     SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED); | ||||
| #elif defined(HAVE_SDL2) | ||||
|     SDL_DisableScreenSaver(); | ||||
| #ifdef __unix__ | ||||
| #if defined(__unix__) && !defined(__APPLE__) | ||||
|     auto reply = HoldWakeLockLinux(winId()); | ||||
|     if (reply) { | ||||
|         wake_lock = std::move(reply.value()); | ||||
|     } | ||||
| #endif // __unix__
 | ||||
| #endif // defined(__unix__) && !defined(__APPLE__)
 | ||||
| #endif // _WIN32
 | ||||
| } | ||||
| 
 | ||||
|  | @ -1027,11 +1031,11 @@ void GMainWindow::AllowOSSleep() { | |||
|     SetThreadExecutionState(ES_CONTINUOUS); | ||||
| #elif defined(HAVE_SDL2) | ||||
|     SDL_EnableScreenSaver(); | ||||
| #ifdef __unix__ | ||||
| #if defined(__unix__) && !defined(__APPLE__) | ||||
|     if (!wake_lock.path().isEmpty()) { | ||||
|         ReleaseWakeLockLinux(wake_lock); | ||||
|     } | ||||
| #endif // __unix__
 | ||||
| #endif // defined(__unix__) && !defined(__APPLE__)
 | ||||
| #endif // _WIN32
 | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -33,7 +33,6 @@ std::string_view GetAudioEmulationName(AudioEmulation emulation) { | |||
|     default: | ||||
|         return "Invalid"; | ||||
|     } | ||||
|     UNREACHABLE(); | ||||
| }; | ||||
| 
 | ||||
| std::string_view GetGraphicsAPIName(GraphicsAPI api) { | ||||
|  | @ -45,7 +44,6 @@ std::string_view GetGraphicsAPIName(GraphicsAPI api) { | |||
|     default: | ||||
|         return "Invalid"; | ||||
|     } | ||||
|     UNREACHABLE(); | ||||
| } | ||||
| 
 | ||||
| std::string_view GetTextureFilterName(TextureFilter filter) { | ||||
|  | @ -67,7 +65,6 @@ std::string_view GetTextureFilterName(TextureFilter filter) { | |||
|     default: | ||||
|         return "Invalid"; | ||||
|     } | ||||
|     UNREACHABLE(); | ||||
| } | ||||
| 
 | ||||
| } // Anonymous namespace
 | ||||
|  |  | |||
|  | @ -3,10 +3,12 @@ | |||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #pragma once | ||||
| 
 | ||||
| #include <array> | ||||
| #include "common/common_types.h" | ||||
| 
 | ||||
| constexpr int fixure_buffer_size = 41; | ||||
| constexpr std::array<u8, 41> fixure_buffer[41] = { | ||||
|     0xff, 0xf1, 0x4c, 0x80, 0x05, 0x3f, 0xfc, 0x21, 0x1a, 0x4e, 0xb0, 0x00, 0x00, 0x00, | ||||
|     0x05, 0xfc, 0x4e, 0x1f, 0x08, 0x88, 0x00, 0x00, 0x00, 0xc4, 0x1a, 0x03, 0xfc, 0x9c, | ||||
|     0x3e, 0x1d, 0x08, 0x84, 0x03, 0xd8, 0x3f, 0xe4, 0xe1, 0x20, 0x00, 0x0b, 0x38}; | ||||
|     {0xff, 0xf1, 0x4c, 0x80, 0x05, 0x3f, 0xfc, 0x21, 0x1a, 0x4e, 0xb0, 0x00, 0x00, 0x00, | ||||
|      0x05, 0xfc, 0x4e, 0x1f, 0x08, 0x88, 0x00, 0x00, 0x00, 0xc4, 0x1a, 0x03, 0xfc, 0x9c, | ||||
|      0x3e, 0x1d, 0x08, 0x84, 0x03, 0xd8, 0x3f, 0xe4, 0xe1, 0x20, 0x00, 0x0b, 0x38}}; | ||||
|  |  | |||
|  | @ -168,6 +168,7 @@ TEST_CASE("HLERequestContext::PopulateFromIncomingCommandBuffer", "[core][kernel | |||
|         VAddr target_address = 0x10000000; | ||||
|         auto result = process->vm_manager.MapBackingMemory( | ||||
|             target_address, buffer, static_cast<u32>(buffer.GetSize()), MemoryState::Private); | ||||
|         REQUIRE(result.Code() == RESULT_SUCCESS); | ||||
| 
 | ||||
|         const u32_le input[]{ | ||||
|             IPC::MakeHeader(0, 0, 2), | ||||
|  |  | |||
|  | @ -4,6 +4,9 @@ | |||
| 
 | ||||
| //? #version 430 core | ||||
| 
 | ||||
| precision highp int; | ||||
| precision highp float; | ||||
| 
 | ||||
| layout(location = 0) in mediump vec2 tex_coord; | ||||
| layout(location = 0) out lowp vec4 frag_color; | ||||
| 
 | ||||
|  |  | |||
|  | @ -4,6 +4,9 @@ | |||
| 
 | ||||
| //? #version 430 core | ||||
| 
 | ||||
| precision highp int; | ||||
| precision highp float; | ||||
| 
 | ||||
| layout(location = 0) in mediump vec2 tex_coord; | ||||
| layout(location = 0) out lowp vec4 frag_color; | ||||
| 
 | ||||
|  |  | |||
|  | @ -681,8 +681,8 @@ Sampler::Sampler(TextureRuntime&, VideoCore::SamplerParams params) { | |||
|     const GLenum wrap_s = PicaToGL::WrapMode(params.wrap_s); | ||||
|     const GLenum wrap_t = PicaToGL::WrapMode(params.wrap_t); | ||||
|     const Common::Vec4f gl_color = PicaToGL::ColorRGBA8(params.border_color); | ||||
|     const float lod_min = params.lod_min; | ||||
|     const float lod_max = params.lod_max; | ||||
|     const auto lod_min = static_cast<float>(params.lod_min); | ||||
|     const auto lod_max = static_cast<float>(params.lod_max); | ||||
| 
 | ||||
|     sampler.Create(); | ||||
| 
 | ||||
|  | @ -706,7 +706,8 @@ DebugScope::DebugScope(TextureRuntime& runtime, Common::Vec4f, std::string_view | |||
|     if (!Settings::values.renderer_debug) { | ||||
|         return; | ||||
|     } | ||||
|     glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, local_scope_depth, label.size(), label.data()); | ||||
|     glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, local_scope_depth, | ||||
|                      static_cast<GLsizei>(label.size()), label.data()); | ||||
| } | ||||
| 
 | ||||
| DebugScope::~DebugScope() { | ||||
|  |  | |||
|  | @ -292,11 +292,6 @@ void RasterizerSoftware::ProcessTriangle(const Vertex& v0, const Vertex& v1, con | |||
|     auto textures = regs.texturing.GetTextures(); | ||||
|     const auto tev_stages = regs.texturing.GetTevStages(); | ||||
| 
 | ||||
|     const bool stencil_action_enable = | ||||
|         regs.framebuffer.output_merger.stencil_test.enable && | ||||
|         regs.framebuffer.framebuffer.depth_format == FramebufferRegs::DepthFormat::D24S8; | ||||
|     const auto stencil_test = regs.framebuffer.output_merger.stencil_test; | ||||
| 
 | ||||
|     // Enter rasterization loop, starting at the center of the topleft bounding box corner.
 | ||||
|     // TODO: Not sure if looping through x first might be faster
 | ||||
|     for (u16 y = min_y + 8; y < max_y; y += 0x10) { | ||||
|  | @ -446,7 +441,7 @@ void RasterizerSoftware::ProcessTriangle(const Vertex& v0, const Vertex& v1, con | |||
|                 continue; | ||||
|             } | ||||
|             WriteFog(combiner_output, depth); | ||||
|             if (!DoDepthStencilTest(x, y, depth, stencil_action_enable)) { | ||||
|             if (!DoDepthStencilTest(x, y, depth)) { | ||||
|                 continue; | ||||
|             } | ||||
|             const auto result = PixelColor(x, y, combiner_output); | ||||
|  | @ -828,11 +823,14 @@ bool RasterizerSoftware::DoAlphaTest(u8 alpha) const { | |||
|         return alpha > output_merger.alpha_test.ref; | ||||
|     case FramebufferRegs::CompareFunc::GreaterThanOrEqual: | ||||
|         return alpha >= output_merger.alpha_test.ref; | ||||
|     default: | ||||
|         LOG_CRITICAL(Render_Software, "Unknown alpha test condition {}", | ||||
|                      output_merger.alpha_test.func.Value()); | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| bool RasterizerSoftware::DoDepthStencilTest(u16 x, u16 y, float depth, | ||||
|                                             bool stencil_action_enable) const { | ||||
| bool RasterizerSoftware::DoDepthStencilTest(u16 x, u16 y, float depth) const { | ||||
|     const auto& framebuffer = regs.framebuffer.framebuffer; | ||||
|     const auto stencil_test = regs.framebuffer.output_merger.stencil_test; | ||||
|     u8 old_stencil = 0; | ||||
|  | @ -847,6 +845,10 @@ bool RasterizerSoftware::DoDepthStencilTest(u16 x, u16 y, float depth, | |||
|         } | ||||
|     }; | ||||
| 
 | ||||
|     const bool stencil_action_enable = | ||||
|         regs.framebuffer.output_merger.stencil_test.enable && | ||||
|         regs.framebuffer.framebuffer.depth_format == FramebufferRegs::DepthFormat::D24S8; | ||||
| 
 | ||||
|     if (stencil_action_enable) { | ||||
|         old_stencil = fb.GetStencil(x >> 4, y >> 4); | ||||
|         const u8 dest = old_stencil & stencil_test.input_mask; | ||||
|  |  | |||
|  | @ -68,7 +68,7 @@ private: | |||
|     bool DoAlphaTest(u8 alpha) const; | ||||
| 
 | ||||
|     /// Performs the depth stencil test. Returns false if the test failed.
 | ||||
|     bool DoDepthStencilTest(u16 x, u16 y, float depth, bool stencil_action_enable) const; | ||||
|     bool DoDepthStencilTest(u16 x, u16 y, float depth) const; | ||||
| 
 | ||||
| private: | ||||
|     Memory::MemorySystem& memory; | ||||
|  |  | |||
|  | @ -281,7 +281,6 @@ private: | |||
|     bool pipeline_creation_cache_control{}; | ||||
|     bool shader_stencil_export{}; | ||||
|     bool debug_messenger_supported{}; | ||||
|     bool debug_report_supported{}; | ||||
| }; | ||||
| 
 | ||||
| } // namespace Vulkan
 | ||||
|  |  | |||
|  | @ -99,10 +99,10 @@ std::shared_ptr<Common::DynamicLibrary> OpenLibrary() { | |||
|     auto library = std::make_shared<Common::DynamicLibrary>(); | ||||
| #ifdef __APPLE__ | ||||
|     const std::string filename = Common::DynamicLibrary::GetLibraryName("vulkan"); | ||||
|     library->Load(filename); | ||||
|     if (!library->IsLoaded()) { | ||||
|     if (!library->Load(filename)) { | ||||
|         // Fall back to directly loading bundled MoltenVK library.
 | ||||
|         library->Load("libMoltenVK.dylib"); | ||||
|         const std::string mvk_filename = Common::DynamicLibrary::GetLibraryName("MoltenVK"); | ||||
|         void(library->Load(mvk_filename)); | ||||
|     } | ||||
| #else | ||||
|     std::string filename = Common::DynamicLibrary::GetLibraryName("vulkan", 1); | ||||
|  |  | |||
|  | @ -1497,7 +1497,6 @@ void FragmentModule::DefineInterface() { | |||
| 
 | ||||
|     // Define shadow textures
 | ||||
|     shadow_texture_px_id = DefineUniformConst(image_r32_id, 2, 0, true); | ||||
|     shadow_buffer_id = DefineUniformConst(image_r32_id, 2, 6); | ||||
| 
 | ||||
|     // Define built-ins
 | ||||
|     gl_frag_coord_id = DefineVar(vec_ids.Get(4), spv::StorageClass::Input); | ||||
|  |  | |||
|  | @ -256,13 +256,7 @@ private: | |||
|     Id texture_buffer_lut_lf_id{}; | ||||
|     Id texture_buffer_lut_rg_id{}; | ||||
|     Id texture_buffer_lut_rgba_id{}; | ||||
|     Id shadow_buffer_id{}; | ||||
|     Id shadow_texture_px_id{}; | ||||
|     Id shadow_texture_nx_id{}; | ||||
|     Id shadow_texture_py_id{}; | ||||
|     Id shadow_texture_ny_id{}; | ||||
|     Id shadow_texture_pz_id{}; | ||||
|     Id shadow_texture_nz_id{}; | ||||
| 
 | ||||
|     Id texture_buffer_lut_lf{}; | ||||
|     Id texture_buffer_lut_rg{}; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue