[GPU Common Vulkan/UI/Windows Debugger] Added const reference for function params

This commit is contained in:
Herman Semenov 2023-12-14 14:23:31 +03:00
parent af41281761
commit 3d422b11c0
15 changed files with 26 additions and 26 deletions

View file

@ -241,7 +241,7 @@ std::vector<std::string> TextureShaderCache::DebugGetShaderIDs(DebugShaderType t
return ids;
}
std::string TextureShaderCache::DebugGetShaderString(std::string idstr, DebugShaderType type, DebugShaderStringType stringType) {
std::string TextureShaderCache::DebugGetShaderString(const std::string &idstr, DebugShaderType type, DebugShaderStringType stringType) {
uint32_t id = 0;
sscanf(idstr.c_str(), "%08x", &id);
auto iter = depalCache_.find(id);

View file

@ -54,7 +54,7 @@ public:
void Clear();
void Decimate();
std::vector<std::string> DebugGetShaderIDs(DebugShaderType type);
std::string DebugGetShaderString(std::string id, DebugShaderType type, DebugShaderStringType stringType);
std::string DebugGetShaderString(const std::string &id, DebugShaderType type, DebugShaderStringType stringType);
void DeviceLost();
void DeviceRestore(Draw::DrawContext *draw);

View file

@ -166,7 +166,7 @@ static bool UsesBlendConstant(int factor) {
}
}
static std::string CutFromMain(std::string str) {
static std::string CutFromMain(const std::string &str) {
std::vector<std::string> lines;
SplitString(str, '\n', lines);
@ -495,7 +495,7 @@ static const char *const blendFactors[19] = {
"INV_SRC1_A",
};
std::string PipelineManagerVulkan::DebugGetObjectString(std::string id, DebugShaderType type, DebugShaderStringType stringType, ShaderManagerVulkan *shaderManager) {
std::string PipelineManagerVulkan::DebugGetObjectString(const std::string &id, DebugShaderType type, DebugShaderStringType stringType, ShaderManagerVulkan *shaderManager) {
if (type != SHADER_TYPE_PIPELINE)
return "N/A";

View file

@ -95,7 +95,7 @@ public:
void InvalidateMSAAPipelines();
std::string DebugGetObjectString(std::string id, DebugShaderType type, DebugShaderStringType stringType, ShaderManagerVulkan *shaderManager);
std::string DebugGetObjectString(const std::string &id, DebugShaderType type, DebugShaderStringType stringType, ShaderManagerVulkan *shaderManager);
std::vector<std::string> DebugGetObjectIDs(DebugShaderType type) const;
// Saves data for faster creation next time.

View file

@ -159,7 +159,7 @@ VkSampler SamplerCache::GetOrCreateSampler(const SamplerCacheKey &key) {
return sampler;
}
std::string SamplerCache::DebugGetSamplerString(std::string id, DebugShaderStringType stringType) {
std::string SamplerCache::DebugGetSamplerString(const std::string &id, DebugShaderStringType stringType) {
SamplerCacheKey key;
key.FromString(id);
return StringFromFormat("%s/%s mag:%s min:%s mip:%s maxLod:%f minLod:%f bias:%f",
@ -852,7 +852,7 @@ std::vector<std::string> TextureCacheVulkan::DebugGetSamplerIDs() const {
return samplerCache_.DebugGetSamplerIDs();
}
std::string TextureCacheVulkan::DebugGetSamplerString(std::string id, DebugShaderStringType stringType) {
std::string TextureCacheVulkan::DebugGetSamplerString(const std::string &id, DebugShaderStringType stringType) {
return samplerCache_.DebugGetSamplerString(id, stringType);
}

View file

@ -44,7 +44,7 @@ public:
void DeviceRestore(VulkanContext *vulkan);
std::vector<std::string> DebugGetSamplerIDs() const;
std::string DebugGetSamplerString(std::string id, DebugShaderStringType stringType);
std::string DebugGetSamplerString(const std::string &id, DebugShaderStringType stringType);
private:
VulkanContext *vulkan_;
@ -81,7 +81,7 @@ public:
VulkanDeviceAllocator *GetAllocator() { return allocator_; }
std::vector<std::string> DebugGetSamplerIDs() const;
std::string DebugGetSamplerString(std::string id, DebugShaderStringType stringType);
std::string DebugGetSamplerString(const std::string &id, DebugShaderStringType stringType);
protected:
void BindTexture(TexCacheEntry *entry) override;

View file

@ -69,7 +69,7 @@ private:
UI::EventReturn OnReplace(UI::EventParams &params);
UI::EventReturn OnReplaceAll(UI::EventParams &params);
void MappedCallback(MultiInputMapping key);
void MappedCallback(const MultiInputMapping &key);
enum Action {
NONE,
@ -163,7 +163,7 @@ void SingleControlMapper::Refresh() {
}
}
void SingleControlMapper::MappedCallback(MultiInputMapping kdf) {
void SingleControlMapper::MappedCallback(const MultiInputMapping &kdf) {
if (kdf.empty()) {
// Don't want to try to add this.
return;
@ -1192,7 +1192,7 @@ UI::EventReturn VisualMappingScreen::OnBindAll(UI::EventParams &e) {
return UI::EVENT_DONE;
}
void VisualMappingScreen::HandleKeyMapping(MultiInputMapping key) {
void VisualMappingScreen::HandleKeyMapping(const KeyMap::MultiInputMapping &key) {
KeyMap::SetInputMapping(nextKey_, key, replace_);
KeyMap::UpdateNativeMenuKeys();

View file

@ -197,7 +197,7 @@ protected:
private:
UI::EventReturn OnMapButton(UI::EventParams &e);
UI::EventReturn OnBindAll(UI::EventParams &e);
void HandleKeyMapping(KeyMap::MultiInputMapping key);
void HandleKeyMapping(const KeyMap::MultiInputMapping &key);
void MapNext(bool successive);
MockPSP *psp_ = nullptr;

View file

@ -50,7 +50,7 @@
#include "UI/MiscScreens.h"
#include "UI/OnScreenDisplay.h"
static bool FolderSeemsToBeUsed(Path newMemstickFolder) {
static bool FolderSeemsToBeUsed(const Path &newMemstickFolder) {
// Inspect the potential new folder, quickly.
if (File::Exists(newMemstickFolder / "PSP/SAVEDATA") || File::Exists(newMemstickFolder / "SAVEDATA")) {
// Does seem likely. We could add more criteria like checking for actual savegames or something.
@ -514,7 +514,7 @@ struct FileSuffix {
u64 fileSize;
};
static bool ListFileSuffixesRecursively(const Path &root, Path folder, std::vector<std::string> &dirSuffixes, std::vector<FileSuffix> &fileSuffixes) {
static bool ListFileSuffixesRecursively(const Path &root, const Path &folder, std::vector<std::string> &dirSuffixes, std::vector<FileSuffix> &fileSuffixes) {
std::vector<File::FileInfo> files;
if (!File::GetFilesInDir(folder, &files)) {
return false;

View file

@ -93,7 +93,7 @@ private:
class ProgressReporter {
public:
void Set(std::string value) {
void Set(const std::string &value) {
std::lock_guard<std::mutex> guard(mutex_);
progress_ = value;
}

View file

@ -266,7 +266,7 @@ UI::EventReturn SavedataPopupScreen::OnDeleteButtonClick(UI::EventParams &e) {
return UI::EVENT_DONE;
}
static std::string CleanSaveString(std::string str) {
static std::string CleanSaveString(const std::string &str) {
std::string s = ReplaceAll(str, "&", "&&");
s = ReplaceAll(s, "\n", " ");
s = ReplaceAll(s, "\r", " ");

View file

@ -43,7 +43,7 @@ static std::string StoreBaseUrl() {
}
// baseUrl is assumed to have a trailing slash, and not contain any subdirectories.
std::string ResolveUrl(std::string baseUrl, std::string url) {
std::string ResolveUrl(const std::string &baseUrl, const std::string &url) {
if (url.empty()) {
return baseUrl;
} else if (url[0] == '/') {
@ -91,7 +91,7 @@ public:
void Draw(UIContext &dc) override;
std::string DescribeText() const override { return ""; }
void SetFilename(std::string filename);
void SetFilename(const std::string &filename);
void SetColor(uint32_t color) { color_ = color; }
void SetFixedSize(float fixW, float fixH) { fixedSizeW_ = fixW; fixedSizeH_ = fixH; }
void SetCanBeFocused(bool can) { canFocus_ = can; }
@ -150,7 +150,7 @@ void HttpImageFileView::GetContentDimensions(const UIContext &dc, float &w, floa
}
}
void HttpImageFileView::SetFilename(std::string filename) {
void HttpImageFileView::SetFilename(const std::string &filename) {
if (!useIconCache_ && path_ != filename) {
textureFailed_ = false;
path_ = filename;
@ -454,7 +454,7 @@ void StoreScreen::update() {
}
}
void StoreScreen::ParseListing(std::string json) {
void StoreScreen::ParseListing(const std::string &json) {
using namespace json;
JsonReader reader(json.c_str(), json.size());
if (!reader.ok() || !reader.root()) {
@ -585,7 +585,7 @@ UI::EventReturn StoreScreen::OnRetry(UI::EventParams &e) {
return UI::EVENT_DONE;
}
std::string StoreScreen::GetTranslatedString(const json::JsonGet json, std::string key, const char *fallback) const {
std::string StoreScreen::GetTranslatedString(const json::JsonGet json, const std::string &key, const char *fallback) const {
json::JsonGet dict = json.getDict("en_US");
if (dict && json.hasChild(lang_.c_str(), JSON_OBJECT)) {
if (json.getDict(lang_.c_str()).hasChild(key.c_str(), JSON_STRING)) {

View file

@ -72,10 +72,10 @@ protected:
UI::EventReturn OnGameLaunch(UI::EventParams &e);
private:
void ParseListing(std::string json);
void ParseListing(const std::string &json);
ProductItemView *GetSelectedItem();
std::string GetTranslatedString(const json::JsonGet json, std::string key, const char *fallback = nullptr) const;
std::string GetTranslatedString(const json::JsonGet json, const std::string &key, const char *fallback = nullptr) const;
std::shared_ptr<http::Request> listing_;
std::shared_ptr<http::Request> image_;

View file

@ -277,7 +277,7 @@ std::string trimString(std::string input)
return input;
}
void CtrlDisAsmView::assembleOpcode(u32 address, std::string defaultText)
void CtrlDisAsmView::assembleOpcode(u32 address, const std::string &defaultText)
{
auto memLock = Memory::Lock();
if (Core_IsStepping() == false) {

View file

@ -67,7 +67,7 @@ class CtrlDisAsmView
ADDRESSES,
};
void assembleOpcode(u32 address, std::string defaultText);
void assembleOpcode(u32 address, const std::string &defaultText);
std::string disassembleRange(u32 start, u32 size);
void disassembleToFile();
void search(bool continueSearch);