config: Make sample_count a pow/log-2 index

Sample counts increment in powers of two(1,2,4,8). Rather than storing a direct integer of the number of samples, just store the pow2 index.
This commit is contained in:
Wunkolo 2023-11-11 11:07:10 -08:00
parent 90ad4e1a19
commit 3c2f825c84
3 changed files with 3 additions and 3 deletions

View File

@ -475,7 +475,7 @@ struct Values {
SwitchableSetting<bool> use_vsync_new{true, "use_vsync_new"};
Setting<bool> use_shader_jit{true, "use_shader_jit"};
SwitchableSetting<u32, true> resolution_factor{1, 0, 10, "resolution_factor"};
SwitchableSetting<u8, true> sample_count{1, 0, 8, "sample_count"};
SwitchableSetting<u8, true> sample_count{0, 0, 3, "sample_count"};
SwitchableSetting<u16, true> frame_limit{100, 0, 1000, "frame_limit"};
SwitchableSetting<TextureFilter> texture_filter{TextureFilter::None, "texture_filter"};
SwitchableSetting<TextureSampling> texture_sampling{TextureSampling::GameControlled,

View File

@ -37,7 +37,7 @@ u8 RendererBase::GetSampleCount() const {
return 1;
}
return Settings::values.sample_count.GetValue();
return static_cast<u8>(1u << Settings::values.sample_count.GetValue());
}
void RendererBase::UpdateCurrentFramebufferLayout(bool is_portrait_mode) {

View File

@ -766,7 +766,7 @@ bool RasterizerVulkan::AccelerateDisplay(const Pica::FramebufferConfig& config,
src_params.stride = pixel_stride;
src_params.is_tiled = false;
src_params.pixel_format = VideoCore::PixelFormatFromGPUPixelFormat(config.color_format);
src_params.sample_count = Settings::values.sample_count.GetValue();
src_params.sample_count = (1u << Settings::values.sample_count.GetValue());
src_params.UpdateParams();
const auto [src_surface_id, src_rect] =