mirror of
https://github.com/Ishan09811/pine.git
synced 2025-04-24 08:55:10 +00:00
Implement Anisotropic filtering option (#49)
This commit is contained in:
parent
241a799a33
commit
9a72c247fc
@ -276,3 +276,7 @@ extern "C" JNIEXPORT void JNICALL Java_emu_skyline_EmulationActivity_setAudioSin
|
||||
std::string sink = ConvertJStringToString(env, jSink);
|
||||
AudioCore::Sink::AudioSink = sink;
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL Java_emu_skyline_EmulationActivity_setAnisotropicFilter(JNIEnv *env, jobject obj, jfloat jAnisotropy) {
|
||||
skyline::gpu::interconnect::preferredAnisotropy = static_cast<float>(jAnisotropy);
|
||||
}
|
||||
|
@ -77,5 +77,9 @@ namespace skyline::gpu {
|
||||
* @brief Should be called after loader population to initialize the per-title caches
|
||||
*/
|
||||
void Initialise();
|
||||
|
||||
const DeviceState& getState() const {
|
||||
return state;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <soc/gm20b/channel.h>
|
||||
#include <soc/gm20b/gmmu.h>
|
||||
#include <common/settings.h>
|
||||
#include "samplers.h"
|
||||
|
||||
namespace skyline::gpu::interconnect {
|
||||
@ -171,7 +172,8 @@ namespace skyline::gpu::interconnect {
|
||||
return vkMode;
|
||||
}};
|
||||
|
||||
auto maxAnisotropy{texSampler.MaxAnisotropy()};
|
||||
auto maxAnisotropy{preferredAnisotropy};
|
||||
if (maxAnisotropy == 1.0f) maxAnisotropy = texSampler.MaxAnisotropy();
|
||||
vk::StructureChain<vk::SamplerCreateInfo, vk::SamplerReductionModeCreateInfoEXT, vk::SamplerCustomBorderColorCreateInfoEXT> samplerInfo{
|
||||
vk::SamplerCreateInfo{
|
||||
.magFilter = ConvertSamplerFilter(texSampler.magFilter),
|
||||
@ -216,4 +218,4 @@ namespace skyline::gpu::interconnect {
|
||||
return sampler.get();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "tsc.h"
|
||||
|
||||
namespace skyline::gpu::interconnect {
|
||||
inline float preferredAnisotropy = 0.0f;
|
||||
class SamplerPoolState : dirty::CachedManualDirty, dirty::RefreshableManualDirty {
|
||||
public:
|
||||
struct EngineRegisters {
|
||||
|
@ -50,7 +50,7 @@ namespace skyline {
|
||||
* @param key A null terminated string containing the key of the setting to get
|
||||
*/
|
||||
template<typename T>
|
||||
requires std::is_integral_v<T> || std::is_enum_v<T>
|
||||
requires std::is_integral_v<T> || std::is_enum_v<T> || std::is_floating_point_v<T>
|
||||
T GetInt(const std::string_view &key) {
|
||||
return static_cast<T>(env->GetIntField(settingsInstance, env->GetFieldID(settingsClass, key.data(), "I")));
|
||||
}
|
||||
|
@ -210,6 +210,8 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
|
||||
|
||||
private external fun setAudioSink(sink: String)
|
||||
|
||||
private external fun setAnisotropicFilter(anisotropy: Float)
|
||||
|
||||
private var ambientJob: Job? = null
|
||||
private lateinit var ambientHelper: AmbientHelper
|
||||
|
||||
@ -379,6 +381,8 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
|
||||
}
|
||||
)
|
||||
|
||||
setAnisotropicFilter(emulationSettings.anisotropicFilter.toFloat())
|
||||
|
||||
lifecycleScope.launch(Dispatchers.Main) {
|
||||
lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
|
||||
WindowInfoTracker.getOrCreate(this@EmulationActivity)
|
||||
|
@ -44,6 +44,7 @@ class EmulationSettings private constructor(context : Context, prefName : String
|
||||
var enableFoldableLayout by sharedPreferences(context, false, prefName = prefName)
|
||||
var showPauseButton by sharedPreferences(context, false, prefName = prefName)
|
||||
var enableAmbientMode by sharedPreferences(context, false, prefName = prefName)
|
||||
var anisotropicFilter by sharedPreferences(context, 1, prefName = prefName)
|
||||
|
||||
// CPU
|
||||
var cpuBackend by sharedPreferences(context, 0, prefName = prefName)
|
||||
|
@ -108,11 +108,27 @@
|
||||
<item>8</item>
|
||||
</integer-array>
|
||||
<string-array name="vsync_modes">
|
||||
<item>Immediate (Off)</item>
|
||||
<item>Mailbox</item>
|
||||
<item>FIFO (On)</item>
|
||||
<item>FIFO (Relaxed)</item>
|
||||
</string-array>
|
||||
<item>Immediate (Off)</item>
|
||||
<item>Mailbox</item>
|
||||
<item>FIFO (On)</item>
|
||||
<item>FIFO (Relaxed)</item>
|
||||
</string-array>
|
||||
<string-array name="anisotropic_filters">
|
||||
<item>Off</item>
|
||||
<item>Auto</item>
|
||||
<item>2x</item>
|
||||
<item>4x</item>
|
||||
<item>8x</item>
|
||||
<item>16x</item>
|
||||
</string-array>
|
||||
<integer-array name="anisotropic_filters_values">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>4</item>
|
||||
<item>8</item>
|
||||
<item>16</item>
|
||||
</integer-array>
|
||||
<string-array name="credits_entries">
|
||||
<item>j0hnnybrav0</item>
|
||||
<item>Ell Jensen</item>
|
||||
|
@ -129,6 +129,7 @@
|
||||
<string name="show_pause_button_enabled">The pause button will be displayed</string>
|
||||
<string name="enable_ambient_mode">Enable Ambient Mode</string>
|
||||
<string name="enable_ambient_mode_desc">Ambient effect will be applied</string>
|
||||
<string name="anisotropic_filter">Anisotropic Filter</string>
|
||||
<!-- Settings - Audio -->
|
||||
<string name="audio">Audio</string>
|
||||
<string name="audio_output_engine">Output engine</string>
|
||||
|
@ -95,6 +95,13 @@
|
||||
android:summary="@string/enable_ambient_mode_desc"
|
||||
android:key="enable_ambient_mode"
|
||||
android:title="@string/enable_ambient_mode" />
|
||||
<emu.skyline.preference.IntegerListPreference
|
||||
android:defaultValue="1"
|
||||
android:entries="@array/anisotropic_filters"
|
||||
android:entryValues="@array/anisotropic_filters_values"
|
||||
app:key="anisotropic_filter"
|
||||
app:title="@string/anisotropic_filter"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:key="category_audio"
|
||||
|
Loading…
x
Reference in New Issue
Block a user