diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index fff926468e..bd11a1db52 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -259,7 +259,7 @@ namespace VkRenderPassCreateInfo rp_info = {}; rp_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; - rp_info.attachmentCount = attachments.size(); + rp_info.attachmentCount = static_cast(attachments.size()); rp_info.pAttachments = attachments.data(); rp_info.subpassCount = 1; rp_info.pSubpasses = &subpass; @@ -337,7 +337,7 @@ namespace VkDescriptorSetLayoutCreateInfo infos = {}; infos.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; infos.pBindings = bindings.data(); - infos.bindingCount = bindings.size(); + infos.bindingCount = static_cast(bindings.size()); VkDescriptorSetLayout set_layout; CHECK_RESULT(vkCreateDescriptorSetLayout(dev, &infos, nullptr, &set_layout)); @@ -419,7 +419,7 @@ VKGSRender::VKGSRender() : GSRender(frame_type::Vulkan) std::vector sizes{ uniform_buffer_pool, uniform_texel_pool, texture_pool }; - descriptor_pool.create(*m_device, sizes.data(), sizes.size()); + descriptor_pool.create(*m_device, sizes.data(), static_cast(sizes.size())); null_buffer = std::make_unique(*m_device, 32, m_memory_type_mapping.host_visible_coherent, VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, 0); @@ -438,7 +438,7 @@ VKGSRender::VKGSRender() : GSRender(frame_type::Vulkan) VKGSRender::~VKGSRender() { - CHECK_RESULT(vkQueueWaitIdle(m_swap_chain->get_present_queue())); + vkQueueWaitIdle(m_swap_chain->get_present_queue()); if (m_present_semaphore) { @@ -1002,7 +1002,7 @@ void VKGSRender::close_and_submit_command_buffer(const std::vector infos.pCommandBuffers = &cmd; infos.pWaitDstStageMask = &pipe_stage_flags; infos.pWaitSemaphores = semaphores.data(); - infos.waitSemaphoreCount = semaphores.size(); + infos.waitSemaphoreCount = static_cast(semaphores.size()); infos.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; CHECK_RESULT(vkQueueSubmit(m_swap_chain->get_present_queue(), 1, &infos, fence)); @@ -1071,7 +1071,7 @@ void VKGSRender::prepare_rtts() fbo_images.push_back(std::make_unique(*m_device, raw->value, VK_IMAGE_VIEW_TYPE_2D, raw->info.format, vk::default_component_map(), subres)); } - m_draw_buffers_count = fbo_images.size(); + m_draw_buffers_count = static_cast(fbo_images.size()); if (std::get<1>(m_rtts.m_bound_depth_stencil) != nullptr) { diff --git a/rpcs3/Emu/RSX/VK/VKHelpers.cpp b/rpcs3/Emu/RSX/VK/VKHelpers.cpp index 4dd58e794f..772234150c 100644 --- a/rpcs3/Emu/RSX/VK/VKHelpers.cpp +++ b/rpcs3/Emu/RSX/VK/VKHelpers.cpp @@ -43,7 +43,7 @@ namespace vk result.device_local = VK_MAX_MEMORY_TYPES; result.host_visible_coherent = VK_MAX_MEMORY_TYPES; - for (int i = 0; i < memory_properties.memoryTypeCount; i++) + for (u32 i = 0; i < memory_properties.memoryTypeCount; i++) { bool is_device_local = !!(memory_properties.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); if (is_device_local) diff --git a/rpcs3/Emu/RSX/VK/VKHelpers.h b/rpcs3/Emu/RSX/VK/VKHelpers.h index 11aa842a49..2573665409 100644 --- a/rpcs3/Emu/RSX/VK/VKHelpers.h +++ b/rpcs3/Emu/RSX/VK/VKHelpers.h @@ -181,7 +181,7 @@ namespace vk device.pNext = NULL; device.queueCreateInfoCount = 1; device.pQueueCreateInfos = &queue; - device.enabledLayerCount = layers.size(); + device.enabledLayerCount = static_cast(layers.size()); device.ppEnabledLayerNames = layers.data(); device.enabledExtensionCount = 1; device.ppEnabledExtensionNames = requested_extensions; @@ -343,7 +343,7 @@ namespace vk VkImageType image_type, VkFormat format, uint32_t width, uint32_t height, uint32_t depth, - VkDeviceSize mipmaps, VkDeviceSize layers, + uint32_t mipmaps, uint32_t layers, VkSampleCountFlagBits samples, VkImageLayout initial_layout, VkImageTiling tiling, @@ -496,7 +496,7 @@ namespace vk vkDestroyBuffer(m_device, value, nullptr); } - void *map(u32 offset, u64 size) + void *map(u64 offset, u64 size) { void *data = nullptr; CHECK_RESULT(vkMapMemory(m_device, memory->memory, offset, size, 0, &data)); @@ -604,7 +604,7 @@ namespace vk info.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; info.width = width; info.height = height; - info.attachmentCount = image_view_array.size(); + info.attachmentCount = static_cast(image_view_array.size()); info.pAttachments = image_view_array.data(); info.renderPass = pass; info.layers = 1; @@ -1044,7 +1044,7 @@ namespace vk VkInstanceCreateInfo instance_info = {}; instance_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; instance_info.pApplicationInfo = &app; - instance_info.enabledLayerCount = layers.size(); + instance_info.enabledLayerCount = static_cast(layers.size()); instance_info.ppEnabledLayerNames = layers.data(); instance_info.enabledExtensionCount = 3; instance_info.ppEnabledExtensionNames = requested_extensions; diff --git a/rpcs3/Emu/RSX/VK/VKRenderTargets.h b/rpcs3/Emu/RSX/VK/VKRenderTargets.h index 27110891f1..3d282589fb 100644 --- a/rpcs3/Emu/RSX/VK/VKRenderTargets.h +++ b/rpcs3/Emu/RSX/VK/VKRenderTargets.h @@ -23,7 +23,7 @@ namespace rsx rtt.reset(new vk::image(device, mem_mapping.device_local, VK_IMAGE_TYPE_2D, requested_format, - width, height, 1, 1, 1, + static_cast(width), static_cast(height), 1, 1, 1, VK_SAMPLE_COUNT_1_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_TILING_OPTIMAL, @@ -55,7 +55,7 @@ namespace rsx std::unique_ptr ds; ds.reset(new vk::image(device, mem_mapping.device_local, - VK_IMAGE_TYPE_2D, requested_format, width, height, 1, 1, 1, VK_SAMPLE_COUNT_1_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT|VK_IMAGE_USAGE_SAMPLED_BIT, 0)); + VK_IMAGE_TYPE_2D, requested_format, static_cast(width), static_cast(height), 1, 1, 1, VK_SAMPLE_COUNT_1_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT|VK_IMAGE_USAGE_SAMPLED_BIT, 0)); change_image_layout(*cmd, ds->value, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, range); //Clear new surface.. diff --git a/rpcs3/Emu/RSX/VK/VKTexture.cpp b/rpcs3/Emu/RSX/VK/VKTexture.cpp index 7fcfd74b67..f454795d60 100644 --- a/rpcs3/Emu/RSX/VK/VKTexture.cpp +++ b/rpcs3/Emu/RSX/VK/VKTexture.cpp @@ -138,7 +138,7 @@ namespace vk for (const rsx_subresource_layout &layout : subresource_layout) { u32 row_pitch = align(layout.width_in_block * block_size_in_bytes, 256); - size_t image_linear_size = row_pitch * layout.height_in_block * layout.depth; + u32 image_linear_size = row_pitch * layout.height_in_block * layout.depth; size_t offset_in_buffer = upload_heap.alloc<512>(image_linear_size); void *mapped_buffer = upload_buffer->map(offset_in_buffer, image_linear_size); diff --git a/rpcs3/Emu/RSX/VK/VKTextureCache.h b/rpcs3/Emu/RSX/VK/VKTextureCache.h index 45725cd0d1..36f8eb134d 100644 --- a/rpcs3/Emu/RSX/VK/VKTextureCache.h +++ b/rpcs3/Emu/RSX/VK/VKTextureCache.h @@ -119,12 +119,12 @@ namespace vk obj.protected_rgn_end = (u32)align(obj.native_rsx_size, memory_page_size); obj.protected_rgn_end += obj.protected_rgn_start; - lock_memory_region(obj.protected_rgn_start, obj.native_rsx_size); + lock_memory_region(static_cast(obj.protected_rgn_start), static_cast(obj.native_rsx_size)); } void unlock_object(cached_texture_object &obj) { - unlock_memory_region(obj.protected_rgn_start, obj.native_rsx_size); + unlock_memory_region(static_cast(obj.protected_rgn_start), static_cast(obj.native_rsx_size)); } void purge_dirty_textures() diff --git a/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp b/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp index a5cf747b32..20968cceb8 100644 --- a/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp +++ b/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp @@ -99,7 +99,7 @@ namespace vk indices[i] = i; indices[i] = 0; - return indices.size(); + return static_cast(indices.size()); } template @@ -112,7 +112,7 @@ namespace vk indices[i] = original_indices[i]; indices[i] = original_indices[0]; - return indices.size(); + return static_cast(indices.size()); } /** @@ -454,7 +454,7 @@ VKGSRender::upload_vertex_data() { case rsx::vertex_base_type::f: { - const u32 num_stored_verts = data_size / (sizeof(float) * vertex_info.size); + const u32 num_stored_verts = static_cast(data_size / (sizeof(float) * vertex_info.size)); vk::expand_array_components(reinterpret_cast(vertex_data.data()), converted_buffer, num_stored_verts); break; } @@ -532,7 +532,7 @@ VKGSRender::upload_vertex_data() } else { - index_count = get_index_count(draw_mode, vertex_draw_count); + index_count = static_cast(get_index_count(draw_mode, vertex_draw_count)); std::vector indices(index_count); if (is_indexed_draw) @@ -568,7 +568,7 @@ VKGSRender::upload_vertex_data() index_format = VK_INDEX_TYPE_UINT16; VkFormat fmt = VK_FORMAT_R16_UINT; - u32 elem_size = get_index_type_size(indexed_type); + u32 elem_size = static_cast(get_index_type_size(indexed_type)); if (indexed_type == rsx::index_array_type::u32) { @@ -576,7 +576,7 @@ VKGSRender::upload_vertex_data() fmt = VK_FORMAT_R32_UINT; } - u32 index_sz = vertex_index_array.size() / elem_size; + u32 index_sz = static_cast(vertex_index_array.size()) / elem_size; if (index_sz != vertex_draw_count) LOG_ERROR(RSX, "Vertex draw count mismatch!"); diff --git a/rpcs3/VKGSRender.vcxproj b/rpcs3/VKGSRender.vcxproj index a782cc17c7..f632daf5a2 100644 --- a/rpcs3/VKGSRender.vcxproj +++ b/rpcs3/VKGSRender.vcxproj @@ -100,6 +100,7 @@ Disabled _DEBUG;_LIB;%(PreprocessorDefinitions) ..\Vulkan\Vulkan-LoaderAndValidationLayers\include;..\Vulkan\glslang\glslang\Public;%(AdditionalIncludeDirectories) + true Windows @@ -115,6 +116,7 @@ true NDEBUG;_LIB;%(PreprocessorDefinitions) ..\Vulkan\Vulkan-LoaderAndValidationLayers\include;..\Vulkan\glslang\glslang\Public;%(AdditionalIncludeDirectories) + true Windows @@ -125,16 +127,19 @@ ..\Vulkan\Vulkan-LoaderAndValidationLayers\include;..\Vulkan\glslang\glslang\Public;%(AdditionalIncludeDirectories) + true ..\Vulkan\Vulkan-LoaderAndValidationLayers\include;..\Vulkan\glslang\glslang\Public;%(AdditionalIncludeDirectories) + true ..\Vulkan\Vulkan-LoaderAndValidationLayers\include;..\Vulkan\glslang\glslang\Public;%(AdditionalIncludeDirectories) + true