[Fix]: PSO caching broken? Just re-generate on mismatch (TODO: fix this later)

This commit is contained in:
2025-06-19 15:55:17 +08:00
parent 3d2596f701
commit 09d13579fc
3 changed files with 97 additions and 19 deletions
+31
View File
@@ -4,6 +4,7 @@
#include "Debug.h"
#include "../../Includes.h"
#include "BlendState.h"
namespace MG_Util::Debug {
static FILE* logFile;
@@ -1951,6 +1952,36 @@ void Log##name(const char* format, ...) { \
}
#undef CASE
}
const char* DiligentBlendFactorToString(Diligent::BLEND_FACTOR value) {
static char str[128];
switch (value) {
#define CASE(value) \
case value: return #value;
CASE(Diligent::BLEND_FACTOR_UNDEFINED)
CASE(Diligent::BLEND_FACTOR_ZERO)
CASE(Diligent::BLEND_FACTOR_ONE)
CASE(Diligent::BLEND_FACTOR_SRC_COLOR)
CASE(Diligent::BLEND_FACTOR_INV_SRC_COLOR)
CASE(Diligent::BLEND_FACTOR_SRC_ALPHA)
CASE(Diligent::BLEND_FACTOR_INV_SRC_ALPHA)
CASE(Diligent::BLEND_FACTOR_DEST_ALPHA)
CASE(Diligent::BLEND_FACTOR_DEST_COLOR)
CASE(Diligent::BLEND_FACTOR_INV_DEST_COLOR)
CASE(Diligent::BLEND_FACTOR_SRC_ALPHA_SAT)
CASE(Diligent::BLEND_FACTOR_BLEND_FACTOR)
CASE(Diligent::BLEND_FACTOR_INV_BLEND_FACTOR)
CASE(Diligent::BLEND_FACTOR_SRC1_COLOR)
CASE(Diligent::BLEND_FACTOR_INV_SRC1_COLOR)
CASE(Diligent::BLEND_FACTOR_SRC1_ALPHA)
CASE(Diligent::BLEND_FACTOR_INV_SRC1_ALPHA)
default:
sprintf(str, "0x%x", value);
return str;
}
#undef CASE
}
}