mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
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.
This commit is contained in:
@ -19,7 +19,9 @@ static T GenerateVertexShader(API_TYPE api_type)
|
||||
// Non-uid template parameters will write to the dummy data (=> gets optimized out)
|
||||
vertex_shader_uid_data dummy_data;
|
||||
vertex_shader_uid_data* uid_data = out.template GetUidData<vertex_shader_uid_data>();
|
||||
if (uid_data == nullptr)
|
||||
if (uid_data != nullptr)
|
||||
memset(uid_data, 0, sizeof(*uid_data));
|
||||
else
|
||||
uid_data = &dummy_data;
|
||||
|
||||
_assert_(bpmem.genMode.numtexgens == xfmem.numTexGen.numTexGens);
|
||||
|
Reference in New Issue
Block a user