User chain support

This commit is contained in:
iota97 committed 2020-09-13 21:48:00 +02:00
1 parent a81991f114
commit 0c885db052
13 files changed
+134 -48

No files matched your search

+19
View File
@@ -213,6 +213,25 @@ std::vector<const ShaderInfo *> GetPostShaderChain(const std::string &name) {
return backwards;
}
std::vector<const ShaderInfo *> GetFullPostShadersChain(const std::vector<std::string> &names) {
std::vector<const ShaderInfo *> fullChain;
for (auto shaderName : names) {
if (shaderName == "Off")
break;
auto shaderChain = GetPostShaderChain(shaderName);
fullChain.insert(fullChain.end(), shaderChain.begin(), shaderChain.end());
}
return fullChain;
}
bool PostShaderChainRequires60FPS(const std::vector<const ShaderInfo *> &chain) {
for (auto shaderInfo : chain) {
if (shaderInfo->requires60fps)
return true;
}
return false;
}
const std::vector<ShaderInfo> &GetAllPostShaderInfo() {
return shaderInfo;
}
+2
View File
@@ -83,6 +83,8 @@ void ReloadAllPostShaderInfo();
const ShaderInfo *GetPostShaderInfo(const std::string &name);
std::vector<const ShaderInfo *> GetPostShaderChain(const std::string &name);
std::vector<const ShaderInfo *> GetFullPostShadersChain(const std::vector<std::string> &names);
bool PostShaderChainRequires60FPS(const std::vector<const ShaderInfo *> &chain);
const std::vector<ShaderInfo> &GetAllPostShaderInfo();
const TextureShaderInfo *GetTextureShaderInfo(const std::string &name);
+4 -4
View File
@@ -210,9 +210,9 @@ static std::string ReadShaderSrc(const std::string &filename) {
// Note: called on resize and settings changes.
bool PresentationCommon::UpdatePostShader() {
std::vector<const ShaderInfo *> shaderInfo;
if (g_Config.sPostShaderName != "Off") {
if (g_Config.vPostShaderNames[0] != "Off") {
ReloadAllPostShaderInfo();
shaderInfo = GetPostShaderChain(g_Config.sPostShaderName);
shaderInfo = GetFullPostShadersChain(g_Config.vPostShaderNames);
}
DestroyPostShader();
@@ -754,9 +754,9 @@ void PresentationCommon::CopyToOutput(OutputFlags flags, int uvRotation, float u
void PresentationCommon::CalculateRenderResolution(int *width, int *height, bool *upscaling, bool *ssaa) {
// Check if postprocessing shader is doing upscaling as it requires native resolution
std::vector<const ShaderInfo *> shaderInfo;
if (g_Config.sPostShaderName != "Off") {
if (g_Config.vPostShaderNames[0] != "Off") {
ReloadAllPostShaderInfo();
shaderInfo = GetPostShaderChain(g_Config.sPostShaderName);
shaderInfo = GetFullPostShadersChain(g_Config.vPostShaderNames);
}
bool firstIsUpscalingFilter = shaderInfo.empty() ? false : shaderInfo.front()->isUpscalingFilter;