Skip to content

Commit

Permalink
PostProcessing: Add Config::GetShaderOptions()
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Dec 10, 2023
1 parent c90de02 commit 27162e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/util/postprocessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ std::vector<PostProcessing::ShaderOption> PostProcessing::Config::GetStageOption
return ret;
}

std::vector<PostProcessing::ShaderOption> PostProcessing::Config::GetShaderOptions(const std::string& shader_name,
Error* error)
{
std::vector<PostProcessing::ShaderOption> ret;
std::unique_ptr<Shader> shader = TryLoadingShader(shader_name, true, error);
if (!shader)
return ret;

ret = shader->TakeOptions();
return ret;
}

bool PostProcessing::Config::AddStage(SettingsInterface& si, const std::string& shader_name, Error* error)
{
std::unique_ptr<Shader> shader = TryLoadingShader(shader_name, true, error);
Expand Down
1 change: 1 addition & 0 deletions src/util/postprocessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ namespace Config {
u32 GetStageCount(const SettingsInterface& si);
std::string GetStageShaderName(const SettingsInterface& si, u32 index);
std::vector<ShaderOption> GetStageOptions(const SettingsInterface& si, u32 index);
std::vector<ShaderOption> GetShaderOptions(const std::string& shader_name, Error* error);

bool AddStage(SettingsInterface& si, const std::string& shader_name, Error* error);
void RemoveStage(SettingsInterface& si, u32 index);
Expand Down

0 comments on commit 27162e3

Please sign in to comment.