mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-18 03:31:31 +12:00
Fix shader caching being broken
This commit is contained in:
parent
59f4f236d8
commit
7209740418
1 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
@ -23,6 +24,10 @@ namespace PICA {
|
||||||
u8 outputCount;
|
u8 outputCount;
|
||||||
bool usingUbershader;
|
bool usingUbershader;
|
||||||
|
|
||||||
|
// Pad to 56 bytes so that the compiler won't insert unnecessary padding, which in turn will affect our unordered_map lookup
|
||||||
|
// As the padding will get hashed and memcmp'd...
|
||||||
|
u32 pad{};
|
||||||
|
|
||||||
bool operator==(const VertConfig& config) const {
|
bool operator==(const VertConfig& config) const {
|
||||||
// Hash function and equality operator required by std::unordered_map
|
// Hash function and equality operator required by std::unordered_map
|
||||||
return std::memcmp(this, &config, sizeof(VertConfig)) == 0;
|
return std::memcmp(this, &config, sizeof(VertConfig)) == 0;
|
||||||
|
@ -43,6 +48,8 @@ namespace PICA {
|
||||||
};
|
};
|
||||||
} // namespace PICA
|
} // namespace PICA
|
||||||
|
|
||||||
|
static_assert(sizeof(PICA::VertConfig) == 56);
|
||||||
|
|
||||||
// Override std::hash for our vertex config class
|
// Override std::hash for our vertex config class
|
||||||
template <>
|
template <>
|
||||||
struct std::hash<PICA::VertConfig> {
|
struct std::hash<PICA::VertConfig> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue