mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-10 13:06:24 +02:00
User chain support
This commit is contained in:
1 parent
a81991f114
commit
0c885db052
13 files changed
+134
-48
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user