diff options
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/CPMemory.cpp | 7 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/ShaderCache.cpp | 14 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoaderManager.cpp | 7 |
3 files changed, 28 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/CPMemory.cpp b/Source/Core/VideoCommon/CPMemory.cpp index d2371834a3..3d72a6f70b 100644 --- a/Source/Core/VideoCommon/CPMemory.cpp +++ b/Source/Core/VideoCommon/CPMemory.cpp @@ -17,7 +17,14 @@ CPState g_preprocess_cp_state; void CopyPreprocessCPStateFromMain() { +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif std::memcpy(&g_preprocess_cp_state, &g_main_cp_state, sizeof(CPState)); +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif } std::pair<std::string, std::string> GetCPRegInfo(u8 cmd, u32 value) diff --git a/Source/Core/VideoCommon/ShaderCache.cpp b/Source/Core/VideoCommon/ShaderCache.cpp index 98c915a7ee..1c01356c99 100644 --- a/Source/Core/VideoCommon/ShaderCache.cpp +++ b/Source/Core/VideoCommon/ShaderCache.cpp @@ -608,7 +608,14 @@ AbstractPipelineConfig ShaderCache::GetGXPipelineConfig( static GXPipelineUid ApplyDriverBugs(const GXPipelineUid& in) { GXPipelineUid out; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif memcpy(&out, &in, sizeof(out)); // copy padding +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif pixel_shader_uid_data* ps = out.ps_uid.GetUidData(); BlendingState& blend = out.blending_state; @@ -778,7 +785,14 @@ ShaderCache::GetGXPipelineConfig(const GXPipelineUid& config_in) static GXUberPipelineUid ApplyDriverBugs(const GXUberPipelineUid& in) { GXUberPipelineUid out; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif memcpy(&out, &in, sizeof(out)); // Copy padding +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif if (g_ActiveConfig.backend_info.bSupportsDynamicVertexLoader) out.vertex_format = nullptr; diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp index f3d580b801..49f139c208 100644 --- a/Source/Core/VideoCommon/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp @@ -153,7 +153,14 @@ NativeVertexFormat* GetUberVertexFormat(const PortableVertexDeclaration& decl) // The padding in the structs can cause the memcmp() in the map to create duplicates. // Avoid this by initializing the padding to zero. PortableVertexDeclaration new_decl; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif std::memset(&new_decl, 0, sizeof(new_decl)); +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif new_decl.stride = decl.stride; auto MakeDummyAttribute = [](AttributeFormat& attr, ComponentFormat type, int components, |
