renderer_base: Add GetSampleCount

Only enables sample counts higher than 1 on vulkan
This commit is contained in:
Wunkolo 2023-11-10 11:36:11 -08:00
parent 23d2e532fc
commit 42b04b048c
2 changed files with 14 additions and 0 deletions

View File

@ -29,6 +29,17 @@ u32 RendererBase::GetResolutionScaleFactor() {
: render_window.GetFramebufferLayout().GetScalingRatio(); : render_window.GetFramebufferLayout().GetScalingRatio();
} }
u8 RendererBase::GetSampleCount() const {
const auto graphics_api = Settings::values.graphics_api.GetValue();
// Enabled for vulkan only for now
if (graphics_api != Settings::GraphicsAPI::Vulkan) {
return 1;
}
return Settings::values.sample_count.GetValue();
}
void RendererBase::UpdateCurrentFramebufferLayout(bool is_portrait_mode) { void RendererBase::UpdateCurrentFramebufferLayout(bool is_portrait_mode) {
const auto update_layout = [is_portrait_mode](Frontend::EmuWindow& window) { const auto update_layout = [is_portrait_mode](Frontend::EmuWindow& window) {
const Layout::FramebufferLayout& layout = window.GetFramebufferLayout(); const Layout::FramebufferLayout& layout = window.GetFramebufferLayout();

View File

@ -69,6 +69,9 @@ public:
/// Returns the resolution scale factor relative to the native 3DS screen resolution /// Returns the resolution scale factor relative to the native 3DS screen resolution
u32 GetResolutionScaleFactor(); u32 GetResolutionScaleFactor();
/// Returns the MSAA sample count
u8 GetSampleCount() const;
/// Updates the framebuffer layout of the contained render window handle. /// Updates the framebuffer layout of the contained render window handle.
void UpdateCurrentFramebufferLayout(bool is_portrait_mode = {}); void UpdateCurrentFramebufferLayout(bool is_portrait_mode = {});