misc: fix issues pointed out by msvc (#7316)

* do not move constant variables

* applet_manager: avoid possible use after move

* use constant references where pointed out by msvc

* extra_hid: initialize response

* ValidateSaveState: passing slot separately is not necessary

* common: mark HashCombine as nodiscard

* cityhash: remove use of using namespace std

* Prefix all size_t with std::

done automatically by executing regex replace `([^:0-9a-zA-Z_])size_t([^0-9a-zA-Z_])` -> `$1std::size_t$2`
based on 7d8f115

* shared_memory.cpp: fix log error format

* fix compiling with pch off
This commit is contained in:
Vitor K
2024-01-07 17:37:42 -03:00
committed by GitHub
parent 6069fac76d
commit c8c2beaeff
73 changed files with 181 additions and 167 deletions

View File

@@ -691,7 +691,7 @@ void Instance::CollectToolingInfo() {
bool Instance::SetMoltenVkConfig() {
#ifdef __APPLE__
size_t mvk_config_size = sizeof(MVKConfiguration);
std::size_t mvk_config_size = sizeof(MVKConfiguration);
MVKConfiguration mvk_config{};
const auto _vkGetMoltenVKConfigurationMVK =

View File

@@ -543,7 +543,7 @@ void PipelineCache::BindTexelBuffer(u32 binding, vk::BufferView buffer_view) {
}
}
void PipelineCache::SetBufferOffset(u32 binding, size_t offset) {
void PipelineCache::SetBufferOffset(u32 binding, std::size_t offset) {
if (offsets[binding] != static_cast<u32>(offset)) {
offsets[binding] = static_cast<u32>(offset);
set_dirty[0] = true;

View File

@@ -79,7 +79,7 @@ public:
void BindTexelBuffer(u32 binding, vk::BufferView buffer_view);
/// Sets the dynamic offset for the uniform buffer at binding
void SetBufferOffset(u32 binding, size_t offset);
void SetBufferOffset(u32 binding, std::size_t offset);
private:
/// Builds the rasterizer pipeline layout

View File

@@ -63,7 +63,7 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL DebugUtilsCallback(
static VKAPI_ATTR VkBool32 VKAPI_CALL DebugReportCallback(VkDebugReportFlagsEXT flags,
VkDebugReportObjectTypeEXT objectType,
uint64_t object, size_t location,
uint64_t object, std::size_t location,
int32_t messageCode,
const char* pLayerPrefix,
const char* pMessage, void* pUserData) {

View File

@@ -235,7 +235,7 @@ void RasterizerVulkan::SetupVertexArray() {
if (aligned_stride == loader.byte_count) {
std::memcpy(dst_ptr, src_ptr, data_size);
} else {
for (size_t vertex = 0; vertex < vertex_num; vertex++) {
for (std::size_t vertex = 0; vertex < vertex_num; vertex++) {
std::memcpy(dst_ptr + vertex * aligned_stride, src_ptr + vertex * loader.byte_count,
loader.byte_count);
}

View File

@@ -35,8 +35,8 @@ struct RenderPass {
};
class RenderpassCache {
static constexpr size_t MAX_COLOR_FORMATS = 13;
static constexpr size_t MAX_DEPTH_FORMATS = 4;
static constexpr std::size_t MAX_COLOR_FORMATS = 13;
static constexpr std::size_t MAX_DEPTH_FORMATS = 4;
public:
explicit RenderpassCache(const Instance& instance, Scheduler& scheduler);

View File

@@ -10,7 +10,7 @@
namespace Vulkan {
ResourcePool::ResourcePool(MasterSemaphore* master_semaphore_, size_t grow_step_)
ResourcePool::ResourcePool(MasterSemaphore* master_semaphore_, std::size_t grow_step_)
: master_semaphore{master_semaphore_}, grow_step{grow_step_} {}
std::size_t ResourcePool::CommitResource() {
@@ -57,12 +57,12 @@ std::size_t ResourcePool::ManageOverflow() {
}
void ResourcePool::Grow() {
const size_t old_capacity = ticks.size();
const std::size_t old_capacity = ticks.size();
ticks.resize(old_capacity + grow_step);
Allocate(old_capacity, old_capacity + grow_step);
}
constexpr size_t COMMAND_BUFFER_POOL_SIZE = 4;
constexpr std::size_t COMMAND_BUFFER_POOL_SIZE = 4;
struct CommandPool::Pool {
vk::CommandPool handle;

View File

@@ -119,9 +119,9 @@ u32 UnpackDepthStencil(const VideoCore::StagingData& data, vk::Format dest) {
}
boost::container::small_vector<vk::ImageMemoryBarrier, 3> MakeInitBarriers(
vk::ImageAspectFlags aspect, std::span<const vk::Image> images, size_t num_images) {
vk::ImageAspectFlags aspect, std::span<const vk::Image> images, std::size_t num_images) {
boost::container::small_vector<vk::ImageMemoryBarrier, 3> barriers;
for (size_t i = 0; i < num_images; i++) {
for (std::size_t i = 0; i < num_images; i++) {
barriers.push_back(vk::ImageMemoryBarrier{
.srcAccessMask = vk::AccessFlagBits::eNone,
.dstAccessMask = vk::AccessFlagBits::eNone,