diff options
| author | Pokechu22 <Pokechu022@gmail.com> | 2023-02-02 16:53:08 -0800 |
|---|---|---|
| committer | Pokechu22 <Pokechu022@gmail.com> | 2023-02-09 16:23:49 -0800 |
| commit | 3024ca2146cfdae2e7fb231e8d180dfc81e1a74e (patch) | |
| tree | 1422619a72cdcdf51e1d1e60509859f664d2d762 /Source/Core/VideoCommon/ShaderCache.cpp | |
| parent | ac7a17579eea61c627bcf76b5758718e64caeeb4 (diff) | |
Suppress memcpy writing to an object with no trivial copy-assignment warnings
We need to copy padding in most of these cases, and the objects are trivially copyable; however, BitField prevents trivial copy-assignment.
Diffstat (limited to 'Source/Core/VideoCommon/ShaderCache.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/ShaderCache.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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; |
