Compare commits
4 Commits
__refs_pul
...
__refs_pul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5105b90017 | ||
|
|
3516a2d0bf | ||
|
|
f224ef6185 | ||
|
|
a36f4d0a9f |
@@ -31,9 +31,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
android:dataExtractionRules="@xml/data_extraction_rules_api_31"
|
||||
android:enableOnBackInvokedCallback="true">
|
||||
|
||||
<meta-data android:name="android.game_mode_config"
|
||||
android:resource="@xml/game_mode_config" />
|
||||
|
||||
<activity
|
||||
android:name="org.yuzu.yuzu_emu.ui.main.MainActivity"
|
||||
android:exported="true"
|
||||
|
||||
@@ -547,15 +547,6 @@ object NativeLibrary {
|
||||
*/
|
||||
external fun getSavePath(programId: String): String
|
||||
|
||||
/**
|
||||
* Gets the root save directory for the default profile as either
|
||||
* /user/save/account/<user id raw string> or /user/save/000...000/<user id>
|
||||
*
|
||||
* @param future If true, returns the /user/save/account/... directory
|
||||
* @return Save data path that may not exist yet
|
||||
*/
|
||||
external fun getDefaultProfileSaveDataRoot(future: Boolean): String
|
||||
|
||||
/**
|
||||
* Adds a file to the manual filesystem provider in our EmulationSession instance
|
||||
* @param path Path to the file we're adding. Can be a string representation of a [Uri] or
|
||||
|
||||
@@ -7,39 +7,20 @@ import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.updatePadding
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.google.android.material.transition.MaterialSharedAxis
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.yuzu.yuzu_emu.NativeLibrary
|
||||
import org.yuzu.yuzu_emu.R
|
||||
import org.yuzu.yuzu_emu.YuzuApplication
|
||||
import org.yuzu.yuzu_emu.adapters.InstallableAdapter
|
||||
import org.yuzu.yuzu_emu.databinding.FragmentInstallablesBinding
|
||||
import org.yuzu.yuzu_emu.model.HomeViewModel
|
||||
import org.yuzu.yuzu_emu.model.Installable
|
||||
import org.yuzu.yuzu_emu.model.TaskState
|
||||
import org.yuzu.yuzu_emu.ui.main.MainActivity
|
||||
import org.yuzu.yuzu_emu.utils.DirectoryInitialization
|
||||
import org.yuzu.yuzu_emu.utils.FileUtil
|
||||
import java.io.BufferedInputStream
|
||||
import java.io.BufferedOutputStream
|
||||
import java.io.File
|
||||
import java.math.BigInteger
|
||||
import java.time.LocalDateTime
|
||||
import java.time.format.DateTimeFormatter
|
||||
|
||||
class InstallableFragment : Fragment() {
|
||||
private var _binding: FragmentInstallablesBinding? = null
|
||||
@@ -75,17 +56,6 @@ class InstallableFragment : Fragment() {
|
||||
binding.root.findNavController().popBackStack()
|
||||
}
|
||||
|
||||
viewLifecycleOwner.lifecycleScope.launch {
|
||||
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
||||
homeViewModel.openImportSaves.collect {
|
||||
if (it) {
|
||||
importSaves.launch(arrayOf("application/zip"))
|
||||
homeViewModel.setOpenImportSaves(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val installables = listOf(
|
||||
Installable(
|
||||
R.string.user_data,
|
||||
@@ -93,43 +63,6 @@ class InstallableFragment : Fragment() {
|
||||
install = { mainActivity.importUserData.launch(arrayOf("application/zip")) },
|
||||
export = { mainActivity.exportUserData.launch("export.zip") }
|
||||
),
|
||||
Installable(
|
||||
R.string.manage_save_data,
|
||||
R.string.manage_save_data_description,
|
||||
install = {
|
||||
MessageDialogFragment.newInstance(
|
||||
requireActivity(),
|
||||
titleId = R.string.import_save_warning,
|
||||
descriptionId = R.string.import_save_warning_description,
|
||||
positiveAction = { homeViewModel.setOpenImportSaves(true) }
|
||||
).show(parentFragmentManager, MessageDialogFragment.TAG)
|
||||
},
|
||||
export = {
|
||||
val oldSaveDataFolder = File(
|
||||
"${DirectoryInitialization.userDirectory}/nand" +
|
||||
NativeLibrary.getDefaultProfileSaveDataRoot(false)
|
||||
)
|
||||
val futureSaveDataFolder = File(
|
||||
"${DirectoryInitialization.userDirectory}/nand" +
|
||||
NativeLibrary.getDefaultProfileSaveDataRoot(true)
|
||||
)
|
||||
if (!oldSaveDataFolder.exists() && !futureSaveDataFolder.exists()) {
|
||||
Toast.makeText(
|
||||
YuzuApplication.appContext,
|
||||
R.string.no_save_data_found,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
return@Installable
|
||||
} else {
|
||||
exportSaves.launch(
|
||||
"${getString(R.string.save_data)} " +
|
||||
LocalDateTime.now().format(
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
),
|
||||
Installable(
|
||||
R.string.install_game_content,
|
||||
R.string.install_game_content_description,
|
||||
@@ -188,156 +121,4 @@ class InstallableFragment : Fragment() {
|
||||
|
||||
windowInsets
|
||||
}
|
||||
|
||||
private val importSaves =
|
||||
registerForActivityResult(ActivityResultContracts.OpenDocument()) { result ->
|
||||
if (result == null) {
|
||||
return@registerForActivityResult
|
||||
}
|
||||
|
||||
val inputZip = requireContext().contentResolver.openInputStream(result)
|
||||
val cacheSaveDir = File("${requireContext().cacheDir.path}/saves/")
|
||||
cacheSaveDir.mkdir()
|
||||
|
||||
if (inputZip == null) {
|
||||
Toast.makeText(
|
||||
YuzuApplication.appContext,
|
||||
getString(R.string.fatal_error),
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
return@registerForActivityResult
|
||||
}
|
||||
|
||||
IndeterminateProgressDialogFragment.newInstance(
|
||||
requireActivity(),
|
||||
R.string.save_files_importing,
|
||||
false
|
||||
) {
|
||||
try {
|
||||
FileUtil.unzipToInternalStorage(BufferedInputStream(inputZip), cacheSaveDir)
|
||||
val files = cacheSaveDir.listFiles()
|
||||
var successfulImports = 0
|
||||
var failedImports = 0
|
||||
if (files != null) {
|
||||
for (file in files) {
|
||||
if (file.isDirectory) {
|
||||
val baseSaveDir =
|
||||
NativeLibrary.getSavePath(BigInteger(file.name, 16).toString())
|
||||
if (baseSaveDir.isEmpty()) {
|
||||
failedImports++
|
||||
continue
|
||||
}
|
||||
|
||||
val internalSaveFolder = File(
|
||||
"${DirectoryInitialization.userDirectory}/nand$baseSaveDir"
|
||||
)
|
||||
internalSaveFolder.deleteRecursively()
|
||||
internalSaveFolder.mkdir()
|
||||
file.copyRecursively(target = internalSaveFolder, overwrite = true)
|
||||
successfulImports++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
withContext(Dispatchers.Main) {
|
||||
if (successfulImports == 0) {
|
||||
MessageDialogFragment.newInstance(
|
||||
requireActivity(),
|
||||
titleId = R.string.save_file_invalid_zip_structure,
|
||||
descriptionId = R.string.save_file_invalid_zip_structure_description
|
||||
).show(parentFragmentManager, MessageDialogFragment.TAG)
|
||||
return@withContext
|
||||
}
|
||||
val successString = if (failedImports > 0) {
|
||||
"""
|
||||
${
|
||||
requireContext().resources.getQuantityString(
|
||||
R.plurals.saves_import_success,
|
||||
successfulImports,
|
||||
successfulImports
|
||||
)
|
||||
}
|
||||
${
|
||||
requireContext().resources.getQuantityString(
|
||||
R.plurals.saves_import_failed,
|
||||
failedImports,
|
||||
failedImports
|
||||
)
|
||||
}
|
||||
"""
|
||||
} else {
|
||||
requireContext().resources.getQuantityString(
|
||||
R.plurals.saves_import_success,
|
||||
successfulImports,
|
||||
successfulImports
|
||||
)
|
||||
}
|
||||
MessageDialogFragment.newInstance(
|
||||
requireActivity(),
|
||||
titleId = R.string.import_complete,
|
||||
descriptionString = successString
|
||||
).show(parentFragmentManager, MessageDialogFragment.TAG)
|
||||
}
|
||||
|
||||
cacheSaveDir.deleteRecursively()
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(
|
||||
YuzuApplication.appContext,
|
||||
getString(R.string.fatal_error),
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
}.show(parentFragmentManager, IndeterminateProgressDialogFragment.TAG)
|
||||
}
|
||||
|
||||
private val exportSaves = registerForActivityResult(
|
||||
ActivityResultContracts.CreateDocument("application/zip")
|
||||
) { result ->
|
||||
if (result == null) {
|
||||
return@registerForActivityResult
|
||||
}
|
||||
|
||||
IndeterminateProgressDialogFragment.newInstance(
|
||||
requireActivity(),
|
||||
R.string.save_files_exporting,
|
||||
false
|
||||
) {
|
||||
val cacheSaveDir = File("${requireContext().cacheDir.path}/saves/")
|
||||
cacheSaveDir.mkdir()
|
||||
|
||||
val oldSaveDataFolder = File(
|
||||
"${DirectoryInitialization.userDirectory}/nand" +
|
||||
NativeLibrary.getDefaultProfileSaveDataRoot(false)
|
||||
)
|
||||
if (oldSaveDataFolder.exists()) {
|
||||
oldSaveDataFolder.copyRecursively(cacheSaveDir)
|
||||
}
|
||||
|
||||
val futureSaveDataFolder = File(
|
||||
"${DirectoryInitialization.userDirectory}/nand" +
|
||||
NativeLibrary.getDefaultProfileSaveDataRoot(true)
|
||||
)
|
||||
if (futureSaveDataFolder.exists()) {
|
||||
futureSaveDataFolder.copyRecursively(cacheSaveDir)
|
||||
}
|
||||
|
||||
val saveFilesTotal = cacheSaveDir.listFiles()?.size ?: 0
|
||||
if (saveFilesTotal == 0) {
|
||||
cacheSaveDir.deleteRecursively()
|
||||
return@newInstance getString(R.string.no_save_data_found)
|
||||
}
|
||||
|
||||
val zipResult = FileUtil.zipFromInternalStorage(
|
||||
cacheSaveDir,
|
||||
cacheSaveDir.path,
|
||||
BufferedOutputStream(requireContext().contentResolver.openOutputStream(result))
|
||||
)
|
||||
cacheSaveDir.deleteRecursively()
|
||||
|
||||
return@newInstance when (zipResult) {
|
||||
TaskState.Completed -> getString(R.string.export_success)
|
||||
TaskState.Cancelled, TaskState.Failed -> getString(R.string.export_failed)
|
||||
}
|
||||
}.show(parentFragmentManager, IndeterminateProgressDialogFragment.TAG)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -862,9 +862,6 @@ jobjectArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getAddonsForFile(JNIEnv* env,
|
||||
jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getSavePath(JNIEnv* env, jobject jobj,
|
||||
jstring jprogramId) {
|
||||
auto program_id = EmulationSession::GetProgramId(env, jprogramId);
|
||||
if (program_id == 0) {
|
||||
return ToJString(env, "");
|
||||
}
|
||||
|
||||
auto& system = EmulationSession::GetInstance().System();
|
||||
|
||||
@@ -883,19 +880,6 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getSavePath(JNIEnv* env, jobject j
|
||||
return ToJString(env, user_save_data_path);
|
||||
}
|
||||
|
||||
jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getDefaultProfileSaveDataRoot(JNIEnv* env,
|
||||
jobject jobj,
|
||||
jboolean jfuture) {
|
||||
Service::Account::ProfileManager manager;
|
||||
// TODO: Pass in a selected user once we get the relevant UI working
|
||||
const auto user_id = manager.GetUser(static_cast<std::size_t>(0));
|
||||
ASSERT(user_id);
|
||||
|
||||
const auto user_save_data_root =
|
||||
FileSys::SaveDataFactory::GetUserGameSaveDataRoot(user_id->AsU128(), jfuture);
|
||||
return ToJString(env, user_save_data_root);
|
||||
}
|
||||
|
||||
void Java_org_yuzu_yuzu_1emu_NativeLibrary_addFileToFilesystemProvider(JNIEnv* env, jobject jobj,
|
||||
jstring jpath) {
|
||||
EmulationSession::GetInstance().ConfigureFilesystemProvider(GetJString(env, jpath));
|
||||
|
||||
@@ -133,15 +133,6 @@
|
||||
<string name="add_game_folder">Add game folder</string>
|
||||
<string name="folder_already_added">This folder was already added!</string>
|
||||
<string name="game_folder_properties">Game folder properties</string>
|
||||
<plurals name="saves_import_failed">
|
||||
<item quantity="one">Failed to import %d save</item>
|
||||
<item quantity="other">Failed to import %d saves</item>
|
||||
</plurals>
|
||||
<plurals name="saves_import_success">
|
||||
<item quantity="one">Successfully imported %d save</item>
|
||||
<item quantity="other">Successfully imported %d saves</item>
|
||||
</plurals>
|
||||
<string name="no_save_data_found">No save data found</string>
|
||||
|
||||
<!-- Applet launcher strings -->
|
||||
<string name="applets">Applet launcher</string>
|
||||
@@ -285,7 +276,6 @@
|
||||
<string name="global">Global</string>
|
||||
<string name="custom">Custom</string>
|
||||
<string name="notice">Notice</string>
|
||||
<string name="import_complete">Import complete</string>
|
||||
|
||||
<!-- GPU driver installation -->
|
||||
<string name="select_gpu_driver">Select GPU driver</string>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<game-mode-config
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:supportsBatteryGameMode="true"
|
||||
android:supportsPerformanceGameMode="true"
|
||||
android:allowGameDownscaling="false"
|
||||
android:allowGameFpsOverride="false"/>
|
||||
@@ -189,15 +189,6 @@ std::string SaveDataFactory::GetFullPath(Core::System& system, VirtualDir dir,
|
||||
}
|
||||
}
|
||||
|
||||
std::string SaveDataFactory::GetUserGameSaveDataRoot(u128 user_id, bool future) {
|
||||
if (future) {
|
||||
Common::UUID uuid;
|
||||
std::memcpy(uuid.uuid.data(), user_id.data(), sizeof(Common::UUID));
|
||||
return fmt::format("/user/save/account/{}", uuid.RawString());
|
||||
}
|
||||
return fmt::format("/user/save/{:016X}/{:016X}{:016X}", 0, user_id[1], user_id[0]);
|
||||
}
|
||||
|
||||
SaveDataSize SaveDataFactory::ReadSaveDataSize(SaveDataType type, u64 title_id,
|
||||
u128 user_id) const {
|
||||
const auto path =
|
||||
|
||||
@@ -101,7 +101,6 @@ public:
|
||||
static std::string GetSaveDataSpaceIdPath(SaveDataSpaceId space);
|
||||
static std::string GetFullPath(Core::System& system, VirtualDir dir, SaveDataSpaceId space,
|
||||
SaveDataType type, u64 title_id, u128 user_id, u64 save_id);
|
||||
static std::string GetUserGameSaveDataRoot(u128 user_id, bool future);
|
||||
|
||||
SaveDataSize ReadSaveDataSize(SaveDataType type, u64 title_id, u128 user_id) const;
|
||||
void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id,
|
||||
|
||||
@@ -1444,8 +1444,8 @@ void IHidServer::SetNpadAnalogStickUseCenterClamp(HLERequestContext& ctx) {
|
||||
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, use_center_clamp={}, applet_resource_user_id={}",
|
||||
parameters.use_center_clamp, parameters.applet_resource_user_id);
|
||||
LOG_INFO(Service_HID, "called, use_center_clamp={}, applet_resource_user_id={}",
|
||||
parameters.use_center_clamp, parameters.applet_resource_user_id);
|
||||
|
||||
GetResourceManager()->GetNpad()->SetNpadAnalogStickUseCenterClamp(
|
||||
parameters.applet_resource_user_id, parameters.use_center_clamp);
|
||||
@@ -1466,23 +1466,27 @@ void IHidServer::SetNpadCaptureButtonAssignment(HLERequestContext& ctx) {
|
||||
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
LOG_WARNING(Service_HID,
|
||||
"(STUBBED) called, npad_styleset={}, applet_resource_user_id={}, button={}",
|
||||
parameters.npad_styleset, parameters.applet_resource_user_id, parameters.button);
|
||||
LOG_INFO(Service_HID, "called, npad_styleset={}, applet_resource_user_id={}, button={}",
|
||||
parameters.npad_styleset, parameters.applet_resource_user_id, parameters.button);
|
||||
|
||||
const auto result = GetResourceManager()->GetNpad()->SetNpadCaptureButtonAssignment(
|
||||
parameters.applet_resource_user_id, parameters.npad_styleset, parameters.button);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::ClearNpadCaptureButtonAssignment(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}",
|
||||
applet_resource_user_id);
|
||||
LOG_INFO(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetNpad()->ClearNpadCaptureButtonAssignment(applet_resource_user_id);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::GetVibrationDeviceInfo(HLERequestContext& ctx) {
|
||||
|
||||
@@ -46,7 +46,7 @@ IHidSystemServer::IHidSystemServer(Core::System& system_, std::shared_ptr<Resour
|
||||
{310, &IHidSystemServer::GetMaskedSupportedNpadStyleSet, "GetMaskedSupportedNpadStyleSet"},
|
||||
{311, nullptr, "SetNpadPlayerLedBlinkingDevice"},
|
||||
{312, &IHidSystemServer::SetSupportedNpadStyleSetAll, "SetSupportedNpadStyleSetAll"},
|
||||
{313, nullptr, "GetNpadCaptureButtonAssignment"},
|
||||
{313, &IHidSystemServer::GetNpadCaptureButtonAssignment, "GetNpadCaptureButtonAssignment"},
|
||||
{314, nullptr, "GetAppletFooterUiType"},
|
||||
{315, &IHidSystemServer::GetAppletDetailedUiType, "GetAppletDetailedUiType"},
|
||||
{316, &IHidSystemServer::GetNpadInterfaceType, "GetNpadInterfaceType"},
|
||||
@@ -54,8 +54,8 @@ IHidSystemServer::IHidSystemServer(Core::System& system_, std::shared_ptr<Resour
|
||||
{318, &IHidSystemServer::HasBattery, "HasBattery"},
|
||||
{319, &IHidSystemServer::HasLeftRightBattery, "HasLeftRightBattery"},
|
||||
{321, &IHidSystemServer::GetUniquePadsFromNpad, "GetUniquePadsFromNpad"},
|
||||
{322, &IHidSystemServer::GetIrSensorState, "GetIrSensorState"},
|
||||
{323, nullptr, "GetXcdHandleForNpadWithIrSensor"},
|
||||
{322, &IHidSystemServer::SetNpadSystemExtStateEnabled, "SetNpadSystemExtStateEnabled"},
|
||||
{323, nullptr, "GetLastActiveUniquePad"},
|
||||
{324, nullptr, "GetUniquePadButtonSet"},
|
||||
{325, nullptr, "GetUniquePadColor"},
|
||||
{326, nullptr, "GetUniquePadAppletDetailedUiType"},
|
||||
@@ -251,25 +251,38 @@ void IHidSystemServer::ApplyNpadSystemCommonPolicy(HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void IHidSystemServer::EnableAssigningSingleOnSlSrPress(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||
|
||||
LOG_INFO(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
|
||||
|
||||
GetResourceManager()->GetNpad()->AssigningSingleOnSlSrPress(applet_resource_user_id, true);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidSystemServer::DisableAssigningSingleOnSlSrPress(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||
|
||||
LOG_INFO(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
|
||||
|
||||
GetResourceManager()->GetNpad()->AssigningSingleOnSlSrPress(applet_resource_user_id, false);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidSystemServer::GetLastActiveNpad(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_HID, "(STUBBED) called"); // Spams a lot when controller applet is running
|
||||
Core::HID::NpadIdType npad_id{};
|
||||
const Result result = GetResourceManager()->GetNpad()->GetLastActiveNpad(npad_id);
|
||||
|
||||
LOG_DEBUG(Service_HID, "called, npad_id={}", npad_id);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(0); // Dont forget to fix this
|
||||
rb.Push(result);
|
||||
rb.PushEnum(npad_id);
|
||||
}
|
||||
|
||||
void IHidSystemServer::ApplyNpadSystemCommonPolicyFull(HLERequestContext& ctx) {
|
||||
@@ -331,6 +344,27 @@ void IHidSystemServer::SetSupportedNpadStyleSetAll(HLERequestContext& ctx) {
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidSystemServer::GetNpadCaptureButtonAssignment(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||
const auto capture_button_list_size{ctx.GetWriteBufferNumElements<Core::HID::NpadButton>()};
|
||||
|
||||
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
|
||||
|
||||
std::vector<Core::HID::NpadButton> capture_button_list(capture_button_list_size);
|
||||
const auto& npad = GetResourceManager()->GetNpad();
|
||||
const u64 list_size =
|
||||
npad->GetNpadCaptureButtonAssignment(capture_button_list, applet_resource_user_id);
|
||||
|
||||
if (list_size != 0) {
|
||||
ctx.WriteBuffer(capture_button_list);
|
||||
}
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(list_size);
|
||||
}
|
||||
|
||||
void IHidSystemServer::GetAppletDetailedUiType(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto npad_id_type{rp.PopEnum<Core::HID::NpadIdType>()};
|
||||
@@ -423,13 +457,25 @@ void IHidSystemServer::GetUniquePadsFromNpad(HLERequestContext& ctx) {
|
||||
rb.Push(static_cast<u32>(unique_pads.size()));
|
||||
}
|
||||
|
||||
void IHidSystemServer::GetIrSensorState(HLERequestContext& ctx) {
|
||||
void IHidSystemServer::SetNpadSystemExtStateEnabled(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
struct Parameters {
|
||||
bool is_enabled;
|
||||
INSERT_PADDING_BYTES_NOINIT(7);
|
||||
u64 applet_resource_user_id;
|
||||
};
|
||||
static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size.");
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
LOG_INFO(Service_HID, "called, is_enabled={}, applet_resource_user_id={}",
|
||||
parameters.is_enabled, parameters.applet_resource_user_id);
|
||||
|
||||
const auto result = GetResourceManager()->GetNpad()->SetNpadSystemExtStateEnabled(
|
||||
parameters.applet_resource_user_id, parameters.is_enabled);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(result);
|
||||
}
|
||||
void IHidSystemServer::RegisterAppletResourceUserId(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
@@ -31,13 +31,14 @@ private:
|
||||
void GetNpadFullKeyGripColor(HLERequestContext& ctx);
|
||||
void GetMaskedSupportedNpadStyleSet(HLERequestContext& ctx);
|
||||
void SetSupportedNpadStyleSetAll(HLERequestContext& ctx);
|
||||
void GetNpadCaptureButtonAssignment(HLERequestContext& ctx);
|
||||
void GetAppletDetailedUiType(HLERequestContext& ctx);
|
||||
void GetNpadInterfaceType(HLERequestContext& ctx);
|
||||
void GetNpadLeftRightInterfaceType(HLERequestContext& ctx);
|
||||
void HasBattery(HLERequestContext& ctx);
|
||||
void HasLeftRightBattery(HLERequestContext& ctx);
|
||||
void GetUniquePadsFromNpad(HLERequestContext& ctx);
|
||||
void GetIrSensorState(HLERequestContext& ctx);
|
||||
void SetNpadSystemExtStateEnabled(HLERequestContext& ctx);
|
||||
void RegisterAppletResourceUserId(HLERequestContext& ctx);
|
||||
void UnregisterAppletResourceUserId(HLERequestContext& ctx);
|
||||
void EnableAppletToGetInput(HLERequestContext& ctx);
|
||||
|
||||
@@ -870,11 +870,6 @@ void NPad::InitializeVibrationDevice(
|
||||
const auto aruid = applet_resource_holder.applet_resource->GetActiveAruid();
|
||||
const auto npad_index = static_cast<Core::HID::NpadIdType>(vibration_device_handle.npad_id);
|
||||
const auto device_index = static_cast<std::size_t>(vibration_device_handle.device_index);
|
||||
|
||||
if (aruid == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
InitializeVibrationDeviceAtIndex(aruid, npad_index, device_index);
|
||||
}
|
||||
|
||||
@@ -1344,4 +1339,49 @@ AppletDetailedUiType NPad::GetAppletDetailedUiType(Core::HID::NpadIdType npad_id
|
||||
};
|
||||
}
|
||||
|
||||
Result NPad::SetNpadCaptureButtonAssignment(u64 aruid, Core::HID::NpadStyleSet npad_style_set,
|
||||
Core::HID::NpadButton button_assignment) {
|
||||
std::scoped_lock lock{mutex};
|
||||
return npad_resource.SetNpadCaptureButtonAssignment(aruid, npad_style_set, button_assignment);
|
||||
}
|
||||
|
||||
Result NPad::ClearNpadCaptureButtonAssignment(u64 aruid) {
|
||||
std::scoped_lock lock{mutex};
|
||||
return npad_resource.ClearNpadCaptureButtonAssignment(aruid);
|
||||
}
|
||||
|
||||
std::size_t NPad::GetNpadCaptureButtonAssignment(std::span<Core::HID::NpadButton> out_list,
|
||||
u64 aruid) const {
|
||||
std::scoped_lock lock{mutex};
|
||||
return npad_resource.GetNpadCaptureButtonAssignment(out_list, aruid);
|
||||
}
|
||||
|
||||
Result NPad::SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled) {
|
||||
std::scoped_lock lock{mutex};
|
||||
const auto result = npad_resource.SetNpadSystemExtStateEnabled(aruid, is_enabled);
|
||||
|
||||
if (result.IsSuccess()) {
|
||||
std::scoped_lock shared_lock{*applet_resource_holder.shared_mutex};
|
||||
// TODO: abstracted_pad->EnableAppletToGetInput(aruid);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Result NPad::AssigningSingleOnSlSrPress(u64 aruid, bool is_enabled) {
|
||||
std::scoped_lock lock{mutex};
|
||||
bool is_currently_enabled{};
|
||||
Result result = npad_resource.IsAssigningSingleOnSlSrPressEnabled(is_currently_enabled, aruid);
|
||||
if (result.IsSuccess() && is_enabled != is_currently_enabled) {
|
||||
result = npad_resource.SetAssigningSingleOnSlSrPress(aruid, is_enabled);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Result NPad::GetLastActiveNpad(Core::HID::NpadIdType& out_npad_id) const {
|
||||
std::scoped_lock lock{mutex};
|
||||
out_npad_id = hid_core.GetLastActiveController();
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
} // namespace Service::HID
|
||||
|
||||
@@ -149,6 +149,18 @@ public:
|
||||
|
||||
AppletDetailedUiType GetAppletDetailedUiType(Core::HID::NpadIdType npad_id);
|
||||
|
||||
Result SetNpadCaptureButtonAssignment(u64 aruid, Core::HID::NpadStyleSet npad_style_set,
|
||||
Core::HID::NpadButton button_assignment);
|
||||
Result ClearNpadCaptureButtonAssignment(u64 aruid);
|
||||
std::size_t GetNpadCaptureButtonAssignment(std::span<Core::HID::NpadButton> out_list,
|
||||
u64 aruid) const;
|
||||
|
||||
Result SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled);
|
||||
|
||||
Result AssigningSingleOnSlSrPress(u64 aruid, bool is_enabled);
|
||||
|
||||
Result GetLastActiveNpad(Core::HID::NpadIdType& out_npad_id) const;
|
||||
|
||||
private:
|
||||
struct VibrationData {
|
||||
bool device_mounted{};
|
||||
|
||||
@@ -59,8 +59,8 @@ public:
|
||||
return start_address;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsProprietaryDriver() const noexcept {
|
||||
return is_proprietary_driver;
|
||||
[[nodiscard]] bool IsPropietaryDriver() const noexcept {
|
||||
return is_propietary_driver;
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -68,7 +68,7 @@ protected:
|
||||
std::array<u32, 8> gp_passthrough_mask{};
|
||||
Stage stage{};
|
||||
u32 start_address{};
|
||||
bool is_proprietary_driver{};
|
||||
bool is_propietary_driver{};
|
||||
};
|
||||
|
||||
} // namespace Shader
|
||||
|
||||
@@ -1084,7 +1084,7 @@ void ConstantPropagation(Environment& env, IR::Block& block, IR::Inst& inst) {
|
||||
if (env.HasHLEMacroState()) {
|
||||
FoldConstBuffer(env, block, inst);
|
||||
}
|
||||
if (env.IsProprietaryDriver()) {
|
||||
if (env.IsPropietaryDriver()) {
|
||||
FoldDriverConstBuffer(env, block, inst, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -267,10 +267,10 @@ private:
|
||||
top_tier[page_index] = GetNewManager(base_cpu_addr);
|
||||
}
|
||||
|
||||
Manager* GetNewManager(VAddr base_cpu_address) {
|
||||
Manager* GetNewManager(VAddr base_cpu_addess) {
|
||||
const auto on_return = [&] {
|
||||
auto* new_manager = free_managers.front();
|
||||
new_manager->SetCpuAddress(base_cpu_address);
|
||||
new_manager->SetCpuAddress(base_cpu_addess);
|
||||
free_managers.pop_front();
|
||||
return new_manager;
|
||||
};
|
||||
|
||||
@@ -85,12 +85,12 @@ protected:
|
||||
std::deque<size_t> free_channel_ids;
|
||||
std::unordered_map<s32, size_t> channel_map;
|
||||
std::vector<size_t> active_channel_ids;
|
||||
struct AddressSpaceRef {
|
||||
struct AddresSpaceRef {
|
||||
size_t ref_count;
|
||||
size_t storage_id;
|
||||
Tegra::MemoryManager* gpu_memory;
|
||||
};
|
||||
std::unordered_map<size_t, AddressSpaceRef> address_spaces;
|
||||
std::unordered_map<size_t, AddresSpaceRef> address_spaces;
|
||||
mutable std::mutex config_mutex;
|
||||
|
||||
virtual void OnGPUASRegister([[maybe_unused]] size_t map_id) {}
|
||||
|
||||
@@ -38,7 +38,7 @@ void ChannelSetupCaches<P>::CreateChannel(struct Tegra::Control::ChannelState& c
|
||||
as_it->second.ref_count++;
|
||||
return;
|
||||
}
|
||||
AddressSpaceRef new_gpu_mem_ref{
|
||||
AddresSpaceRef new_gpu_mem_ref{
|
||||
.ref_count = 1,
|
||||
.storage_id = address_spaces.size(),
|
||||
.gpu_memory = channel.memory_manager.get(),
|
||||
|
||||
@@ -958,7 +958,7 @@ public:
|
||||
enum class ClearReport : u32 {
|
||||
ZPassPixelCount = 0x01,
|
||||
ZCullStats = 0x02,
|
||||
StreamingPrimitivesNeededMinusSucceeded = 0x03,
|
||||
StreamingPrimitvesNeededMinusSucceeded = 0x03,
|
||||
AlphaBetaClocks = 0x04,
|
||||
StreamingPrimitivesSucceeded = 0x10,
|
||||
StreamingPrimitivesNeeded = 0x11,
|
||||
@@ -2383,8 +2383,8 @@ public:
|
||||
};
|
||||
|
||||
enum class Release : u32 {
|
||||
AfterAllPrecedingReads = 0,
|
||||
AfterAllPrecedingWrites = 1,
|
||||
AfterAllPreceedingReads = 0,
|
||||
AfterAllPreceedingWrites = 1,
|
||||
};
|
||||
|
||||
enum class Acquire : u32 {
|
||||
@@ -2869,7 +2869,7 @@ public:
|
||||
u32 global_base_instance_index; ///< 0x1438
|
||||
INSERT_PADDING_BYTES_NOINIT(0x14);
|
||||
RegisterWatermarks ps_warp_watermarks; ///< 0x1450
|
||||
RegisterWatermarks ps_register_watermarks; ///< 0x1454
|
||||
RegisterWatermarks ps_regster_watermarks; ///< 0x1454
|
||||
INSERT_PADDING_BYTES_NOINIT(0xC);
|
||||
u32 store_zcull; ///< 0x1464
|
||||
INSERT_PADDING_BYTES_NOINIT(0x18);
|
||||
@@ -3444,7 +3444,7 @@ ASSERT_REG_POSITION(invalidate_texture_header_cache_no_wfi, 0x1428);
|
||||
ASSERT_REG_POSITION(global_base_vertex_index, 0x1434);
|
||||
ASSERT_REG_POSITION(global_base_instance_index, 0x1438);
|
||||
ASSERT_REG_POSITION(ps_warp_watermarks, 0x1450);
|
||||
ASSERT_REG_POSITION(ps_register_watermarks, 0x1454);
|
||||
ASSERT_REG_POSITION(ps_regster_watermarks, 0x1454);
|
||||
ASSERT_REG_POSITION(store_zcull, 0x1464);
|
||||
ASSERT_REG_POSITION(iterated_blend_constants, 0x1480);
|
||||
ASSERT_REG_POSITION(load_zcull, 0x1500);
|
||||
|
||||
@@ -171,12 +171,12 @@ bool SoftwareBlitEngine::Blit(Fermi2D::Surface& src, Fermi2D::Surface& dst,
|
||||
const bool no_passthrough =
|
||||
src.format != dst.format || src_extent_x != dst_extent_x || src_extent_y != dst_extent_y;
|
||||
|
||||
const auto conversion_phase_same_format = [&]() {
|
||||
const auto convertion_phase_same_format = [&]() {
|
||||
NearestNeighbor(impl->src_buffer, impl->dst_buffer, src_extent_x, src_extent_y,
|
||||
dst_extent_x, dst_extent_y, dst_bytes_per_pixel);
|
||||
};
|
||||
|
||||
const auto conversion_phase_ir = [&]() {
|
||||
const auto convertion_phase_ir = [&]() {
|
||||
auto* input_converter = impl->converter_factory.GetFormatConverter(src.format);
|
||||
impl->intermediate_src.resize_destructive((src_copy_size / src_bytes_per_pixel) *
|
||||
ir_components);
|
||||
@@ -211,9 +211,9 @@ bool SoftwareBlitEngine::Blit(Fermi2D::Surface& src, Fermi2D::Surface& dst,
|
||||
// Conversion Phase
|
||||
if (no_passthrough) {
|
||||
if (src.format != dst.format || config.filter == Fermi2D::Filter::Bilinear) {
|
||||
conversion_phase_ir();
|
||||
convertion_phase_ir();
|
||||
} else {
|
||||
conversion_phase_same_format();
|
||||
convertion_phase_same_format();
|
||||
}
|
||||
} else {
|
||||
impl->dst_buffer.swap(impl->src_buffer);
|
||||
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
u8 raw;
|
||||
BitField<0, 2, u8> tile_format;
|
||||
BitField<2, 3, u8> gob_height;
|
||||
BitField<5, 3, u8> reserved_surface_format;
|
||||
BitField<5, 3, u8> reserverd_surface_format;
|
||||
};
|
||||
u8 error_conceal_on; // 1: error conceal on; 0: off
|
||||
u32 first_part_size; // the size of first partition(frame header and mb header partition)
|
||||
|
||||
@@ -803,7 +803,7 @@ void UnquantizeTexelWeights(uvec2 size, bool is_dual_plane) {
|
||||
}
|
||||
}
|
||||
|
||||
uint GetUnquantizedTexelWeight(uint offset_base, uint plane, bool is_dual_plane) {
|
||||
uint GetUnquantizedTexelWieght(uint offset_base, uint plane, bool is_dual_plane) {
|
||||
const uint offset = is_dual_plane ? 2 * offset_base + plane : offset_base;
|
||||
return result_vector[offset];
|
||||
}
|
||||
@@ -833,23 +833,23 @@ uvec4 GetUnquantizedWeightVector(uint t, uint s, uvec2 size, uint plane_index, b
|
||||
|
||||
if (v0 < area) {
|
||||
const uint offset_base = v0;
|
||||
p0.x = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane);
|
||||
p1.x = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane);
|
||||
p0.x = GetUnquantizedTexelWieght(offset_base, 0, is_dual_plane);
|
||||
p1.x = GetUnquantizedTexelWieght(offset_base, 1, is_dual_plane);
|
||||
}
|
||||
if ((v0 + 1) < (area)) {
|
||||
const uint offset_base = v0 + 1;
|
||||
p0.y = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane);
|
||||
p1.y = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane);
|
||||
p0.y = GetUnquantizedTexelWieght(offset_base, 0, is_dual_plane);
|
||||
p1.y = GetUnquantizedTexelWieght(offset_base, 1, is_dual_plane);
|
||||
}
|
||||
if ((v0 + size.x) < (area)) {
|
||||
const uint offset_base = v0 + size.x;
|
||||
p0.z = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane);
|
||||
p1.z = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane);
|
||||
p0.z = GetUnquantizedTexelWieght(offset_base, 0, is_dual_plane);
|
||||
p1.z = GetUnquantizedTexelWieght(offset_base, 1, is_dual_plane);
|
||||
}
|
||||
if ((v0 + size.x + 1) < (area)) {
|
||||
const uint offset_base = v0 + size.x + 1;
|
||||
p0.w = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane);
|
||||
p1.w = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane);
|
||||
p0.w = GetUnquantizedTexelWieght(offset_base, 0, is_dual_plane);
|
||||
p1.w = GetUnquantizedTexelWieght(offset_base, 1, is_dual_plane);
|
||||
}
|
||||
|
||||
const uint primary_weight = (uint(dot(p0, w)) + 8) >> 4;
|
||||
|
||||
@@ -269,7 +269,7 @@ void QueryCacheBase<Traits>::CounterReport(GPUVAddr addr, QueryType counter_type
|
||||
ASSERT(false);
|
||||
return;
|
||||
}
|
||||
query_base->value += streamer->GetAmendValue();
|
||||
query_base->value += streamer->GetAmmendValue();
|
||||
streamer->SetAccumulationValue(query_base->value);
|
||||
if (True(query_base->flags & QueryFlagBits::HasTimestamp)) {
|
||||
u64 timestamp = impl->gpu.GetTicks();
|
||||
|
||||
@@ -78,12 +78,12 @@ public:
|
||||
return dependence_mask;
|
||||
}
|
||||
|
||||
u64 GetAmendValue() const {
|
||||
return amend_value;
|
||||
u64 GetAmmendValue() const {
|
||||
return ammend_value;
|
||||
}
|
||||
|
||||
void SetAccumulationValue(u64 new_value) {
|
||||
accumulation_value = new_value;
|
||||
acumulation_value = new_value;
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -95,8 +95,8 @@ protected:
|
||||
const size_t id;
|
||||
u64 dependence_mask;
|
||||
u64 dependent_mask;
|
||||
u64 amend_value{};
|
||||
u64 accumulation_value{};
|
||||
u64 ammend_value{};
|
||||
u64 acumulation_value{};
|
||||
};
|
||||
|
||||
template <typename QueryType>
|
||||
|
||||
@@ -231,10 +231,10 @@ void FixedPipelineState::DynamicState::Refresh(const Maxwell& regs) {
|
||||
|
||||
void FixedPipelineState::DynamicState::Refresh2(const Maxwell& regs,
|
||||
Maxwell::PrimitiveTopology topology_,
|
||||
bool base_features_supported) {
|
||||
bool base_feautures_supported) {
|
||||
logic_op.Assign(PackLogicOp(regs.logic_op.op));
|
||||
|
||||
if (base_features_supported) {
|
||||
if (base_feautures_supported) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ struct FixedPipelineState {
|
||||
|
||||
void Refresh(const Maxwell& regs);
|
||||
void Refresh2(const Maxwell& regs, Maxwell::PrimitiveTopology topology,
|
||||
bool base_features_supported);
|
||||
bool base_feautures_supported);
|
||||
void Refresh3(const Maxwell& regs);
|
||||
|
||||
Maxwell::ComparisonOp DepthTestFunc() const noexcept {
|
||||
|
||||
@@ -130,7 +130,7 @@ private:
|
||||
vk::DescriptorPool descriptor_pool;
|
||||
vk::DescriptorSetLayout descriptor_set_layout;
|
||||
vk::PipelineLayout pipeline_layout;
|
||||
vk::Pipeline nearest_neighbor_pipeline;
|
||||
vk::Pipeline nearest_neightbor_pipeline;
|
||||
vk::Pipeline bilinear_pipeline;
|
||||
vk::Pipeline bicubic_pipeline;
|
||||
vk::Pipeline gaussian_pipeline;
|
||||
|
||||
@@ -120,8 +120,8 @@ public:
|
||||
scheduler{scheduler_}, memory_allocator{memory_allocator_} {
|
||||
current_bank = nullptr;
|
||||
current_query = nullptr;
|
||||
amend_value = 0;
|
||||
accumulation_value = 0;
|
||||
ammend_value = 0;
|
||||
acumulation_value = 0;
|
||||
queries_prefix_scan_pass = std::make_unique<QueriesPrefixScanPass>(
|
||||
device, scheduler, descriptor_pool, compute_pass_descriptor_queue);
|
||||
|
||||
@@ -176,8 +176,8 @@ public:
|
||||
}
|
||||
AbandonCurrentQuery();
|
||||
std::function<void()> func([this, counts = pending_flush_queries.size()] {
|
||||
amend_value = 0;
|
||||
accumulation_value = 0;
|
||||
ammend_value = 0;
|
||||
acumulation_value = 0;
|
||||
});
|
||||
rasterizer->SyncOperation(std::move(func));
|
||||
accumulation_since_last_sync = false;
|
||||
@@ -307,7 +307,7 @@ public:
|
||||
}
|
||||
|
||||
ReplicateCurrentQueryIfNeeded();
|
||||
std::function<void()> func([this] { amend_value = accumulation_value; });
|
||||
std::function<void()> func([this] { ammend_value = acumulation_value; });
|
||||
rasterizer->SyncOperation(std::move(func));
|
||||
AbandonCurrentQuery();
|
||||
num_slots_used = 0;
|
||||
@@ -512,7 +512,7 @@ private:
|
||||
pending_flush_queries.push_back(index);
|
||||
std::function<void()> func([this, index] {
|
||||
auto* query = GetQuery(index);
|
||||
query->value += GetAmendValue();
|
||||
query->value += GetAmmendValue();
|
||||
SetAccumulationValue(query->value);
|
||||
Free(index);
|
||||
});
|
||||
@@ -1169,7 +1169,7 @@ struct QueryCacheRuntimeImpl {
|
||||
primitives_succeeded_streamer(
|
||||
static_cast<size_t>(QueryType::StreamingPrimitivesSucceeded), runtime, tfb_streamer,
|
||||
cpu_memory_),
|
||||
primitives_needed_minus_succeeded_streamer(
|
||||
primitives_needed_minus_suceeded_streamer(
|
||||
static_cast<size_t>(QueryType::StreamingPrimitivesNeededMinusSucceeded), runtime, 0u),
|
||||
hcr_setup{}, hcr_is_set{}, is_hcr_running{}, maxwell3d{} {
|
||||
|
||||
@@ -1208,7 +1208,7 @@ struct QueryCacheRuntimeImpl {
|
||||
SamplesStreamer sample_streamer;
|
||||
TFBCounterStreamer tfb_streamer;
|
||||
PrimitivesSucceededStreamer primitives_succeeded_streamer;
|
||||
VideoCommon::StubStreamer<QueryCacheParams> primitives_needed_minus_succeeded_streamer;
|
||||
VideoCommon::StubStreamer<QueryCacheParams> primitives_needed_minus_suceeded_streamer;
|
||||
|
||||
std::vector<std::pair<VAddr, VAddr>> little_cache;
|
||||
std::vector<std::pair<VkBuffer, VkDeviceSize>> buffers_to_upload_to;
|
||||
@@ -1433,7 +1433,7 @@ VideoCommon::StreamerInterface* QueryCacheRuntime::GetStreamerInterface(QueryTyp
|
||||
case QueryType::StreamingPrimitivesSucceeded:
|
||||
return &impl->primitives_succeeded_streamer;
|
||||
case QueryType::StreamingPrimitivesNeededMinusSucceeded:
|
||||
return &impl->primitives_needed_minus_succeeded_streamer;
|
||||
return &impl->primitives_needed_minus_suceeded_streamer;
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -236,14 +236,14 @@ void StagingBufferPool::ReleaseLevel(StagingBuffersCache& cache, size_t log2) {
|
||||
auto& entries = staging.entries;
|
||||
const size_t old_size = entries.size();
|
||||
|
||||
const auto is_deletable = [this](const StagingBuffer& entry) {
|
||||
const auto is_deleteable = [this](const StagingBuffer& entry) {
|
||||
return scheduler.IsFree(entry.tick);
|
||||
};
|
||||
const size_t begin_offset = staging.delete_index;
|
||||
const size_t end_offset = std::min(begin_offset + deletions_per_tick, old_size);
|
||||
const auto begin = entries.begin() + begin_offset;
|
||||
const auto end = entries.begin() + end_offset;
|
||||
entries.erase(std::remove_if(begin, end, is_deletable), end);
|
||||
entries.erase(std::remove_if(begin, end, is_deleteable), end);
|
||||
|
||||
const size_t new_size = entries.size();
|
||||
staging.delete_index += deletions_per_tick;
|
||||
|
||||
@@ -125,7 +125,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) {
|
||||
MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, info.format);
|
||||
VkImageCreateFlags flags{};
|
||||
if (info.type == ImageType::e2D && info.resources.layers >= 6 &&
|
||||
info.size.width == info.size.height && !device.HasBrokenCubeImageCompatibility()) {
|
||||
info.size.width == info.size.height && !device.HasBrokenCubeImageCompability()) {
|
||||
flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
|
||||
}
|
||||
if (info.type == ImageType::e3D) {
|
||||
|
||||
@@ -322,7 +322,7 @@ GraphicsEnvironment::GraphicsEnvironment(Tegra::Engines::Maxwell3D& maxwell3d_,
|
||||
ASSERT(local_size <= std::numeric_limits<u32>::max());
|
||||
local_memory_size = static_cast<u32>(local_size) + sph.common3.shader_local_memory_crs_size;
|
||||
texture_bound = maxwell3d->regs.bindless_texture_const_buffer_slot;
|
||||
is_proprietary_driver = texture_bound == 2;
|
||||
is_propietary_driver = texture_bound == 2;
|
||||
has_hle_engine_state =
|
||||
maxwell3d->engine_state == Tegra::Engines::Maxwell3D::EngineHint::OnHLEMacro;
|
||||
}
|
||||
@@ -404,7 +404,7 @@ ComputeEnvironment::ComputeEnvironment(Tegra::Engines::KeplerCompute& kepler_com
|
||||
stage = Shader::Stage::Compute;
|
||||
local_memory_size = qmd.local_pos_alloc + qmd.local_crs_alloc;
|
||||
texture_bound = kepler_compute->regs.tex_cb_index;
|
||||
is_proprietary_driver = texture_bound == 2;
|
||||
is_propietary_driver = texture_bound == 2;
|
||||
shared_memory_size = qmd.shared_alloc;
|
||||
workgroup_size = {qmd.block_dim_x, qmd.block_dim_y, qmd.block_dim_z};
|
||||
}
|
||||
@@ -509,7 +509,7 @@ void FileEnvironment::Deserialize(std::ifstream& file) {
|
||||
file.read(reinterpret_cast<char*>(&gp_passthrough_mask), sizeof(gp_passthrough_mask));
|
||||
}
|
||||
}
|
||||
is_proprietary_driver = texture_bound == 2;
|
||||
is_propietary_driver = texture_bound == 2;
|
||||
}
|
||||
|
||||
void FileEnvironment::Dump(u64 pipeline_hash, u64 shader_hash) {
|
||||
|
||||
@@ -596,7 +596,7 @@ public:
|
||||
}
|
||||
|
||||
/// Returns true when the device does not properly support cube compatibility.
|
||||
bool HasBrokenCubeImageCompatibility() const {
|
||||
bool HasBrokenCubeImageCompability() const {
|
||||
return has_broken_cube_compatibility;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ struct Range {
|
||||
return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
|
||||
}
|
||||
|
||||
[[nodiscard]] VkMemoryPropertyFlags MemoryUsagePreferredVmaFlags(MemoryUsage usage) {
|
||||
[[nodiscard]] VkMemoryPropertyFlags MemoryUsagePreferedVmaFlags(MemoryUsage usage) {
|
||||
return usage != MemoryUsage::DeviceLocal ? VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
|
||||
: VkMemoryPropertyFlagBits{};
|
||||
}
|
||||
@@ -256,7 +256,7 @@ vk::Buffer MemoryAllocator::CreateBuffer(const VkBufferCreateInfo& ci, MemoryUsa
|
||||
.flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT | MemoryUsageVmaFlags(usage),
|
||||
.usage = MemoryUsageVma(usage),
|
||||
.requiredFlags = 0,
|
||||
.preferredFlags = MemoryUsagePreferredVmaFlags(usage),
|
||||
.preferredFlags = MemoryUsagePreferedVmaFlags(usage),
|
||||
.memoryTypeBits = usage == MemoryUsage::Stream ? 0u : valid_memory_types,
|
||||
.pool = VK_NULL_HANDLE,
|
||||
.pUserData = nullptr,
|
||||
|
||||
Reference in New Issue
Block a user