mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-12 23:26:02 +00:00
Avoid stepping further into VkShaderManager::Get unless the shader has not been compiled
This commit is contained in:
parent
f11318ff99
commit
162ebe0f18
1 changed files with 68 additions and 68 deletions
|
@ -50,8 +50,9 @@ VkShaderProgram* VkShaderManager::Get(const VkShaderKey& k, EPassType passType)
|
||||||
VkShaderKey key = k;
|
VkShaderKey key = k;
|
||||||
key.GBufferPass = passType;
|
key.GBufferPass = passType;
|
||||||
auto& program = programs[key];
|
auto& program = programs[key];
|
||||||
if (!program.frag)
|
if (program.frag)
|
||||||
{
|
return &program;
|
||||||
|
|
||||||
const char* mainvp = "shaders/scene/vert_main.glsl";
|
const char* mainvp = "shaders/scene/vert_main.glsl";
|
||||||
const char* mainfp = "shaders/scene/frag_main.glsl";
|
const char* mainfp = "shaders/scene/frag_main.glsl";
|
||||||
|
|
||||||
|
@ -119,7 +120,7 @@ VkShaderProgram* VkShaderManager::Get(const VkShaderKey& k, EPassType passType)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto& desc = usershaders[key.EffectState];
|
const auto& desc = usershaders[key.EffectState - FIRST_USER_SHADER];
|
||||||
const FString& name = ExtractFileBase(desc.shader);
|
const FString& name = ExtractFileBase(desc.shader);
|
||||||
FString defines = defaultshaders[desc.shaderType].Defines + desc.defines;
|
FString defines = defaultshaders[desc.shaderType].Defines + desc.defines;
|
||||||
|
|
||||||
|
@ -127,7 +128,6 @@ VkShaderProgram* VkShaderManager::Get(const VkShaderKey& k, EPassType passType)
|
||||||
program.frag = LoadFragShader(name, mainfp, desc.shader, defaultshaders[desc.shaderType].mateffect_lump, defaultshaders[desc.shaderType].lightmodel_lump, defines, key);
|
program.frag = LoadFragShader(name, mainfp, desc.shader, defaultshaders[desc.shaderType].mateffect_lump, defaultshaders[desc.shaderType].lightmodel_lump, defines, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return &program;
|
return &program;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue