Skip to content

Commit

Permalink
fixes for filter
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolix29 committed Jan 15, 2025
1 parent aff42cf commit 46a082b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ void setVblankDiv(u32 value) {
void setPostProcessingFilter(const std::string& type) {
ppFilter = type;
}

void setIsFullscreen(bool enable) {
isFullscreen = enable;
}
Expand Down Expand Up @@ -963,4 +964,5 @@ std::filesystem::path GetFoolproofKbmConfigFile(const std::string& game_id) {
}
return config_file;
}

} // namespace Config
16 changes: 13 additions & 3 deletions src/video_core/renderer_vulkan/vk_presenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,19 @@ void Presenter::CreatePostProcessPipeline() {
instance.GetDevice().destroyShaderModule(fs_module);

// Create sampler resource
const auto filters = std::unordered_map<std::string, vk::Filter>{
{"linear", vk::Filter::eLinear},
{"nearest", vk::Filter::eNearest},
};
auto pp_filter = vk::Filter::eLinear;
if (const auto filter = Config::getPostProcessingFilter(); filters.contains(filter)) {
pp_filter = filters.at(filter);
} else {
LOG_WARNING(Render_Vulkan, "Unknown post processing filter: {}", filter);
}
const vk::SamplerCreateInfo sampler_ci = {
.magFilter = vk::Filter::eLinear,
.minFilter = vk::Filter::eLinear,
.magFilter = pp_filter,
.minFilter = pp_filter,
.mipmapMode = vk::SamplerMipmapMode::eNearest,
.addressModeU = vk::SamplerAddressMode::eClampToEdge,
.addressModeV = vk::SamplerAddressMode::eClampToEdge,
Expand Down Expand Up @@ -798,4 +808,4 @@ Frame* Presenter::GetRenderFrame() {
return frame;
}

} // namespace Vulkan
} // namespace Vulkan

0 comments on commit 46a082b

Please sign in to comment.