Skip to content

Commit

Permalink
Up version number, hard-code shaders for UT builds (temporary to prod…
Browse files Browse the repository at this point in the history
…uce a GH version)
  • Loading branch information
metallicafan212 committed Feb 17, 2024
1 parent 7a5f266 commit efed638
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Inc/ICBINDx11Drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
#define WINDOWS_IGNORE_PACKING_MISMATCH 1
#endif

// Metallicafan212: Hard-code shaders for comp play
// TODO! Should probably only be enabled for build built with the official patch and released on Github
#define DX11_HARDCODE_SHADERS 1

#endif

#define INT_INDEX_BUFF 1
Expand Down Expand Up @@ -82,7 +86,7 @@ typedef unsigned short INDEX;

#define DX11_USE_MSAA_SHADER 1

#define D3D_DRIVER_VERSION TEXT("0.69 Alpha")
#define D3D_DRIVER_VERSION TEXT("0.89 Alfalfa-Alpha")

// Metallicafan212: Compile time
#define COMPILED_AT *FString::Printf(TEXT("%s @ %s"), appFromAnsi(__DATE__), appFromAnsi(__TIME__))
Expand Down
8 changes: 4 additions & 4 deletions Src/UnShaderManager.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ICBINDx11Drv.h"

// Metallicafan212: If to print out the shader bytes to the log when compiled
#define SHADER_DEBUG_OUTPUT 1
#define SHADER_DEBUG_OUTPUT 0

// Metallicafan212: Might be too stupid of a name lmao
#define CACHE_FILE SHADER_FOLDER TEXT("Haybale.cache")
Expand Down Expand Up @@ -224,15 +224,15 @@ TArray<BYTE>* FShaderManager::GetShaderBytes(FString File, FString Func, const A

TArray<BYTE>* ShaderBytes = nullptr;

// Metallicafan212: Add the generational language to it as well
FString Key = FString::Printf(TEXT("%s:%s:%s"), *File, *Func, appFromAnsi(Lang));

#if !DX11_HARDCODE_SHADERS
// Metallicafan212: Compare the cache time to the file time
SQWORD ShaderTime = GFileManager->GetGlobalTime(*File);

FString RealFile;

// Metallicafan212: Add the generational language to it as well
FString Key = FString::Printf(TEXT("%s:%s:%s"), *File, *Func, appFromAnsi(Lang));

// Metallicafan212: On a fresh load, CacheTime should be 0
if (ShaderTime < CacheTime)
{
Expand Down

0 comments on commit efed638

Please sign in to comment.