diff options
| author | Stenzek <stenzek@gmail.com> | 2016-01-02 16:20:01 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2016-01-02 17:35:06 +1000 |
| commit | 617f9d953259a113d1c00c588c8c70837a791ae3 (patch) | |
| tree | d25c555b4008485452a74b2da4f24b26881f98a8 /Source/Core/VideoCommon/GeometryShaderGen.cpp | |
| parent | 066af14272a87870bbb84280249cf938d9eba336 (diff) | |
ShaderGen: Remove virtual methods from ShaderGeneratorInterface, move string buffer to ShaderCode
This fixes the crashes occuring at startup with a non-empty shader cache.
Because LinearDiskCache reads/writes to the storage of ShaderUid, ShaderUid must be trivially copyable.
Additionally, adds a static assert to LinearDiskCache to ensure this doesn't happen in the future.
The initialization of ShaderUid data has been moved to the code generation functions, so the above condition holds true.
Diffstat (limited to 'Source/Core/VideoCommon/GeometryShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/GeometryShaderGen.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/GeometryShaderGen.cpp b/Source/Core/VideoCommon/GeometryShaderGen.cpp index 9c1ccd3071..602adb7e21 100644 --- a/Source/Core/VideoCommon/GeometryShaderGen.cpp +++ b/Source/Core/VideoCommon/GeometryShaderGen.cpp @@ -34,7 +34,9 @@ static T GenerateGeometryShader(u32 primitive_type, API_TYPE ApiType) // Non-uid template parameters will write to the dummy data (=> gets optimized out) geometry_shader_uid_data dummy_data; geometry_shader_uid_data* uid_data = out.template GetUidData<geometry_shader_uid_data>(); - if (uid_data == nullptr) + if (uid_data != nullptr) + memset(uid_data, 0, sizeof(*uid_data)); + else uid_data = &dummy_data; uid_data->primitive_type = primitive_type; |
