mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-24 09:05:47 +00:00
video_core/engines/maxwell_3d: Add is_trivially_copyable_v check for Regs
std::memset is used to clear the entire register structure, which requires that the Regs struct be trivially copyable (otherwise undefined behavior is invoked). This prevents the case where a non-trivial type is potentially added to the struct.
This commit is contained in:
parent
9415bf9da5
commit
b66f9188cb
1 changed files with 2 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <array>
|
||||
#include <bitset>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
|
@ -1107,6 +1108,7 @@ public:
|
|||
} regs{};
|
||||
|
||||
static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), "Maxwell3D Regs has wrong size");
|
||||
static_assert(std::is_trivially_copyable_v<Regs>, "Maxwell3D Regs must be trivially copyable");
|
||||
|
||||
struct State {
|
||||
struct ConstBufferInfo {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue