mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-16 11:48:28 +12:00
Add all the files
This commit is contained in:
parent
e3db07a16a
commit
d60742f52b
1445 changed files with 430238 additions and 0 deletions
36
src/Cafe/HW/Latte/Renderer/RendererShader.cpp
Normal file
36
src/Cafe/HW/Latte/Renderer/RendererShader.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
#include "Cafe/HW/Latte/Renderer/RendererShader.h"
|
||||
#include "Cafe/GameProfile/GameProfile.h"
|
||||
|
||||
// generate a Cemu version and setting dependent id
|
||||
uint32 RendererShader::GeneratePrecompiledCacheId()
|
||||
{
|
||||
uint32 v = 0;
|
||||
const char* s = EMULATOR_VERSION_SUFFIX;
|
||||
while (*s)
|
||||
{
|
||||
v = _rotl(v, 7);
|
||||
v += (uint32)(*s);
|
||||
s++;
|
||||
}
|
||||
v += (EMULATOR_VERSION_LEAD * 1000000u);
|
||||
v += (EMULATOR_VERSION_MAJOR * 10000u);
|
||||
v += (EMULATOR_VERSION_MINOR * 100u);
|
||||
|
||||
// settings that can influence shaders
|
||||
v += (uint32)g_current_game_profile->GetAccurateShaderMul() * 133; // this option modifies shaders
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
void RendererShader::GenerateShaderPrecompiledCacheFilename(RendererShader::ShaderType type, uint64 baseHash, uint64 auxHash, uint64& h1, uint64& h2)
|
||||
{
|
||||
h1 = baseHash;
|
||||
h2 = auxHash;
|
||||
|
||||
if (type == RendererShader::ShaderType::kVertex)
|
||||
h2 += 0xA16374cull;
|
||||
else if (type == RendererShader::ShaderType::kFragment)
|
||||
h2 += 0x8752deull;
|
||||
else if (type == RendererShader::ShaderType::kGeometry)
|
||||
h2 += 0x65a035ull;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue